/* ================================================================
   MILLARAY CAMPOS · PORTFOLIO STYLES
   Editorial · Warm · Animated · Dark+Light themes
================================================================ */

/* ===== TOKENS ===== */
:root {
  /* Dark (default) */
  --bg: #0d0c0a;
  --bg-alt: #141210;
  --fg: #ece7db;
  --fg-dim: #a8a096;
  --fg-muted: #6e6860;
  --line: rgba(236, 231, 219, 0.08);
  --line-strong: rgba(236, 231, 219, 0.18);
  --card: #141210;
  --veil-top: rgba(13,12,10,0.3);
  --veil-mid: rgba(13,12,10,0.75);
  --veil-bot: rgba(13,12,10,0.95);
  --blob-opacity: 0.55;
  --noise-opacity: 0.06;
  --noise-blend: overlay;

  /* Gradient accents (used for decorative blobs + backgrounds) */
  --grad-peach: #e8b589;
  --grad-rose: #c89db0;
  --grad-sage: #8fa695;
  --grad-amber: #d4a56a;
  --grad-lilac: #a498c4;

  /* Accent color for TEXT (needs contrast — darker in light mode) */
  --accent: #e8b589;
  --accent-rose: #c89db0;
  --accent-lilac: #a498c4;

  /* Gradient used for text fills (adapts per theme for readability) */
  --grad-text: linear-gradient(135deg, #e8b589, #c89db0 50%, #a498c4);

  /* Type */
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --container: 1280px;
  --container-narrow: 760px;
  --pad: clamp(1.5rem, 4vw, 3rem);
  --radius: 14px;
}

[data-theme="light"] {
  --bg: #f5efe4;
  --bg-alt: #ebe3d3;
  --fg: #2b2620;
  --fg-dim: #6a635a;
  --fg-muted: #8f877c;
  --line: rgba(43, 38, 32, 0.10);
  --line-strong: rgba(43, 38, 32, 0.22);
  --card: #ebe3d3;
  --veil-top: rgba(245,239,228,0.2);
  --veil-mid: rgba(245,239,228,0.6);
  --veil-bot: rgba(245,239,228,0.85);
  --blob-opacity: 0.7;
  --noise-opacity: 0.08;
  --noise-blend: multiply;

  /* Accents darker for light-bg contrast */
  --accent: #b87339;
  --accent-rose: #9a5273;
  --accent-lilac: #6e5c9a;
  --grad-text: linear-gradient(135deg, #b87339, #9a5273 50%, #6e5c9a);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  max-width: 100vw;
  cursor: none;
  transition: background 0.5s ease, color 0.5s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; border: 0; background: 0; color: inherit; cursor: none; }
::selection { background: var(--grad-peach); color: #0d0c0a; }

/* ===== BACKGROUND LAYERS ===== */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: var(--blob-opacity); will-change: transform;
  transition: opacity 0.5s ease;
}
.blob-1 {
  width: 55vw; height: 55vw; top: -15%; left: -10%;
  background: radial-gradient(circle, var(--grad-peach), transparent 70%);
  animation: drift1 28s ease-in-out infinite;
}
.blob-2 {
  width: 45vw; height: 45vw; top: 40%; right: -10%;
  background: radial-gradient(circle, var(--grad-rose), transparent 70%);
  animation: drift2 34s ease-in-out infinite;
}
.blob-3 {
  width: 40vw; height: 40vw; bottom: -15%; left: 20%;
  background: radial-gradient(circle, var(--grad-sage), transparent 70%);
  animation: drift3 40s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(10vw,8vh) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-8vw,-6vh) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(5vw,-10vh) scale(1.2); } }

.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--noise-opacity); mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 0.5s ease;
}

.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, var(--veil-top) 0%, var(--veil-mid) 50%, var(--veil-bot) 100%);
  transition: background 0.5s ease;
}

/* ===== CUSTOM CURSOR ===== */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .3s cubic-bezier(.4,0,.2,1), height .3s cubic-bezier(.4,0,.2,1),
              background .3s, border-color .3s;
}
.cursor-dot { width: 6px; height: 6px; background: var(--fg); border-radius: 50%; }
.cursor-ring {
  width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 50%;
  transition: transform .15s ease-out, width .3s, height .3s, background .3s, border-color .3s;
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  background: rgba(232,181,137,0.12); border-color: var(--grad-peach);
}
@media (max-width: 900px), (pointer: coarse) {
  body { cursor: auto; }
  a, button, input, textarea, select { cursor: pointer !important; }
  textarea, input[type="text"], input[type="email"] { cursor: text !important; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== LAYOUT ===== */
.container {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--pad); position: relative; z-index: 2;
}
.container-narrow {
  max-width: var(--container-narrow); margin: 0 auto;
  padding: 0 var(--pad); position: relative; z-index: 2;
}
main { position: relative; z-index: 2; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-bottom: 1px solid var(--line);
  transition: transform .4s cubic-bezier(.4,0,.2,1), background 0.5s ease;
}
.nav.hidden { transform: translateY(-100%); }
.nav__brand {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 400;
  letter-spacing: -0.01em; white-space: nowrap;
}
.nav__brand em { font-style: italic; font-weight: 300; color: var(--fg-dim); }
.nav__back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--fg-dim); transition: color .2s, gap .3s;
}
.nav__back:hover { color: var(--fg); gap: 0.85rem; }

.nav__menu {
  display: flex; gap: 2rem;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em;
}
.nav__menu a {
  color: var(--fg-dim); transition: color .2s; position: relative;
}
.nav__menu a::after {
  content: ''; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: var(--fg);
  transition: width .3s cubic-bezier(.4,0,.2,1);
}
.nav__menu a:hover { color: var(--fg); }
.nav__menu a:hover::after { width: 100%; }

.nav__right {
  display: flex; align-items: center; gap: 1.25rem;
}

.nav__status {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--fg-dim);
}
.nav__status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #7ec38a;
  box-shadow: 0 0 0 0 rgba(126,195,138,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(126,195,138,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(126,195,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(126,195,138,0); }
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-alt) 40%, transparent);
  transition: border-color .3s, transform .4s, background .3s, color .3s;
  color: var(--fg);
}
.theme-toggle:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transform: rotate(20deg);
}
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 4px;
  padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color .3s;
}
.hamburger:hover { border-color: var(--accent); }
.hamburger span {
  display: block; width: 100%; height: 1.5px; background: var(--fg);
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 380px;
  background: var(--bg-alt);
  backdrop-filter: blur(30px);
  border-left: 1px solid var(--line);
  z-index: 99;
  padding: 6rem 2.5rem 2.5rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), visibility 0s linear .5s;
  display: flex; flex-direction: column; gap: 2rem;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0s;
}
.mobile-menu a {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 300;
  color: var(--fg); letter-spacing: -0.02em;
  transition: color .2s, padding-left .3s;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:hover { color: var(--accent); padding-left: 0.5rem; }
.mobile-menu a em { font-style: italic; color: var(--fg-dim); }

.mobile-menu__foot {
  margin-top: auto;
  font-family: var(--mono); font-size: 0.75rem; color: var(--fg-muted);
  display: flex; justify-content: space-between;
}

@media (max-width: 900px) {
  .nav__menu { display: none; }
  .nav__status { display: none; }
  .hamburger { display: flex; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 100px;
  color: var(--fg); transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--grad-peach), var(--grad-rose));
  opacity: 0; transition: opacity .4s; z-index: -1;
}
.btn:hover {
  border-color: transparent; color: #0d0c0a; transform: translateY(-2px);
}
.btn:hover::before { opacity: 1; }
.btn .arrow { transition: transform .3s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  padding: 8rem var(--pad) 4rem;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.hero__meta {
  display: flex; gap: 2rem; margin-bottom: 3rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--fg-muted); letter-spacing: 0.05em; text-transform: uppercase;
  flex-wrap: wrap;
}
.hero__meta span { display: flex; align-items: center; gap: 0.5rem; }
.hero__meta .divider { width: 24px; height: 1px; background: var(--line-strong); }

.hero__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.8rem, 8.5vw, 8rem);
  line-height: 0.95; letter-spacing: -0.035em;
  margin-bottom: 2rem;
  font-variation-settings: "opsz" 144;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: revealUp 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero__title em {
  font-style: italic; font-weight: 300;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes revealUp { to { transform: translateY(0); } }

.hero__sub {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 300; line-height: 1.5; max-width: 620px;
  color: var(--fg-dim); margin-bottom: 3.5rem;
  opacity: 0; animation: fadeIn 1s 0.8s forwards;
}
.hero__sub em { font-style: italic; color: var(--fg); }
@keyframes fadeIn { to { opacity: 1; } }

.hero__actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  opacity: 0; animation: fadeIn 1s 1s forwards;
}

.hero__scroll {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-muted); letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3rem;
  opacity: 0; animation: fadeIn 1s 1.2s forwards;
}
.hero__scroll .arrow {
  display: inline-block; animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ===== MARQUEE ===== */
.marquee {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden; white-space: nowrap;
  background: var(--bg-alt);
  position: relative; z-index: 2;
  transition: background 0.5s ease;
}
.marquee__inner {
  display: inline-flex; gap: 3rem;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2rem, 5vw, 4rem); line-height: 1;
  animation: scroll 30s linear infinite;
  padding-right: 3rem;
}
.marquee__inner span {
  display: inline-flex; align-items: center; gap: 3rem;
}
.marquee__inner .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--grad-peach), var(--grad-rose));
  display: inline-block; flex-shrink: 0;
}
@keyframes scroll { to { transform: translateX(-50%); } }

/* ===== SECTIONS ===== */
.section { padding: 8rem var(--pad); position: relative; }
.section--tinted {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-alt) 60%, transparent), transparent);
}
.section__label {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section__label::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.section__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05; letter-spacing: -0.025em;
  margin-bottom: 1.5rem; max-width: 900px;
}
.section__title em { font-style: italic; color: var(--fg-dim); }
.section__intro {
  font-size: 1.05rem; color: var(--fg-dim); max-width: 560px;
  margin-bottom: 5rem; line-height: 1.6;
}
.section__body p {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  line-height: 1.65; color: var(--fg-dim);
  margin-bottom: 1.5rem; max-width: 720px;
}
.section__body p em { font-style: italic; color: var(--fg); }
.section__body strong { color: var(--fg); font-weight: 500; }

/* ===== PROJECTS ===== */
.projects {
  display: flex; flex-direction: column; gap: 6rem;
}
.project {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: 3rem; align-items: center;
}
.project:nth-child(even) .project__media { order: 2; }
.project:nth-child(even) .project__info { order: 1; }
.project__media {
  aspect-ratio: 4 / 3;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden; position: relative;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.project__media::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(232,181,137,0.12), rgba(200,157,176,0.12) 50%, rgba(164,152,196,0.12));
  z-index: 1; opacity: 0; transition: opacity .5s;
}
.project:hover .project__media { transform: scale(1.02); }
.project:hover .project__media::before { opacity: 1; }
.project__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.project:hover .project__media img { transform: scale(1.05); }

.project__num {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-muted); letter-spacing: 0.08em; margin-bottom: 1rem;
}
.project__category {
  display: inline-block;
  font-family: var(--mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: 100px;
  margin-bottom: 1.5rem;
}
.project__title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.project__title em { font-style: italic; font-weight: 300; }
.project__desc {
  color: var(--fg-dim); margin-bottom: 1.75rem;
  line-height: 1.6; max-width: 460px;
}
.project__tags {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.75rem;
}
.project__tag {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--fg-muted);
  padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 4px;
}
.project__link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 500;
  padding-bottom: 0.25rem; border-bottom: 1px solid var(--line-strong);
  transition: gap .3s, border-color .3s;
}
.project__link:hover {
  gap: 1rem; border-color: var(--accent); color: var(--accent);
}
@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; gap: 1.5rem; }
  .project:nth-child(even) .project__media { order: 0; }
  .project:nth-child(even) .project__info { order: 1; }
}

/* ===== ABOUT ===== */
.about {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5rem;
  align-items: start;
}
.about__text p {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 300;
  line-height: 1.55; color: var(--fg-dim); margin-bottom: 1.5rem;
}
.about__text p em { font-style: italic; color: var(--fg); }
.about__list {
  list-style: none; display: flex; flex-direction: column; gap: 0;
}
.about__item {
  padding: 2rem 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 40px 1fr;
  gap: 1.5rem; align-items: start;
}
.about__item:last-child { border-bottom: 1px solid var(--line); }
.about__item-num {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--fg-muted); padding-top: 0.3rem;
}
.about__item-title {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 400;
  margin-bottom: 0.5rem; letter-spacing: -0.01em;
}
.about__item-desc {
  color: var(--fg-dim); font-size: 0.95rem; line-height: 1.6;
}
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 3rem; }
}

/* ===== GRAPHIC DESIGN GALLERY ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}
.gallery__item {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  position: relative;
  aspect-ratio: 1;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s;
  display: block;
  color: inherit;
  text-decoration: none;
}
.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.gallery__item:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.gallery__item:hover img { transform: scale(1.06); }
.gallery__item::after {
  content: attr(data-label);
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1rem 1rem 1rem;
  background: linear-gradient(to top, rgba(13,12,10,0.9), transparent);
  color: #ece7db;
  font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s, transform .4s;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.gallery__item:hover::after { opacity: 1; transform: translateY(0); }
.gallery__item::before {
  content: '↗';
  position: absolute; top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,12,10,0.8);
  color: #ece7db;
  border-radius: 50%;
  font-size: 0.95rem;
  opacity: 0; transform: translate(8px, -8px);
  transition: opacity .4s, transform .4s;
  z-index: 2;
  backdrop-filter: blur(8px);
}
.gallery__item:hover::before { opacity: 1; transform: translate(0, 0); }

.gallery__item--lg { grid-column: span 6; aspect-ratio: 4/3; }
.gallery__item--md { grid-column: span 4; aspect-ratio: 1; }
.gallery__item--sm { grid-column: span 3; aspect-ratio: 1; }
.gallery__item--tall { grid-column: span 4; aspect-ratio: 3/4; }
.gallery__item--wide { grid-column: span 8; aspect-ratio: 16/9; }

@media (max-width: 820px) {
  .gallery { grid-template-columns: repeat(6, 1fr); }
  .gallery__item--lg,
  .gallery__item--wide { grid-column: span 6; aspect-ratio: 4/3; }
  .gallery__item--md,
  .gallery__item--tall { grid-column: span 3; aspect-ratio: 1; }
  .gallery__item--sm { grid-column: span 3; aspect-ratio: 1; }
}

/* ===== EXPERIENCE ===== */
.exp-list { list-style: none; margin-top: 3rem; }
.exp-item {
  display: grid; grid-template-columns: 90px 1fr auto;
  gap: 2rem; padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  transition: padding .4s cubic-bezier(.4,0,.2,1);
}
.exp-item:last-child { border-bottom: 1px solid var(--line); }
.exp-item:hover { padding-left: 1rem; }
.exp-year { font-family: var(--mono); font-size: 0.82rem; color: var(--fg-muted); }
.exp-role {
  font-family: var(--serif); font-size: 1.3rem;
  font-weight: 400; letter-spacing: -0.01em;
}
.exp-role em { font-style: italic; color: var(--fg-dim); font-weight: 300; }
.exp-place { font-size: 0.85rem; color: var(--fg-dim); text-align: right; }
@media (max-width: 640px) {
  .exp-item { grid-template-columns: 1fr; gap: 0.3rem; padding: 1.25rem 0; }
  .exp-place { text-align: left; }

  /* Hero meta: más compacto en mobile */
  .hero__meta {
    font-size: 0.7rem;
    gap: 0.4rem 1rem;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
  }
  .hero__meta .divider { display: none; }
  .hero__meta span { white-space: nowrap; }

  /* Hero actions: botones lado a lado en mobile */
  .hero__actions {
    gap: 0.75rem;
    width: 100%;
  }
  .hero__actions .btn {
    padding: 0.75rem 0.9rem;
    font-size: 0.72rem;
    flex: 1;
    justify-content: center;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
}

/* ===== CONTACT FORM ===== */
.contact-section {
  padding: 8rem var(--pad) 4rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  margin-top: 3rem;
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
}

.contact-intro h2 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.contact-intro h2 em {
  font-style: italic;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.contact-intro p {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 300;
  color: var(--fg-dim); line-height: 1.55; margin-bottom: 2rem;
  max-width: 440px;
}
.contact-intro p em { font-style: italic; color: var(--fg); }

.contact-direct {
  padding-top: 2rem; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1rem;
}
.contact-direct__item {
  display: flex; flex-direction: column; gap: 0.3rem;
}
.contact-direct__label {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-muted);
}
.contact-direct__value {
  font-family: var(--serif); font-size: 1.25rem;
  font-weight: 400; color: var(--fg);
  transition: color .2s;
}
a.contact-direct__value:hover { color: var(--accent); }

.contact-socials {
  display: flex; gap: 0.75rem; margin-top: 0.5rem;
}
.social-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--fg-dim);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.social-icon:hover {
  color: var(--accent); border-color: var(--accent);
  transform: translateY(-3px);
}
.social-icon svg { width: 18px; height: 18px; }

/* Form */
.contact-form {
  display: flex; flex-direction: column; gap: 1.5rem;
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.form-field {
  display: flex; flex-direction: column; gap: 0.5rem; position: relative;
}
.form-field label {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-muted);
}
.form-field input,
.form-field textarea,
.form-field select {
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong);
  padding: 0.75rem 0;
  font-family: var(--serif); font-size: 1.1rem;
  color: var(--fg); outline: 0;
  transition: border-color .3s;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-bottom-color: var(--accent);
}
.form-field textarea { min-height: 120px; font-family: var(--sans); font-size: 1rem; }
.form-field select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23a8a096' stroke-width='1.5'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center;
  padding-right: 2rem;
}
.form-field select option { background: var(--bg-alt); color: var(--fg); }

.form-submit {
  margin-top: 1rem; align-self: flex-start;
  padding: 1rem 2rem;
  font-family: var(--mono); font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 100px;
  background: transparent; color: var(--fg);
  position: relative; overflow: hidden; z-index: 1;
  transition: color .3s, border-color .3s, transform .3s;
}
.form-submit::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--grad-peach), var(--grad-rose));
  opacity: 0; transition: opacity .4s; z-index: -1;
}
.form-submit:hover {
  color: #0d0c0a; border-color: transparent; transform: translateY(-2px);
}
.form-submit:hover::before { opacity: 1; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-message {
  font-family: var(--mono); font-size: 0.8rem;
  padding: 0.75rem 1rem; border-radius: 8px;
  display: none;
}
.form-message.success {
  display: block;
  background: rgba(126,195,138,0.15); color: #7ec38a;
  border: 1px solid rgba(126,195,138,0.3);
}
.form-message.error {
  display: block;
  background: rgba(232,100,100,0.15); color: #e86464;
  border: 1px solid rgba(232,100,100,0.3);
}

/* ===== FOOTER ===== */
footer {
  padding: 3rem var(--pad);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--fg-muted);
  position: relative; z-index: 2;
}
.footer__links { display: flex; gap: 1.5rem; }
footer a:hover { color: var(--fg); }

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }

/* ================================================================
   PROJECT PAGE STYLES
================================================================ */
.project-hero { padding: 9rem var(--pad) 5rem; }
.project-hero__breadcrumb {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--fg-muted); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 2rem;
  display: flex; gap: 0.75rem; align-items: center;
}
.project-hero__breadcrumb .sep { color: var(--line-strong); }
.project-hero__breadcrumb .current { color: var(--accent); }

.project-hero__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.4rem, 6.5vw, 5.5rem);
  line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 1.5rem; max-width: 1100px;
  font-variation-settings: "opsz" 144;
}
.project-hero__title em {
  font-style: italic; font-weight: 300;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.project-hero__sub {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 300; line-height: 1.5; max-width: 720px;
  color: var(--fg-dim); margin-bottom: 4rem;
}
.project-hero__sub em { font-style: italic; color: var(--fg); }

.meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta-grid__item { display: flex; flex-direction: column; gap: 0.4rem; }
.meta-grid__label {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--fg-muted); letter-spacing: 0.12em; text-transform: uppercase;
}
.meta-grid__value {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 400; line-height: 1.3;
}
.meta-grid__value em { font-style: italic; color: var(--fg-dim); font-weight: 300; }
@media (max-width: 820px) {
  .meta-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

.project-cover {
  margin-top: 4rem;
  border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  background: var(--card);
  position: relative;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Full-bleed visual (Naomi-style) */
.fullbleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  aspect-ratio: 21/9;
  background: linear-gradient(135deg, rgba(232,181,137,0.2), rgba(200,157,176,0.2), rgba(164,152,196,0.2)), var(--card);
  position: relative;
  overflow: hidden;
  margin-top: 4rem; margin-bottom: 4rem;
}
.fullbleed img { width: 100%; height: 100%; object-fit: cover; }
.fullbleed__caption {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.75rem;
  color: #ece7db;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(13,12,10,0.7);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem; border-radius: 100px;
}

/* Context cards */
.context-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 3rem;
}
.context-card {
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .4s, border-color .3s;
}
.context-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.context-card__label {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.75rem;
}
.context-card__title {
  font-family: var(--serif); font-size: 1.4rem;
  font-weight: 400; margin-bottom: 0.75rem; letter-spacing: -0.01em;
}
.context-card__desc { font-size: 0.92rem; color: var(--fg-dim); line-height: 1.55; }
@media (max-width: 820px) {
  .context-grid { grid-template-columns: 1fr; }
}

/* Process */
.process {
  display: flex; flex-direction: column; gap: 0; margin-top: 3rem;
}
.process__step {
  display: grid; grid-template-columns: 60px 1fr;
  gap: 2rem; padding: 3rem 0;
  border-top: 1px solid var(--line);
}
.process__step:last-child { border-bottom: 1px solid var(--line); }
.process__num {
  font-family: var(--mono); font-size: 0.9rem;
  color: var(--fg-muted); padding-top: 0.5rem;
}
.process__title {
  font-family: var(--serif); font-size: 1.6rem;
  font-weight: 400; letter-spacing: -0.015em; margin-bottom: 1rem;
}
.process__title em { font-style: italic; color: var(--fg-dim); }
.process__desc {
  color: var(--fg-dim); font-size: 1rem;
  line-height: 1.65; max-width: 640px;
}

/* Insights */
.insights {
  margin-top: 3rem; display: flex; flex-direction: column; gap: 0;
}
.insight {
  padding: 1.75rem 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 24px 1fr;
  gap: 1.5rem; align-items: baseline;
}
.insight:last-child { border-bottom: 1px solid var(--line); }
.insight__mark {
  font-family: var(--serif); font-size: 1.2rem;
  color: var(--accent); line-height: 1;
}
.insight__text {
  font-family: var(--serif); font-weight: 300;
  font-size: 1.15rem; line-height: 1.55; color: var(--fg);
}
.insight__text strong {
  font-weight: 500; color: var(--accent); font-style: italic;
}

/* Showcase images */
.showcase-img {
  margin: 4rem 0;
  border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  background: var(--card);
}
.showcase-img img { width: 100%; height: 100%; object-fit: cover; }
.showcase-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin: 4rem 0;
}
.showcase-grid > div {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  background: var(--card);
}
.showcase-grid img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .showcase-grid { grid-template-columns: 1fr; } }

/* Metrics */
.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; margin-top: 3rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric {
  padding: 2.5rem 1.5rem;
  border-right: 1px solid var(--line);
  text-align: left;
}
.metric:last-child { border-right: 0; }
.metric__value {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1; letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric__label { font-size: 0.85rem; color: var(--fg-dim); line-height: 1.4; }
@media (max-width: 820px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
}

/* Reflection */
.reflection {
  padding: 8rem var(--pad);
  text-align: center;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-alt) 50%, transparent), transparent);
}
.reflection__mark {
  font-family: var(--serif); font-size: 3rem;
  color: var(--accent); line-height: 1;
  margin-bottom: 1.5rem; font-style: italic;
}
.reflection__text {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.35; letter-spacing: -0.015em;
  max-width: 820px; margin: 0 auto;
}
.reflection__text em { font-style: italic; color: var(--fg-dim); }

/* Next project */
.next-project {
  padding: 6rem var(--pad);
  border-top: 1px solid var(--line);
}
.next-project__label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--fg-muted);
  margin-bottom: 1.5rem;
}
.next-project__link {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
  transition: padding .4s cubic-bezier(.4,0,.2,1);
}
.next-project__link:hover { padding-left: 1rem; }
.next-project__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1; letter-spacing: -0.025em; flex: 1;
}
.next-project__title em { font-style: italic; color: var(--fg-dim); }
.next-project__arrow {
  font-size: 2rem; color: var(--fg-dim);
  transition: transform .4s;
}
.next-project__link:hover .next-project__arrow {
  transform: translateX(8px); color: var(--accent);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 404 PAGE ===== */
.notfound {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center;
  padding: 6rem var(--pad);
  gap: 2rem;
}
.notfound__num {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(6rem, 20vw, 14rem);
  line-height: 1; letter-spacing: -0.05em;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.notfound__title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  max-width: 600px;
}
.notfound__title em { font-style: italic; color: var(--fg-dim); }
