/* ==========================================================================
   LUMENA WEB STUDIO — shared shell
   --------------------------------------------------------------------------
   Everything that must look identical on every page lives here: tokens, type
   scale, navigation, footer, buttons, consent banner, motion primitives.
   Page-specific layout stays inline in its own page.

   Rule of thumb: if it appears on more than one page, it belongs in this file.
   That is what keeps the four pages from drifting apart.
   ========================================================================== */

@import url('../fonts/fonts.css');

/* ------------------------------------------------------------------ tokens */
:root {
  /* surface */
  --bg:            #070707;
  --bg-lift:       #0c0c0c;

  /* ink — contrast-checked against --bg
     #ffffff 19.6:1 | #8f8f8f 5.8:1 (AA body) | #5c5c5c 2.9:1 (decorative only) */
  --fg:            #ffffff;
  --fg-mut:        #8f8f8f;
  --fg-dim:        #5c5c5c;

  /* lines */
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.24);

  /* type */
  --font-display: 'Lumena Display', 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Lumena Text', 'Manrope', system-ui, sans-serif;
  --font-serif:   'Lumena Serif', 'Instrument Serif', Georgia, serif;

  /* motion */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:   cubic-bezier(0.65, 0, 0.35, 1);
  --dur:       0.6s;

  /* rhythm */
  --gut:       5vw;
  --maxw:      1500px;
}

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

html { -webkit-text-size-adjust: 100%; }

/* Lenis hooks */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;   /* never fake a weight the file doesn't have */
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { border: none; background: none; font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- skip link */
.skip-link {
  position: absolute; top: -100px; left: var(--gut); z-index: 10000;
  background: var(--fg); color: var(--bg);
  padding: 0.9rem 1.6rem; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  transition: top 0.3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* -------------------------------------------------------------- typography */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

.h1, .h2, .h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; }

.h1 { font-size: clamp(3rem, 8vw, 7rem);     line-height: 0.95; }
.h2 { font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: 1.02; }
.h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }

.display {
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.82;
}

.eyebrow {
  display: block; margin-bottom: 1.5rem;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.25em;
  color: var(--fg-mut);
}

.italic-serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

.lede { color: var(--fg-mut); font-size: clamp(1rem, 1.15vw, 1.2rem); max-width: 52ch; }
.h1 + .lede, .h2 + .lede, .h3 + .lede { margin-top: 1.5rem; }

/* ------------------------------------------------------------------- grain */
.noise-overlay {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.015; mix-blend-mode: difference;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------- nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2.2rem var(--gut);
  color: #fff; mix-blend-mode: difference;
  transition: transform 0.45s var(--ease-out), padding 0.45s var(--ease-out);
}
.nav.is-compact { padding: 1.3rem var(--gut); }
.nav.is-hidden  { transform: translateY(-105%); }

.nav-group { display: flex; gap: clamp(1.4rem, 2.5vw, 2.6rem); }

.nav-link {
  position: relative; display: inline-block; overflow: hidden;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-mut); transition: color 0.3s;
}
.nav-link:hover { color: var(--fg); }
.nav-link .nav-link-inner { display: inline-block; transition: transform 0.45s var(--ease-out); }
.nav-link::after {
  content: attr(data-text); position: absolute; left: 0; top: 100%;
  color: var(--fg); transition: transform 0.45s var(--ease-out);
}
.nav-link:hover .nav-link-inner,
.nav-link:hover::after { transform: translateY(-100%); }

.logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -0.02em;
  color: var(--fg); white-space: nowrap;
}
.logo span { color: var(--fg-mut); }

/* language toggle — a quiet mono pill, never a shout */
.lang-toggle {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--fg-mut); border: 1px solid var(--border); border-radius: 100px;
  padding: 0.45rem 0.8rem; transition: color 0.3s, border-color 0.3s;
}
.lang-toggle:hover { color: var(--fg); border-color: var(--border-strong); }
.nav-panel-meta .lang-toggle { border: none; padding: 0.75rem 0.5rem; margin: -0.75rem -0.5rem; font-size: 0.75rem; }

/* ------------------------------------------------------------ mobile menu */
.nav-toggle {
  display: none; position: relative; z-index: 2;
  width: 44px; height: 44px; margin-right: -10px;
  align-items: center; justify-content: flex-end;
}
.nav-toggle-bars { display: block; width: 26px; height: 10px; position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ''; position: absolute; left: 0; width: 100%; height: 1.5px;
  background: var(--fg); transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after  { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 4px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { top: 4px; transform: rotate(-45deg); }

.nav-panel {
  position: fixed; inset: 0; z-index: 99;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gut);
  background: var(--bg);
  transform: translateY(-100%);
  transition: transform 0.65s var(--ease-io);
  visibility: hidden;
}
.nav-panel.is-open { transform: translateY(0); visibility: visible; }

.nav-panel-link {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 4.5rem); line-height: 1.15;
  letter-spacing: -0.03em; color: var(--fg);
  padding: 0.15em 0; border-bottom: 1px solid var(--border);
}
.nav-panel-link:last-of-type { border-bottom: 0; }

.nav-panel-meta {
  margin-top: 3rem; display: flex; gap: 2rem; flex-wrap: wrap;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-mut);
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 1.05rem 2.2rem; border: 1px solid var(--border-strong); border-radius: 100px;
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg); background: transparent;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s;
}
.btn:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn .btn-arrow { transition: transform 0.4s var(--ease-out); }
.btn:hover .btn-arrow { transform: translate(3px, -3px); }

/* ------------------------------------------------------------------- footer (Minimal) */
.footer { 
  padding: 2.5rem 0; 
  border-top: 1px solid var(--border); 
  background: var(--bg); 
  position: relative; 
  z-index: 5; 
}
.footer-base { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap; 
  gap: 1.5rem; 
  font-size: 0.75rem; 
  text-transform: uppercase; 
  letter-spacing: 0.1em; 
  color: var(--fg-mut); 
}
.footer-left, .footer-right { 
  display: flex; 
  gap: 2rem; 
  flex-wrap: wrap; 
}
.footer-base a { transition: color 0.3s; }
.footer-base a:hover { color: var(--fg); }

/* ----------------------------------------------------------- consent notice
   Drawn with the page's own furniture instead of a generic cookie box: the
   hairline corner brackets of the home page's architectural frame stand in
   for a border, the mono element tag is the hero's <h2> tag, and the headline
   speaks in the site's two voices (display + italic serif).
   Informational only: the site sets no cookies, so there is one button and
   nothing to refuse (see cookie-policy.html §2). */
.consent {
  --tick: rgba(255, 255, 255, 0.5);
  --tick-len: 0.85rem;
  position: fixed; left: var(--gut); bottom: 2.25rem; z-index: 200;
  width: min(26rem, calc(100vw - 2 * var(--gut)));
  padding: 1.35rem 1.5rem 1.4rem;
  background: rgba(10, 10, 10, 0.88);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  /* visibility, not just opacity: while hidden the link and button must not
     be reachable with Tab. */
  transform: translateY(1.75rem); opacity: 0; visibility: hidden;
  transition: transform 0.8s var(--ease-out), opacity 0.6s var(--ease-out), visibility 0s linear 0.8s;
}
.consent.is-shown { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }

/* the four corner brackets, one pseudo-element: eight 1px gradient strokes */
.consent::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--tick), var(--tick)) left top / var(--tick-len) 1px,
    linear-gradient(var(--tick), var(--tick)) left top / 1px var(--tick-len),
    linear-gradient(var(--tick), var(--tick)) right top / var(--tick-len) 1px,
    linear-gradient(var(--tick), var(--tick)) right top / 1px var(--tick-len),
    linear-gradient(var(--tick), var(--tick)) left bottom / var(--tick-len) 1px,
    linear-gradient(var(--tick), var(--tick)) left bottom / 1px var(--tick-len),
    linear-gradient(var(--tick), var(--tick)) right bottom / var(--tick-len) 1px,
    linear-gradient(var(--tick), var(--tick)) right bottom / 1px var(--tick-len);
  background-repeat: no-repeat;
  /* closes in on the card like a selection locking onto an element */
  opacity: 0; transform: scale(1.06);
  transition: transform 0.9s var(--ease-out), opacity 0.5s linear;
}
.consent.is-shown::before { opacity: 1; transform: none; transition-delay: 0.1s; }

.consent-tag {
  display: block; margin-bottom: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem; letter-spacing: 0.04em; color: var(--fg-dim);
}

.consent-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 1.28rem + 0.6vw, 1.8rem); line-height: 1.06; letter-spacing: -0.03em;
}
.consent-title .italic-serif { font-size: 1.12em; letter-spacing: -0.01em; }
/* each line rises out of its own mask, the way the hero headline does */
.consent-line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.consent-line > span { display: inline-block; transform: translateY(112%); transition: transform 0.9s var(--ease-out); }
.consent.is-shown .consent-line > span { transform: none; }
.consent.is-shown .consent-line:nth-child(1) > span { transition-delay: 0.16s; }
.consent.is-shown .consent-line:nth-child(2) > span { transition-delay: 0.25s; }

.consent-body { margin-top: 0.85rem; font-size: 0.86rem; line-height: 1.55; color: var(--fg-mut); text-wrap: pretty; }

.consent-actions { margin-top: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.consent-more {
  font-size: 0.8rem; color: var(--fg-mut);
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px;
  transition: color 0.3s, text-decoration-color 0.3s;
}
.consent-more:hover { color: var(--fg); text-decoration-color: var(--fg); }
.consent-accept {
  min-height: 2.75rem; padding: 0 1.6rem;
  border: 1px solid var(--fg); border-radius: 100px;
  background: var(--fg); color: var(--bg);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.consent-accept:hover { background: transparent; color: var(--fg); }

/* --------------------------------------------------------- motion primitives */
html.js .reveal { opacity: 0; transform: translateY(28px); }
/* Locked-in end state (see initReveals): once the entrance tween completes,
   its inline styles are cleared and this class holds the final values, so
   nothing inline can override later :hover transforms. Specificity beats
   the base rule above by one class. */
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal-line > span { display: block; transform: translateY(105%); }
html.js .reveal-line { overflow: hidden; display: block; }

/* --------------------------------------------------------------- legal */
.legal { padding: 22vh 0 12vh; }
.legal-head { padding-bottom: 3.5rem; margin-bottom: 3.5rem; border-bottom: 1px solid var(--border); }
.legal-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: 0.95; letter-spacing: -0.04em; }
.legal-updated { margin-top: 1.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--fg-dim); }

.legal-body { max-width: 68ch; }
.legal-body h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.7rem); letter-spacing: -0.02em; line-height: 1.2;
  margin: 3.5rem 0 1.1rem; padding-top: 3.5rem; border-top: 1px solid var(--border);
}
.legal-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body p, .legal-body li { color: var(--fg-mut); font-size: 1rem; line-height: 1.75; }
.legal-body p + p { margin-top: 1.1rem; }
.legal-body ul { margin: 1.2rem 0; display: flex; flex-direction: column; gap: 0.7rem; }
.legal-body li { display: flex; gap: 0.85rem; }
.legal-body li::before { content: '—'; color: var(--fg-dim); flex-shrink: 0; }
.legal-body strong { color: var(--fg); font-weight: 600; }
.legal-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.legal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em;
  background: var(--bg-lift); border: 1px solid var(--border); padding: 0.12em 0.45em; color: var(--fg);
}

/* ------------------------------------------------------------- breakpoints */
@media (max-width: 1024px) {
  .nav-group.is-primary,
  .nav-group.is-secondary { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 768px) {
  .footer-base { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .footer-left, .footer-right { flex-direction: column; gap: 0.8rem; width: 100%; }
}

@media (max-width: 640px) {
  :root { --gut: 6vw; }
  /* phone: a bottom sheet edge to edge, brackets pulled in from the glass */
  .consent { left: 0; right: 0; bottom: 0; width: auto; padding: 1.4rem var(--gut) calc(1.3rem + env(safe-area-inset-bottom)); }
  .consent::before { inset: 0.55rem; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .reveal-line > span { transform: none; }
}