/* =========================================================================
   STEADY STATE · funnel brand (system B, Dr. Andrew Koutnik's own funnel)
   Dark cinematic canvas from his site and reels, his cyan (#0CBFF0), his
   Oswald headings, Manrope for reading. Signature: the 70–180 range band,
   a CGM trace that settles flat between two hairlines.
   Text sizes carry +2px across the board (--bump), per Diego's brief.
   Fonts are self-hosted in assets/fonts (no external requests). Pages only
   link this file; never add a Google Fonts <link>.
   ========================================================================= */

@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --bump: 2px;

  --bg: #06080a;
  --bg-2: #0b1013;
  --surface: #0e1418;
  --surface-2: #131b20;
  --surface-3: #18222a;
  --ink: #eef3f6;
  --muted: #9aa8b0;
  --faint: #7d8a92;
  --hair: rgba(238, 243, 246, 0.10);
  --hair-2: rgba(238, 243, 246, 0.16);

  --accent: #0cbff0;          /* Andrew's cyan, straight off andrewkoutnik.com */
  --accent-2: #6bdcff;
  --accent-deep: #0791bb;
  --accent-ink: #03141b;
  --accent-soft: rgba(12, 191, 240, 0.12);
  --accent-glow: rgba(12, 191, 240, 0.35);

  /* CGM data colours (Dexcom/Libre convention). Data visuals only, never decoration. */
  --in: #3ddc97;
  --high: #ffc44d;
  --low: #ff5d6c;

  --display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1120px;
  --narrow: 760px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(72px, 11vh, 128px);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------ base */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: calc(17px + var(--bump)); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* One continuous page canvas (no section seams): faint cyan bloom up top, a
   second whisper lower down, fine grain to stop banding. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% -12%, rgba(12, 191, 240, 0.13), transparent 62%),
    radial-gradient(60% 40% at 100% 100%, rgba(12, 191, 240, 0.05), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.page { flex: 1 1 auto; min-width: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.section { padding-block: var(--section-y); position: relative; }
.center { text-align: center; }

/* ------------------------------------------------------------ type scale */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-family: var(--display); font-weight: 500; font-size: calc(13px + var(--bump));
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before, .eyebrow::after { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.55; }
.eyebrow--plain::before, .eyebrow--plain::after { display: none; }

.h1 {
  margin: 0 auto; font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: calc(clamp(2.1rem, 4.6vw, 3.6rem) + var(--bump)); line-height: 1.04; letter-spacing: 0.005em;
  text-wrap: balance;
}
.h2 {
  margin: 0 auto; font-family: var(--display); font-weight: 600; text-transform: uppercase;
  font-size: calc(clamp(1.75rem, 3.6vw, 2.75rem) + var(--bump)); line-height: 1.06; letter-spacing: 0.01em;
  text-wrap: balance;
}
.h3 {
  margin: 0; font-family: var(--display); font-weight: 500; text-transform: uppercase;
  font-size: calc(clamp(1.15rem, 1.7vw, 1.4rem) + var(--bump)); line-height: 1.15; letter-spacing: 0.02em;
}
.lead { margin: 22px auto 0; max-width: 58ch; color: var(--muted); font-size: calc(1.08rem + var(--bump)); line-height: 1.6; text-wrap: pretty; }
.hl { color: var(--accent); }
.small { font-size: calc(0.86rem + var(--bump)); color: var(--muted); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 16px 34px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-weight: 800; font-size: calc(1rem + var(--bump)); letter-spacing: 0.01em;
  cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: var(--accent-ink); box-shadow: 0 14px 40px -14px var(--accent-glow); }
.btn--primary::after { content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%); background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent); transition: transform 0.7s var(--ease); }
.btn--primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 22px 54px -16px var(--accent-glow); }
.btn--primary:hover::after { transform: translateX(120%); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hair-2); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { width: 8px; height: 8px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }

/* ------------------------------------------------------- the range band */
/* Two hairlines (70 and 180) with a flat trace between: the signature detail. */
.band { display: block; width: 120px; height: 22px; margin: 0 auto; color: var(--accent); }
.band line { stroke: var(--hair-2); stroke-width: 1; }
.band path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset 1.4s var(--ease); }
.band.is-in path, .is-in .band path { stroke-dashoffset: 0; }

/* ---------------------------------------------------------- lockup / mark */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__word { font-family: var(--display); font-weight: 600; font-size: calc(1.02rem + var(--bump)); letter-spacing: 0.2em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.mark__band { stroke: var(--hair-2); stroke-width: 1.4; }
.mark__trace { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mark--draw .mark__trace { stroke-dasharray: 90; stroke-dashoffset: 90; animation: markDraw 1.6s var(--ease) 0.2s forwards; }
@keyframes markDraw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------- footer */
/* Branding-only banner: height = 1.5 x the lockup, lockup centred exactly. */
.brandfoot { --lock: 34px; height: calc(var(--lock) * 1.5 + 48px); display: flex; align-items: center; justify-content: center; position: relative; margin-top: auto; background: rgba(238, 243, 246, 0.03); border-top: 1px solid var(--hair); }
.brandfoot .brand { height: var(--lock); }
.brandfoot .brand__mark { width: var(--lock); height: var(--lock); }
.brandfoot .brand__word { color: var(--muted); }

/* ------------------------------------------------------- video cards 2-up */
.vgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; max-width: 1000px; margin: 56px auto 0; }
.vcard { display: flex; flex-direction: column; gap: 16px; text-align: center; }
.vcard__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--hair); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9); }
.vcard__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vcard__name { margin: 0; font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; font-size: calc(1.08rem + var(--bump)); }
.vcard__desc { margin: -8px auto 0; max-width: 40ch; color: var(--muted); font-size: calc(0.92rem + var(--bump)); line-height: 1.5; }

/* ---------------------------------------------------- viewer comment card */
/* Real YouTube comments, quoted short, labelled as viewers (never "students"). */
.ycomment { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; height: 100%; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--hair); text-align: left; }
.ycomment__av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: calc(15px + var(--bump)); color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ycomment__who { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: calc(0.82rem + var(--bump)); }
.ycomment__who b { font-weight: 700; color: var(--ink); }
.ycomment__who span { color: var(--faint); }
.ycomment__text { margin: 6px 0 0; font-size: calc(0.95rem + var(--bump)); line-height: 1.5; color: var(--ink); }
.ycomment__meta { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: calc(0.78rem + var(--bump)); }
.ycomment__meta svg { width: 15px; height: 15px; fill: currentColor; }

/* -------------------------------------------------------------- reveals */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
[data-stagger] > .reveal:nth-child(2) { transition-delay: 0.08s; }
[data-stagger] > .reveal:nth-child(3) { transition-delay: 0.16s; }
[data-stagger] > .reveal:nth-child(4) { transition-delay: 0.24s; }
[data-stagger] > .reveal:nth-child(5) { transition-delay: 0.32s; }
[data-stagger] > .reveal:nth-child(6) { transition-delay: 0.40s; }
[data-stagger] > .reveal:nth-child(7) { transition-delay: 0.48s; }
[data-stagger] > .reveal:nth-child(8) { transition-delay: 0.56s; }
html.no-js .reveal, html.reduced .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .band path { transition: none; stroke-dashoffset: 0; }
  .mark--draw .mark__trace { animation: none; stroke-dashoffset: 0; }
  .btn, .btn--primary::after { transition: none; }
}

@media (max-width: 760px) {
  body { font-size: calc(16px + var(--bump)); }
  .vgrid { grid-template-columns: 1fr; gap: 32px; }
  .section { padding-block: clamp(56px, 9vh, 72px); }
  .btn { width: 100%; max-width: 420px; }
}

/* ---- mobile hardening (references/mobile.md) ---- */
img, svg, video, canvas, iframe { max-width: 100%; }
img, video { height: auto; }
p, li, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; }
table, pre { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 700px) {
  .tag, [class*="badge"], [class*="pill"] { margin-left: 0; }
}
@media (max-width: 420px) {
  .tok-merge, .tok-link, code { white-space: normal; }
}
