/* ============================================================
   AGENCIA ROSA — Design System tokens & primitives
   Portfolio · María Lourdes Riesgo
   ============================================================ */

:root {
  /* Colors — Primary (Terracota) */
  --color-primary:        #d4693f;
  --color-primary-light:  #e08f6f;
  --color-primary-dark:   #b0502a;

  /* Colors — Secondary / Accent / Gold */
  --color-secondary:      #d8dca6;
  --color-accent:         #cdb8dc;
  --color-gold:           #c9a265;

  /* Surfaces — warm whites & grays */
  --color-surface:        #f7f2ea;   /* warm cream */
  --color-white:          #ffffff;
  --color-bg-warm:        #f1ede5;   /* soft warm gray for alt sections */
  --color-divider:        #e8e2d6;

  /* Ink (text scale) */
  --color-ink:            #1c1917;
  --color-ink-muted:      #6b6560;
  --color-ink-subtle:     #a09890;

  /* Type families */
  --font-display: "Poppins", "DM Sans", system-ui, sans-serif;
  --font-sans:    "DM Sans", "Inter", system-ui, sans-serif;

  /* Type scale */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 17px;
  --fs-lg:   20px;
  --fs-xl:   24px;
  --fs-2xl:  32px;
  --fs-3xl:  44px;
  --fs-4xl:  58px;
  --fs-5xl:  76px;
  --fs-6xl:  96px;

  /* Spacing scale (base 4px) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-6:  24px;
  --s-8:  32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-32: 128px;

  /* Layout */
  --container:    1280px;
  --container-sm: 880px;
  --radius:       16px;
  --radius-lg:    32px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* ---------- baseline ---------- */
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-white);
  font-weight: 400;
}

/* ---------- type utilities ---------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.display em { font-style: italic; color: var(--color-primary-dark); }

.sans { font-family: var(--font-sans); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.muted   { color: var(--color-ink-muted); }
.subtle  { color: var(--color-ink-subtle); }

/* ---------- container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-8);
}
@media (max-width: 720px) { .container { padding: 0 var(--s-6); } }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-4) var(--s-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-8);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.nav-logo-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
  position: relative;
}
.nav-logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--color-surface);
}
.nav-links {
  display: flex;
  gap: var(--s-8);
  align-items: center;
}
.nav-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-ink-muted);
  position: relative;
  transition: color .2s var(--ease);
  padding: var(--s-2) 0;
}
.nav-link:hover { color: var(--color-ink); }
.nav-link.is-active { color: var(--color-ink); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--color-primary);
  border-radius: 2px;
}
.nav-cta {
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 10px 18px;
  border: 1.5px solid var(--color-ink);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { background: var(--color-ink); color: var(--color-white); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-cta { padding: 8px 14px; font-size: var(--fs-xs); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { border: 1.5px solid var(--color-ink); color: var(--color-ink); }
.btn-outline:hover { background: var(--color-ink); color: var(--color-white); }
.btn-ghost { color: var(--color-ink); }
.btn-ghost:hover { color: var(--color-primary-dark); }

/* ---------- section scaffolding ---------- */
.section {
  padding: var(--s-32) 0;
  position: relative;
}
.section--tight  { padding: var(--s-20) 0; }
.section--bg-warm { background: var(--color-bg-warm); }
.section--bg-cream { background: var(--color-surface); }

@media (max-width: 720px) {
  .section { padding: var(--s-20) 0; }
  .section--tight { padding: var(--s-16) 0; }
}

/* ---------- back to projects ---------- */
.back-to-projects {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(28,25,23,.6);
  text-decoration: none;
  margin-bottom: var(--s-6);
  transition: color .2s var(--ease);
  width: fit-content;
}
.back-to-projects:hover { color: var(--color-ink); text-decoration: underline; text-underline-offset: 3px; }
.back-to-projects__arrow { display: inline-block; font-size: 1.05em; line-height: 1; transition: transform .2s var(--ease); }
.back-to-projects:hover .back-to-projects__arrow { transform: translateX(-4px); }
.back-to-projects--light { color: rgba(255,255,255,.72); }
.back-to-projects--light:hover { color: #fff; }

/* ---------- footer ---------- */
.footer {
  background: var(--color-ink);
  color: var(--color-surface);
  padding: var(--s-20) 0 var(--s-12);
}
.footer a { color: var(--color-surface); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-16);
  align-items: start;
}
.footer-title { font-family: var(--font-display); font-size: var(--fs-3xl); line-height: 1.05; margin: 0 0 var(--s-6); letter-spacing: -0.02em; color: #fff; white-space: nowrap; }
.footer-title em { font-style: italic; color: var(--color-primary-light); }
.footer-col h4 { font-size: var(--fs-xs); letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; color: var(--color-ink-subtle); margin: 0 0 var(--s-4); }
.footer-col a { display: block; padding: 6px 0; font-size: var(--fs-sm); color: rgba(247,242,234,.82); transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--color-primary-light); }
.footer-bottom {
  border-top: 1px solid rgba(247,242,234,.12);
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: var(--fs-xs);
  color: rgba(247,242,234,.6);
  letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-8); }
  .footer-bottom { flex-direction: column; }
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}
/* ============================
   HAMBURGUESA + MENÚ MÓVIL
   ============================ */

/* Ocultar menú móvil por defecto */
header.nav .mobile-menu {
  display: none;
}

/* Ocultar hamburguesa en desktop */
header.nav .nav-toggle {
  display: none;
}

/* Móvil */
@media (max-width: 760px) {

  /* Ocultar menú desktop y CTA */
  header.nav .nav-links,
  header.nav .nav-cta {
    display: none !important;
  }

  /* Mostrar hamburguesa */
  header.nav .nav-toggle {
    display: block !important;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: inherit;
    z-index: 9999;
  }

  /* Menú móvil */
  header.nav .mobile-menu {
    display: none;
    flex-direction: column;
    background: white;
    padding: 20px;
    gap: 16px;
    border-top: 1px solid #eee;
  }

  header.nav .mobile-menu a {
    font-size: 20px;
    text-decoration: none;
    color: #333;
  }

  /* Cuando se abre */
  header.nav .mobile-menu.is-open {
    display: flex !important;
  }
}
/* Botón hamburguesa base */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 9999;
}

/* Las tres líneas */
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #000;
  transition: all 0.3s ease;
}

/* Posiciones iniciales */
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { bottom: 0; }

/* Estado abierto → X */
.nav-toggle.is-open span:nth-child(1) {
  transform: rotate(45deg);
  top: 11px;
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg);
  bottom: 11px;
}

/* Mostrar solo en móvil */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
}
