/* ---------------------------------------------------------
   Design tokens
--------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Tier 1 — literal tokens */
  --ink-950: #071a13;
  --ink-900: #12241f;
  --ink-800: #17392c;
  --ink-700: #21493a;
  --gold-100: #f6d9ad;
  --gold-200: #eccb95;
  --gold-300: #d9b374;
  --cream-50: #fbf5ea;

  /* Tier 2 — semantic tokens */
  --color-bg: var(--ink-900);
  --color-bg-elevated: var(--ink-800);
  --color-accent: var(--gold-100);
  --color-accent-soft: var(--gold-200);
  --color-text: var(--gold-100);
  --color-text-muted: color-mix(in oklab, var(--gold-100) 62%, var(--ink-900) 38%);
  --color-border: color-mix(in oklab, var(--gold-100) 16%, transparent);
  --color-border-strong: color-mix(in oklab, var(--gold-100) 45%, transparent);

  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wordmark-width: clamp(260px, 70vw, 620px);

  /* Spacing scale (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --ease-premium: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-reveal: cubic-bezier(0.42, 0, 0.58, 1);
  --duration-fly: 900ms;
  --duration-reveal: 2200ms;

  /* reduced-motion escape hatch, see §Motion */
  --spin-motion: spin 0.9s linear infinite;
}

@property --animation-reduced {
  syntax: '*';
  inherits: false;
  initial-value: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: var(--animation-reduced) !important;
  }
  :root {
    --duration-fly: 1ms;
    --duration-reveal: 1ms;
  }
}

/* ---------------------------------------------------------
   Reset & base
--------------------------------------------------------- */
:where(*, *::before, *::after) {
  box-sizing: border-box;
  margin: 0;
}

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

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Guaranteed zero-footprint hidden sprite: an author `svg { display: block }`
   rule always outranks the UA's `[hidden] { display: none }` regardless of
   specificity (author beats user-agent), so `hidden` alone can't be trusted
   here — this was silently reserving a 300×150 default-SVG-sized gap at the
   top of every page. */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   Preloader
--------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  transition: opacity 420ms var(--ease-premium);
}

.preloader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.glyph {
  display: block;
  color: var(--color-accent);
  overflow: visible;
}

.glyph--loader {
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(2.5rem, 9vw, 4rem);
  height: clamp(2.5rem, 9vw, 4rem);
  transform: translate(-50%, -50%);
  transform-origin: center;
  animation: var(--spin-motion);
  will-change: transform;
}

.glyph--inline {
  width: 1em;
  height: 1em;
  opacity: 0;
  transition: opacity 200ms var(--ease-premium);
}

.glyph--inline.is-visible {
  opacity: 1;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: clamp(2rem, 5vw, 4rem);
  padding-inline: max(var(--space-6), env(safe-area-inset-left)) max(var(--space-6), env(safe-area-inset-right));
  isolation: isolate;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(90vw, 680px);
}

/* Reveal choreography: a slow color-in reveal once body.is-ready is set.
   Nothing moves or fades — only a plain `color` transition, so layout
   stays put. The wordmark itself is a plain static image, no effects.
   The status line reveals itself separately, via a type-on effect. */
.tagline {
  color: color-mix(in oklab, var(--color-bg) 85%, var(--color-accent-soft) 15%);
  transition: color var(--duration-reveal) var(--ease-reveal);
}

body.is-ready .tagline {
  color: var(--color-accent-soft);
  transition-delay: 220ms;
}

/* ---------------------------------------------------------
   Wordmark — plain static logo, no effects
--------------------------------------------------------- */
.wordmark {
  width: var(--wordmark-width);
  height: auto;
}

/* ---------------------------------------------------------
   Tagline
--------------------------------------------------------- */
.tagline {
  position: relative;
  margin-top: clamp(1rem, 3vw, 1.75rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: var(--wordmark-width);
  font-weight: 400;
  /* letter-spacing: 0.18em */
  font-size: clamp(0.58rem, 0.48rem + 0.4vw, 0.82rem);
}

.tagline__word {
  white-space: nowrap;
}

.glyph--inline {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.2em;
  height: 1.2em;
}

/* ---------------------------------------------------------
   Status — a quiet, typographic statement. No badge, no chrome:
   the line types itself on, then a brief caret blink and it settles.
--------------------------------------------------------- */
.status {
  margin-top: clamp(1.5rem, 4.5vw, 2.5rem);
  font-size: clamp(0.7rem, 0.62rem + 0.28vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.status__type {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 0;
  border-inline-end: 1px solid transparent;
}

body.is-ready .status__type {
  /* Both animations run from the moment `.is-ready` lands, as one
     declaration, so neither ever fully replaces the other's held state:
     status-type opens the width and holds it; status-caret blinks a few
     times starting right as typing finishes, then holds fully transparent. */
  animation:
    status-type 800ms steps(14, end) 500ms forwards,
    status-caret 1600ms steps(1, end) 1300ms forwards;
}

@keyframes status-type {
  from { width: 0; border-inline-end-color: currentColor; }
  to { width: var(--type-width, 100%); border-inline-end-color: currentColor; }
}

@keyframes status-caret {
  0% { border-inline-end-color: currentColor; }
  12.5% { border-inline-end-color: transparent; }
  25% { border-inline-end-color: currentColor; }
  37.5% { border-inline-end-color: transparent; }
  50% { border-inline-end-color: currentColor; }
  62.5% { border-inline-end-color: transparent; }
  75% { border-inline-end-color: currentColor; }
  87.5%, 100% { border-inline-end-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .status__type {
    width: auto;
    border-inline-end: none;
  }
}

/* ---------------------------------------------------------
   Contact footer
--------------------------------------------------------- */
.contact {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  padding-block-end: max(clamp(1.5rem, 4vw, 2.5rem), env(safe-area-inset-bottom));
  padding-inline: max(var(--space-6), env(safe-area-inset-left)) max(var(--space-6), env(safe-area-inset-right));
  border-top: 1px solid var(--color-border);
  font-size: clamp(0.82rem, 0.76rem + 0.25vw, 0.95rem);
  color: var(--color-text-muted);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.35em 0.5em;
  min-block-size: 2.75rem;
  border-radius: 6px;
  transition: color 220ms var(--ease-premium);
}

.contact__link:hover,
.contact__link:focus-visible {
  color: var(--color-accent);
}

.contact__icon {
  inline-size: 1.05em;
  block-size: 1.05em;
  color: var(--color-accent-soft);
  flex-shrink: 0;
}

.contact__divider {
  inline-size: 1px;
  block-size: 1.1em;
  background: var(--color-border-strong);
}

@media (max-width: 30rem) {
  .contact {
    flex-direction: column;
    gap: var(--space-3);
  }
  .contact__divider {
    display: none;
  }
}
