/* =========================================================
   KESTON — Coming Soon (stealth teaser)
   Flat institutional system. Ink · Paper · Keystone Blue.
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* ---------- Tokens ---------- */
:root {
  --ink:      #16181D;
  --ink-line: #2A2D34;
  --paper:    #FAF9F5;
  --blue:     #2741E7;
  --blue-ink: #1B31C4;
  --steel:    #8A8D93;

  --font-display: "Archivo", system-ui, sans-serif;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue); color: var(--paper); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* accessible heading, hidden visually (keeps the animated composition intact) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  background: var(--blue); color: var(--paper);
  padding: 10px 16px; border-radius: 2px; font-size: 14px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* =========================================================
   WORDMARK  (calibrated to the Brand Kit lockup)
   ========================================================= */
.wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--paper);
  line-height: 1;
  white-space: nowrap;
  transition: color .5s var(--ease);
}
.wm-text { display: inline; }
.wm-wedge {
  display: inline-block;
  height: 0.74em;
  width: auto;
  vertical-align: baseline;
  margin: 0 0 -0.015em -0.07em;
  fill: var(--blue);
}
.wordmark--sm { font-size: 18px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(22, 24, 29, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--ink-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav .nav-cta {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color .5s var(--ease);
}
.site-nav .nav-cta::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.site-nav .nav-cta:hover::after { transform: scaleX(1); }

/* =========================================================
   SCROLL STAGE
   ========================================================= */
.stage-scroll {
  position: relative;
  height: 420svh;            /* scroll length that drives the scrub */
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
/* animated background shader — behind everything, subtle, non-interactive */
.bg-shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity .6s var(--ease);
}
/* The shader itself clears the contact area (coverage uniform); no whole-canvas dim needed. */
@media (prefers-reduced-motion: reduce) {
  .bg-shader { opacity: 0.5; }
}

.stage::before {           /* faint vertical structural line */
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: linear-gradient(var(--ink-line), transparent 65%);
  opacity: .45;
  z-index: 1;
  transition: opacity .5s var(--ease);
}

/* Scroll-and-swap roll — each text block rolls up while an identical copy rolls
   up into its place (ported from the framer-motion ScrollAndSwapText effect).
   A hidden "ghost" copy sizes the clip box; JS drives the two moving copies. */
.swap { position: relative; display: block; overflow: hidden; }
.swap-ghost { visibility: hidden; }
.swap-out, .swap-in {
  position: absolute;
  left: 0; right: 0; top: 0;
  will-change: transform;
}

/* Layers stack in the exact centre; JS drives opacity + transform */
.layer {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1100px);
  text-align: center;
  z-index: 2;
  will-change: transform, opacity;
}

/* 1 · Logo (zooms in) */
.layer--logo .wordmark--reveal {
  font-size: clamp(2.4rem, 9vw, 5.2rem);
  color: var(--paper);
}

/* 2 · Tagline (letter by letter) */
.tagline {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: clamp(0.72rem, 1.9vw, 1.08rem);
  color: var(--steel);
  padding-left: 0.32em;
  transition: color .5s var(--ease);
}
.tagline .ch {
  display: inline-block;
  will-change: opacity, transform;
}
.tagline .ch--space { width: 0.32em; }

/* 3 · Coming Soon */
.layer--soon { display: flex; flex-direction: column; align-items: center; }
.soon-rule {
  display: block;
  width: 56px; height: 2px;
  background: var(--blue);
  margin-bottom: 26px;
}
.soon {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;          /* contain glyph ink (e.g. the "g" descender) inside the swap clip box */
  font-size: clamp(1.6rem, 4.4vw, 2.8rem);
  color: var(--paper);
}

/* 4 · Contact (underneath Coming Soon) */
.contact-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 14px;
  transition: color .5s var(--ease);
}
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3.8vw, 2.1rem);
  letter-spacing: -0.01em;
  color: var(--paper);
  position: relative;
  padding-bottom: 6px;
  transition: color .5s var(--ease);
}
.contact-email::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.contact-email:hover { color: var(--blue); }
.contact-email:hover::after { transform: scaleX(1); }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.scroll-hint-text {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--steel);
}
.scroll-hint-line {
  width: 1px; height: 44px;
  background: linear-gradient(var(--steel), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-hint-line::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--blue);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

/* =========================================================
   CONTACT SECTION — subtle header change (matches the first version)
   Keeps the dark translucent-blur header; shifts the hairline to keystone
   blue and lights the Contact link as a quiet new-section cue.
   ========================================================= */
.is-contact .site-header { border-bottom-color: var(--ink-line); }
.is-contact .site-nav .nav-cta { color: var(--paper); }
.is-contact .site-nav .nav-cta::after { transform: scaleX(1); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--ink-line);
  background: var(--ink);
  padding-block: 34px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-legal {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
  color: var(--steel);
}
.footer-legal a { transition: color .25s var(--ease); }
.footer-legal a:hover { color: var(--paper); }

/* =========================================================
   ENTRANCE (logo, on load)
   ========================================================= */
.js .layer--logo .wordmark--reveal {
  opacity: 0;
  animation: logoIn 1s var(--ease) .15s forwards;
}
@keyframes logoIn { to { opacity: 1; } }

/* =========================================================
   NO-JS fallback — static stacked lockup, everything visible
   ========================================================= */
.no-js .stage-scroll { height: auto; }
.no-js .stage { position: static; height: auto; min-height: 100svh; padding-block: 20vh 12vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6vh; }
.no-js .layer {
  position: static;
  transform: none;
  width: 100%;
  opacity: 1;
}
.no-js .scroll-hint { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-legal { flex-direction: column; gap: 8px; }
}

/* =========================================================
   REDUCED MOTION — no scrub, static stacked lockup
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-scroll { height: auto !important; }
  .stage { position: static !important; height: auto; min-height: auto; padding-block: 20vh 12vh;
           display: flex; flex-direction: column; align-items: center; gap: 6vh; }
  .layer {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    width: 100%;
  }
  .scroll-hint { display: none; }
  .js .layer--logo .wordmark--reveal { animation: none; opacity: 1; }
  .layer--logo .wordmark--reveal { font-size: clamp(2.4rem, 9vw, 5rem); }
}
