/* ===========================================================
   ESSENCIA — Premium cinematic design system
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

:root {
  /* Color — Essencia brand: charcoal neutrals + deep teal-blue */
  --black:      #000000;
  --bg:         #111111;
  --surface:    #1a1a1c;
  --surface-2:  #242427;
  --line:       rgba(255,255,255,0.08);
  --line-strong:rgba(255,255,255,0.16);

  --white:      #ffffff;
  --text:       #f3f4f5;
  --muted:      #a0a1a4;
  --muted-2:    #6b6c70;

  /* Brand deep blue (#004368) + a readable derivative for accents on dark.
     --accent-h drives every accent so a Tweak can re-hue the whole site. */
  --brand-blue: #004368;
  --accent-h:   232;
  --accent:     oklch(0.74 0.12 var(--accent-h));
  --accent-bright: oklch(0.82 0.14 var(--accent-h));
  --accent-deep:#004368;
  --accent-glow: oklch(0.64 0.15 var(--accent-h) / 0.5);
  --accent-soft: oklch(0.64 0.15 var(--accent-h) / 0.12);
  --glow-boost: 1;

  /* Type */
  --font: 'Poppins', system-ui, sans-serif;

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 18px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  cursor: default;
}

::selection { background: var(--accent); color: #00131a; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Image slots are interactive ONLY inside the visual editor (.artex-edit).
   On the public site, clicking a mockup must NOT open a file browser. */
image-slot { pointer-events: none; }
.artex-edit image-slot { pointer-events: auto; }

/* Film grain overlay across whole site */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

h1, h2, h3 { font-weight: 500; line-height: 1.04; letter-spacing: -0.02em; }

.display {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
}
.h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.03em; }

.lede { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); font-weight: 300; max-width: 60ch; }

.accent-text { color: var(--accent); }
.thin { font-weight: 200; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 1.05em 2.2em;
  position: relative;
  display: inline-flex; align-items: center; gap: 0.7em;
  padding: var(--pad);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.5s var(--ease);
  overflow: hidden;
  isolation: isolate;
}
.btn svg { width: 1.05em; height: 1.05em; transition: transform 0.5s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--white);
  color: #0a0b0d;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 50px -12px rgba(255,255,255,0.35), 0 0 40px -8px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--white); transform: translateY(-3px); box-shadow: 0 0 40px -10px var(--accent-glow); }

/* ---------- Reveal animations (gated on .js so content is visible if JS fails) ---------- */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: 0.08s; }
[data-delay="2"] { transition-delay: 0.16s; }
[data-delay="3"] { transition-delay: 0.24s; }
[data-delay="4"] { transition-delay: 0.32s; }
[data-delay="5"] { transition-delay: 0.40s; }

/* Word-by-word reveal */
.words .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.18em; margin-bottom: -0.18em; }
.words .word > span { display: inline-block; }
.js .words .word > span {
  transform: translateY(130%);
  transition: transform 0.9s var(--ease-out);
}
.words.in .word > span { transform: none; }
.words .word { margin-right: 0.26em; }

/* Failsafe: once revealed, guarantee the final visible state even if a
   transition is stranded by a paused timeline (forces value, no animation). */
.reveal-done { opacity: 1 !important; transform: none !important; transition: none !important; }
.words.reveal-done .word > span { transform: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .words .word > span { opacity: 1 !important; transform: none !important; transition: none !important; }
}
