@import url('https://fonts.googleapis.com/css2?family=Delius:wght@400;700&family=SUSE+Mono:wght@400;700&display=swap');

:root {
  --maya-green: #97c026;
  --maya-blue: #aad3df;
  --maya-pink: #fea29b;
  --maya-orange: #ff9863;
  --maya-yellow: #f5dc79;
  --maya-dark: #434343;
  --maya-white: #ffffff;
  --base-font-size: 16px;
  --h1-size: calc(var(--base-font-size) * 2.75);
  --h2-size: calc(var(--base-font-size) * 1.75);
  --h3-size: calc(var(--base-font-size) * 1.25);
  --transition-speed: 200ms;
  --transition-timing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'SUSE Mono', monospace;
  font-size: var(--base-font-size);
  line-height: 1.5;
  margin: 0;
  background: var(--maya-white);
  color: var(--maya-dark);
  transition: background-color 300ms ease, color 300ms ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--maya-white) url('assets/shared/dots.png') repeat;
  mix-blend-mode: multiply;
  animation: floatSlow 22s ease-in-out infinite;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 8px 10px;
  background: var(--maya-yellow);
  color: var(--maya-dark);
  border-radius: 4px;
  z-index: 9999;
}

a { transition: color var(--transition-speed) ease; }
a:hover { text-decoration: underline; }

button:focus, a:focus, .gallery img:focus {
  outline: 3px dashed rgba(170, 211, 223, 0.45);
  outline-offset: 4px;
}

h1, h2, h3, .header, .nav-buttons a, #writing ul li a { font-family: 'Delius', cursive; }

h1 {
  color: var(--maya-dark);
  font-size: var(--h1-size);
  margin: 0 0 0.25em 0;
  line-height: 1.1;
}

h2 {
  color: var(--maya-pink);
  font-size: var(--h2-size);
  border-bottom: 2px solid var(--maya-yellow);
  padding-bottom: 5px;
  margin: 0.5em 0;
}

h3 {
  color: var(--maya-blue);
  font-size: var(--h3-size);
  margin: 2em 0 0.75rem 0;
}

ul { line-height: 1.6; padding-left: 20px; }

.nav-buttons {
  margin-top: calc(var(--base-font-size) * 1.25);
  text-align: center;
  margin-bottom: calc(var(--base-font-size) * 1.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--base-font-size) * 0.625);
}

.nav-buttons a {
  background-color: var(--maya-blue);
  border: none;
  padding: calc(var(--base-font-size) * 0.625) calc(var(--base-font-size) * 0.9375);
  border-radius: 5px;
  cursor: pointer;
  font-size: calc(var(--base-font-size) * 0.9);
  transition: transform 90ms linear, filter 200ms ease, background-color 200ms ease;
  will-change: transform;
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.nav-buttons a:hover { transform: rotate(-1deg) translateY(-2px); }
.nav-buttons a:active { transform: translateY(0) scale(0.99); }
.nav-buttons a.active {
  background-color: var(--maya-pink);
  color: var(--maya-white);
  cursor: default;
}

@media (max-width: 600px) {
  .nav-buttons { flex-direction: column; align-items: stretch; }
  .nav-buttons a { width: 100%; text-align: center; }
}

.content-box {
  background-color: var(--maya-green);
  border-radius: 10px;
  padding: calc(var(--base-font-size) * 1.875) calc(var(--base-font-size) * 1.25);
  margin: calc(var(--base-font-size) * 1.25) auto;
  max-width: 900px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: background-color 300ms ease;
}

.content-box:hover .content > div.section,
.content-box:hover .content > #contact,
.content-box:hover .content > #projects,
.content-box:hover .content > #experiences,
.content-box:hover .content > #writing,
.content-box:hover main > section {
  background-color: var(--maya-white);
  position: relative;
  z-index: 10;
  border-radius: 10px;
  padding: calc(var(--base-font-size) * 1.25);
  transform: translateY(6px) rotate(-0.4deg) skewX(-0.12deg);
  animation: paperLift 650ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.content { margin: 0 auto; }

.header {
  animation: headerFloat 680ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
  background-color: var(--maya-blue);
  padding: calc(var(--base-font-size) * 1.875) calc(var(--base-font-size) * 1.25);
  text-align: center;
  color: var(--maya-dark);
  border-bottom: 2px solid var(--maya-yellow);
  position: relative;
  z-index: 1;
  transition: background-color 300ms ease;
}

.header-area { position: relative; overflow: visible; }

.floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-icons .decor-icon { pointer-events: auto; }

.decor-icon {
  position: absolute;
  width: 60px;
  height: 60px;
  opacity: 0.95;
  pointer-events: auto;
  transform-origin: center;
  z-index: 1;
  transition: transform var(--transition-speed) ease;
}

.decor-icon:hover { animation: spin 420ms ease both; }
.decor-icon:active { transform: scale(1.3); cursor: pointer; }
.decor-icon.pressed { animation: buttonPress 200ms ease; }

.icon1 { top: 10px; left: 10px; }
.icon2 { top: 20px; right: 10px; }
.icon3 { bottom: 10px; left: 20%; }
.icon4 { bottom: 10px; right: 20%; }
.icon5 { top: 60%; left: -20px; }
.icon6 { top: 60%; right: -20px; }
.icon7 { top: -15px; left: 20%; }
.icon8 { bottom: -15px; left: 50%; }
.icon9 { top: 50px; left: 10%; }
.icon10 { top: 50px; right: 10%; }

.content img, .content-box img, .gallery img, img.responsive {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

img:not(.decor-icon) {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: calc(var(--base-font-size) * 0.625) 0;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb {
  background-color: var(--maya-blue);
  border-radius: 10px;
}

.gallery img:not(.art-thumbnail) {
  max-width: 360px;
  width: 100%;
  height: auto;
  border-radius: 5px;
  flex: 0 1 auto;
  object-fit: contain;
  background-color: #fff;
  transition: transform var(--transition-speed) var(--transition-timing);
  will-change: transform;
}

.gallery img:hover, .gallery img:focus { transform: rotate(-0.6deg) translateY(-4px); }

.art-thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  background-color: #fff;
  flex: 0 0 auto;
  transition: transform var(--transition-speed) ease;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: calc(var(--base-font-size) * 1.25);
  margin: calc(var(--base-font-size) * 1.25) 0;
}

.art-grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.art-grid img:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 200ms ease;
}

.lightbox.active { display: flex; }

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  animation: zoomIn 250ms ease;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--maya-pink);
  color: var(--maya-white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
  transition: background 200ms ease, transform 200ms ease;
  font-family: 'Delius', cursive;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover { background: var(--maya-orange); transform: rotate(90deg); }
.lightbox-close:focus {
  outline: 3px dashed rgba(170, 211, 223, 0.45);
  outline-offset: 4px;
}

#contact {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(var(--base-font-size) * 1.25);
  background-color: var(--maya-white);
  border-radius: 10px;
  border: 1px dashed rgba(170, 211, 223, 0.35);
}

#contact h2 { margin: 0 0 calc(var(--base-font-size) * 0.9375) 0; }
#contact p { font-size: calc(var(--base-font-size) * 1.1); margin-bottom: calc(var(--base-font-size) * 1.25); }
#contact ul { list-style-type: none; padding-left: 0; }
#contact ul li { margin-bottom: calc(var(--base-font-size) * 0.75); }

#contact ul li a {
  color: var(--maya-pink);
  text-decoration: none;
  font-weight: 600;
  font-size: calc(var(--base-font-size) * 1.1);
  transition: color 300ms ease;
}

#contact ul li a:hover, #contact ul li a:focus {
  color: var(--maya-orange);
  text-decoration: underline;
}

#projects {
  max-width: 800px;
  margin: calc(var(--base-font-size) * 1.25) auto;
  padding: calc(var(--base-font-size) * 0.625);
}

#projects h2 { font-size: var(--h2-size); }
#projects ul { list-style-type: disc; color: var(--maya-dark); }

.project {
  margin-bottom: calc(var(--base-font-size) * 2);
  padding-bottom: calc(var(--base-font-size) * 2);
  border-bottom: 1px solid rgba(170, 211, 223, 0.2);
}

.project:last-child { border-bottom: none; }
.project h2 { margin-top: 0; }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--base-font-size) * 0.625);
  margin: calc(var(--base-font-size) * 0.9375) 0;
}

.project-links a {
  display: inline-block;
  background-color: var(--maya-blue);
  color: var(--maya-dark);
  padding: calc(var(--base-font-size) * 0.5) calc(var(--base-font-size) * 1);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: all 200ms ease;
}

.project-links a:hover {
  background-color: var(--maya-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.project-preview {
  margin: calc(var(--base-font-size) * 1.25) 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.project-preview a:hover img {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#experiences {
  max-width: 800px;
  margin: calc(var(--base-font-size) * 1.25) auto;
  padding: calc(var(--base-font-size) * 1.25);
  background-color: var(--maya-white);
  border-radius: 10px;
  color: var(--maya-dark);
  line-height: 1.6;
}

#experiences h2 {
  font-size: calc(var(--base-font-size) * 2);
  margin-bottom: calc(var(--base-font-size) * 0.9375);
  border-bottom: 2px solid var(--maya-blue);
  padding-bottom: 5px;
}

#experiences h3 {
  color: var(--maya-blue);
  font-size: calc(var(--base-font-size) * 1.5);
  margin: calc(var(--base-font-size) * 1.25) 0 calc(var(--base-font-size) * 0.625) 0;
}

#experiences p, #experiences ul { font-size: calc(var(--base-font-size) * 1.1); margin-bottom: calc(var(--base-font-size) * 0.9375); }
#experiences ul { padding-left: calc(var(--base-font-size) * 1.25); }
#experiences ul li { margin-bottom: calc(var(--base-font-size) * 0.375); }

#writing ul li a {
  color: var(--maya-pink);
  text-decoration: none;
  font-weight: 600;
  font-size: calc(var(--base-font-size) * 1.1);
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
  transition: color 300ms ease;
}

#writing ul li a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--maya-orange);
  border-radius: 2px;
  transition: width 300ms ease;
}

#writing ul li a:hover::after { width: 100%; }
#writing ul li a:hover { text-decoration: none; color: var(--maya-orange); }

footer {
  background-color: var(--maya-orange);
  color: var(--maya-dark);
  text-align: center;
  padding: calc(var(--base-font-size) * 0.9375);
  border-top: 2px solid var(--maya-pink);
  font-family: 'Delius', cursive;
  font-size: calc(var(--base-font-size) * 0.95);
  transition: background-color 300ms ease;
}

.coming-soon {
  font-style: italic;
  color: var(--maya-blue);
  background-color: rgba(170, 211, 223, 0.1);
  padding: calc(var(--base-font-size) * 0.9375);
  border-radius: 8px;
  border-left: 4px solid var(--maya-blue);
}

.lead { font-size: calc(var(--base-font-size) * 1.05); line-height: 1.6; color: var(--maya-dark); }
.about-bio p { margin: 0 0 calc(var(--base-font-size) * 0.5625) 0; }
.about-bio .cta a {
  background: var(--maya-blue);
  padding: calc(var(--base-font-size) * 0.375) calc(var(--base-font-size) * 0.625);
  border-radius: 6px;
  color: var(--maya-dark);
  text-decoration: none;
  margin-right: calc(var(--base-font-size) * 0.375);
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: calc(var(--base-font-size) * 1.5625);
  margin: calc(var(--base-font-size) * 1.5625) 0 calc(var(--base-font-size) * 2.5) 0;
}

.favorite-item { text-align: center; }

.favorite-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}

.favorite-item img:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.favorite-title { margin-top: calc(var(--base-font-size) * 0.625); font-size: calc(var(--base-font-size) * 0.9); color: var(--maya-dark); font-weight: 600; }

body.dark-mode {
  --maya-white: #1a1a1a;
  --maya-dark: #e0e0e0;
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode::after { background: #1a1a1a url('assets/shared/dots.png') repeat; }
body.dark-mode .header {
  background-color: #2d4a5a;
  border-bottom-color: #8a6d3b;
  color: #e0e0e0;
}

body.dark-mode .content-box { background-color: #2d5016; }

body.dark-mode #contact,
body.dark-mode #projects,
body.dark-mode #experiences,
body.dark-mode #writing,
body.dark-mode .section {
  background-color: #2a2a2a;
  border-color: rgba(170, 211, 223, 0.2);
  color: #e0e0e0;
}

body.dark-mode footer { background-color: #4a3020; color: #e0e0e0; }
body.dark-mode .nav-buttons a { background-color: #5a7a8a; color: #e0e0e0; }
body.dark-mode .nav-buttons a.active { background-color: #8a5a5a; color: #e0e0e0; }
body.dark-mode .project-links a { background-color: #5a7a8a; color: #e0e0e0; }
body.dark-mode .project-links a:hover { background-color: #8a5a5a; color: #e0e0e0; }
body.dark-mode .lightbox { background: rgba(0, 0, 0, 0.95); }

.dark-mode-toggle {
  position: static;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--maya-yellow);
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 200ms ease;
  z-index: 1000;
  font-family: 'Delius', cursive;
}

.dark-mode-toggle:hover { transform: rotate(20deg) scale(1.1); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
.dark-mode-toggle:focus {
  outline: 3px dashed rgba(170, 211, 223, 0.45);
  outline-offset: 4px;
}

body.dark-mode .dark-mode-toggle {
  background-color: var(--maya-blue);
  color: #1a1a1a;
}

.font-size-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--maya-yellow);
  padding: 10px;
  font-family: 'Delius', cursive;
  border-radius: 50%;
  border: none;
}

.font-size-control label { color: var(--maya-dark); font-weight: 600; }

.font-size-control select {
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid var(--maya-dark);
  font-family: 'SUSE Mono', monospace;
  background-color: var(--maya-white);
  color: var(--maya-dark);
  cursor: pointer;
  transition: background-color 200ms ease, transform 100ms ease;
}

.font-size-control select:hover { background-color: var(--maya-blue); transform: translateY(-1px); }

body.dark-mode .font-size-control { background-color: #333; border-bottom-color: #666; }
body.dark-mode .font-size-control label { color: #e0e0e0; }
body.dark-mode .font-size-control select { color: #e0e0e0; background-color: #222; border-color: #666; }

.controls-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-5px) rotate(-1deg); }
  40% { transform: translateY(3px) rotate(1.5deg); }
  60% { transform: translateY(-4px) rotate(0.5deg); }
  80% { transform: translateY(2px) rotate(-0.5deg); }
}

@keyframes paperLift {
  0% { transform: translateY(8px) rotate(-1.2deg) skewX(-0.4deg); }
  25% { transform: translateY(-6px) rotate(1.4deg) skewX(0.3deg); }
  50% { transform: translateY(3px) rotate(-0.6deg) skewX(-0.2deg); }
  75% { transform: translateY(-4px) rotate(0.8deg) skewX(0.1deg); }
  100% { transform: translateY(0) rotate(0deg) skewX(0deg); }
}

@keyframes headerFloat {
  0% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-8px) rotate(-1deg); }
  60% { transform: translateY(5px) rotate(1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes buttonPress {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.95); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .about-card { transform: none; }
}

@media (min-width: 721px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-bio { padding-left: 0; }
}

@media (max-width: 768px) {
  :root {
    --h1-size: 2rem;
    --h2-size: 1.5rem;
    --h3-size: 1.1rem;
  }

  .dark-mode-toggle { width: 45px; height: 45px; font-size: 20px; bottom: 15px; right: 15px; }
  .lightbox-content { max-width: 95%; }
  .favorites-grid { grid-template-columns: repeat(auto-fill, 150px); }
  .controls-container { bottom: 15px; right: 15px; gap: 8px; }
}

@keyframes floatIcon {
  0%, 100% { 
    transform: translateY(0) rotate(0deg); 
  }
  25% { 
    transform: translateY(var(--float-distance)) rotate(var(--float-rotation)); 
  }
  50% { 
    transform: translateY(calc(var(--float-distance) * -1)) rotate(calc(var(--float-rotation) * -1)); 
  }
  75% { 
    transform: translateY(calc(var(--float-distance) * 0.5)) rotate(var(--float-rotation)); 
  }
}