/* TOQUIA Cinematic — Base: reset, variables, typography, utilities */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  /* Palette — approved 9-nov-2026. Green is an accent, beige carries the warmth. */
  --tq-beige:         #F2EBDD;   /* beige cálido */
  --tq-sand:          #DCCDB5;   /* beige arena */
  --tq-emerald:       #145C46;   /* verde esmeralda */
  --tq-charcoal:      #111412;   /* negro carbón */
  --tq-gold:          #C5A46D;   /* dorado suave */
  --tq-cream:         #FAF7F0;   /* blanco crema */
  /* Approved contrast derivatives */
  --tq-emerald-glow:  #4FAE8A;   /* text/accents on dark surfaces only (6.85:1 on charcoal) */
  --tq-gold-ink:      #7A5C2A;   /* gold text/details on light surfaces (5.2:1 on beige) */
  /* Shades used only as scene backdrops (from the approved preview) */
  --tq-cinema:        #0b0d0c;   /* Wallet: cinematic black */
  --tq-emerald-deep:  #0f4535;   /* Conversion: deep emerald */

  /* Legacy names kept as aliases so older rules keep working */
  --tq-deep-green:     var(--tq-charcoal);
  --tq-warm-white:     var(--tq-cream);
  --tq-cinema-black:   var(--tq-charcoal);

  /* Semantic, per-theme (dark defaults; [data-theme] overrides below) */
  --scene-bg:   var(--tq-charcoal);
  --ink:        var(--tq-beige);
  --ink-rgb:    242,235,221;
  --ink-muted:  #A9A59D;
  --accent:     var(--tq-emerald-glow);
  --accent-rgb: 79,174,138;
  --detail:     var(--tq-gold);
  --surface:    rgba(242,235,221,.04);
  --line:       rgba(242,235,221,.10);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.25), 0 24px 48px -28px rgba(0,0,0,.8);
  --tq-bg:      var(--tq-charcoal);
  --tq-text:    var(--ink);
  --tq-accent:  var(--tq-emerald);
  --tq-accent-bright: var(--accent);

  /* Typography scale — fluid with clamp */
  --fs-hero:   clamp(2.5rem, 5vw + 1rem, 5rem);
  --fs-h1:     clamp(2rem, 3.5vw + 0.5rem, 3.75rem);
  --fs-h2:     clamp(1.5rem, 2.5vw + 0.5rem, 2.75rem);
  --fs-h3:     clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
  --fs-lead:   clamp(1rem, 1.2vw + 0.5rem, 1.25rem);
  --fs-body:   clamp(0.9375rem, 0.5vw + 0.75rem, 1.0625rem);
  --fs-small:  clamp(0.8125rem, 0.3vw + 0.7rem, 0.875rem);
  --fs-eyebrow: clamp(0.6875rem, 0.3vw + 0.6rem, 0.8125rem);

  /* Spacing */
  --space-xs:  clamp(0.5rem, 1vw, 0.75rem);
  --space-sm:  clamp(0.75rem, 1.5vw, 1.25rem);
  --space-md:  clamp(1.25rem, 2.5vw, 2rem);
  --space-lg:  clamp(2rem, 4vw, 3.5rem);
  --space-xl:  clamp(3rem, 6vw, 5rem);
  --space-2xl: clamp(4rem, 8vw, 7rem);

  /* Layout */
  --content-max:   1200px;
  --content-narrow: 720px;
  --gutter:        clamp(1rem, 3vw, 2rem);

  /* Timing */
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:  0.2s;
  --duration-med:   0.4s;
  --duration-slow:  0.8s;

  /* Z-layers */
  --z-scene:    1;
  --z-nav:      100;
  --z-overlay:  200;
  --z-toki-cameo: 50;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto; /* ScrollTrigger manages scroll; no native smooth */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  color: var(--tq-text);
  background: var(--tq-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.15; text-wrap: balance; }

/* ── Focus ─────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Typography ────────────────────────────────────────────────── */
.hero-title   { font-size: var(--fs-hero); letter-spacing: -0.02em; }
h1, .h1       { font-size: var(--fs-h1); letter-spacing: -0.02em; }
h2, .h2       { font-size: var(--fs-h2); letter-spacing: -0.01em; }
h3, .h3       { font-size: var(--fs-h3); }
.lead         { font-size: var(--fs-lead); font-weight: 400; line-height: 1.55; }
.small        { font-size: var(--fs-small); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--detail);
}

em { font-style: normal; color: var(--accent); }
.gold { color: var(--tq-gold); }
.muted { color: var(--ink-muted); }

/* ── Layout utilities ──────────────────────────────────────────── */
.content {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.content-narrow {
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.875em 1.75em;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: 99px;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background var(--duration-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--tq-emerald);
  color: var(--tq-cream);
  box-shadow: 0 6px 22px -8px rgba(20,92,70,.6);
}
.btn-primary:hover { background: #1a6e55; box-shadow: 0 10px 30px -8px rgba(20,92,70,.7); }

/* Scene CTA adapts to the surface: beige on dark scenes, charcoal on light ones. */
.btn-scene { background: var(--tq-beige); color: var(--tq-charcoal); box-shadow: 0 10px 30px -14px rgba(0,0,0,.6); }
.btn-scene:hover { background: var(--tq-cream); }
[data-theme="beige"] .btn-scene, [data-theme="sand"] .btn-scene, [data-theme="cream"] .btn-scene {
  background: var(--tq-charcoal); color: var(--tq-beige); box-shadow: 0 12px 28px -16px rgba(17,20,18,.7);
}

.btn-outline {
  border: 1.5px solid rgba(var(--ink-rgb),.28);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-gold { background: var(--tq-gold); color: var(--tq-charcoal); }

/* ── Scene container ───────────────────────────────────────────── */
.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: var(--z-scene);
}

/* Scene themes. Every scene declares data-theme; text and accents follow the surface. */
[data-theme] { color: var(--ink); }
[data-theme="dark"]    { --scene-bg: var(--tq-charcoal); }
[data-theme="cinema"]  { --scene-bg: var(--tq-cinema); }
[data-theme="beige"], [data-theme="sand"], [data-theme="cream"] {
  --scene-bg: var(--tq-beige);
  --ink: var(--tq-charcoal);
  --ink-rgb: 17,20,18;
  --ink-muted: #5A5C58;
  --accent: var(--tq-emerald);
  --accent-rgb: 20,92,70;
  --detail: var(--tq-gold-ink);
  --surface: rgba(250,247,240,.62);
  --line: rgba(17,20,18,.10);
  --shadow-soft: 0 1px 2px rgba(17,20,18,.06), 0 22px 44px -26px rgba(60,44,20,.45);
}
[data-theme="sand"]  { --scene-bg: var(--tq-sand); --ink-muted: #4A4B47; --surface: rgba(250,247,240,.5); }
[data-theme="cream"] { --scene-bg: var(--tq-cream); --surface: #fff; }
[data-theme="emerald"] {
  --scene-bg: var(--tq-emerald-deep);
  --ink: var(--tq-beige);
  --ink-muted: rgba(242,235,221,.82);
  --accent: var(--tq-beige);
  --accent-rgb: 242,235,221;
  --detail: var(--tq-gold);
  --line: rgba(242,235,221,.16);
}

.scene-inner {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: max(var(--space-xl), calc(64px + var(--space-md))) var(--gutter) var(--space-xl);
}

/* ── Screen reader only ────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Selection ─────────────────────────────────────────────────── */
::selection { background: var(--tq-emerald); color: var(--tq-cream); }
[data-theme="emerald"] em { color: var(--tq-gold); }
/* On sand, gold-ink is below 4.5:1 for small text: eyebrows use emerald there (5.07:1). */
[data-theme="sand"] .eyebrow { color: var(--tq-emerald); }
