/* Airtime Strategies — placeholder site
   Brand specs are locked. Do not deviate.
   - Slate Ink   #1F2937   primary
   - Bone        #F2EFE9   canvas
   - Studio Bk   #0E0E0C   dark neutral (unused on this page; available)
   - Instrument Sans 500 (wordmark area), 400 (body)
*/

:root {
  --slate-ink: #1F2937;
  --bone: #F2EFE9;
  --studio-black: #0E0E0C;

  /* Semantic — flip these two to invert the page treatment. */
  --bg: var(--slate-ink);
  --fg: var(--bone);

  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wordmark-w: clamp(280px, 78vw, 1180px);   /* desktop fills the canvas; mobile floors at 280px */
  --page-pad: 32px;           /* footer breathing room */

  /* Intro timing — single source of truth, in ms */
  --intro-bracket-delay: 200ms;
  --intro-bracket-dur: 520ms;

  --intro-beam-delay: 500ms;
  --intro-beam-dur: 2400ms;

  --intro-text-delay: 1000ms;
  --intro-text-dur: 780ms;

  --intro-tagline-delay: 1500ms;
  --intro-tagline-dur: 600ms;

  --intro-footer-delay: 2400ms;
  --intro-footer-dur: 600ms;

  --ease-out: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-beam: cubic-bezier(0.45, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* keep the scan beam from causing horizontal scroll on edge cases */
}

/* ───────── Stage ───────── */

.stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 64px 24px calc(48px + var(--page-pad));
  position: relative;
  z-index: 2; /* keep content above the grain overlay */
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 100%;
}

/* ───────── Wordmark ───────── */

.wordmark {
  color: var(--fg);
  display: block;
  width: var(--wordmark-w);
  height: auto;
  max-width: 100%;
}

.wordmark-text {
  /* Filter is applied to the text fill after the mask cut, so the scan-line
     gap stays sharp even when the body of the letters is blurred during intro. */
  transform-box: fill-box;
  transform-origin: center;
}

.wordmark-brackets {
  transform-box: fill-box;
  transform-origin: center center;
}

.tagline {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: color-mix(in srgb, var(--fg) 65%, transparent);
  text-align: center;
  will-change: transform, opacity;
}

/* ───────── Footer ───────── */

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--page-pad);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.footer small {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.005em;
  color: color-mix(in srgb, var(--fg) 45%, transparent);
}

/* ───────── Responsive ───────── */

@media (max-width: 560px) {
  :root {
    --wordmark-w: clamp(240px, 88vw, 520px);
    --page-pad: 24px;
  }
  .stage { padding: 48px 20px calc(40px + var(--page-pad)); }
  .footer small { font-size: 12px; }
}

/* ───────── Film grain ─────────
   Inline SVG fractal noise as a fixed overlay. Tuned for the dark canvas:
   light-tinted noise with screen blend reads as gentle film/CRT grain. */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.949  0 0 0 0 0.937  0 0 0 0 0.914  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* Brackets pulse subtly during a scan pass — a camera-blink acknowledgement. */
.wordmark-brackets.is-scanning {
  animation: at-brackets-pulse 1.6s var(--ease-out);
}

@keyframes at-brackets-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.82; }
}

/* ───────── Intro choreography ─────────
   Default rendered state = final visible. Animations only run when
   <html data-intro="play"> is set by the inline head script. */

[data-intro="play"] .wordmark-brackets {
  animation: at-brackets-in var(--intro-bracket-dur) var(--ease-out)
             var(--intro-bracket-delay) both;
}

[data-intro="play"] .wordmark-text {
  animation: at-focus-in var(--intro-text-dur) var(--ease-out)
             var(--intro-text-delay) both;
}

[data-intro="play"] .tagline {
  animation: at-rise-in var(--intro-tagline-dur) var(--ease-out)
             var(--intro-tagline-delay) both;
}

[data-intro="play"] .footer {
  animation: at-fade-in var(--intro-footer-dur) var(--ease-out)
             var(--intro-footer-delay) both;
}

/* ───────── Keyframes ───────── */

@keyframes at-brackets-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes at-focus-in {
  /* Camera autofocus feel: starts blurred + transparent, resolves crisp.
     Blur amount scales loosely with wordmark size. */
  from { opacity: 0; filter: blur(14px); }
  to   { opacity: 1; filter: blur(0); }
}

@keyframes at-rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes at-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ───────── Reduced motion ─────────
   Belt and suspenders — the head script already sets data-intro="done", but
   if the OS preference flips after load, everything stays calm. */

@media (prefers-reduced-motion: reduce) {
  [data-intro="play"] .wordmark-brackets,
  [data-intro="play"] .wordmark-text,
  [data-intro="play"] .tagline,
  [data-intro="play"] .footer {
    animation: none !important;
  }
  .wordmark-brackets { transform: none !important; }
  .grain { display: none; }
}

/* ───────── A11y ───────── */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.visually-hidden:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  margin: 0;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 4px;
  z-index: 100;
  clip: auto;
}
