/* ctrl-freaq.ai — built from the Nocturne design-system tokens. */

/* Inter (variable, 400–700), self-hosted. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The canvas script reads --color-accent, --color-accent-200/300/400 and
   --color-text as #hex — keep those literal. */
:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-800: #3f424d;

  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-900: #2b2741;

  --color-section: #262a60;
  --color-section-glow: #353b80;

  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0,0,0,0.55);
  --gutter: clamp(24px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; font-weight: 500; }
p { font-weight: 400; }
a { color: var(--color-accent-300); text-decoration: none; }
a:hover { color: var(--color-accent-200); }
svg { display: block; flex: none; }
.ico { width: 1em; height: 1em; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
section[id] { scroll-margin-top: 72px; }

/* — design-system components — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; text-decoration: none; font: inherit; font-weight: 500;
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 5.6px 10px; border-radius: var(--radius-md);
}
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: 2.8px; }
.btn-ghost:hover { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; border-radius: 6px;
}
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — top bar — */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; padding: 20px var(--gutter);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-bg) 85%, transparent), transparent);
}
.crumb { display: flex; align-items: center; gap: 10px; }
.crumb-parent { color: var(--color-text); }
.crumb-parent span { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; color: var(--color-neutral-300); }
.crumb-parent:hover span { color: var(--color-accent-200); }
.crumb-sep { color: var(--color-neutral-600); }
.crumb-self { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.topbar nav { margin-left: auto; display: flex; gap: 28px; font-size: 13px; }
.topbar nav a { color: var(--color-neutral-300); }
.topbar nav a:hover { color: var(--color-accent-200); }

/* — hero — */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 720px; overflow: hidden;
  background: radial-gradient(70% 60% at 64% 56%, var(--color-accent-900) 0%, transparent 70%);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-bg) 75%, transparent) 0%, transparent 55%);
}
.gate {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; will-change: transform; opacity: 0;
}
.gate-name { font-size: 11px; letter-spacing: 0.16em; color: var(--color-neutral-200); white-space: nowrap; }
.gate-desc { font-size: 12px; color: var(--color-accent-300); white-space: nowrap; opacity: 0; transition: opacity .3s; }
.core-label {
  position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform;
  font-size: 11px; letter-spacing: 0.16em; color: var(--color-accent-200); white-space: nowrap; opacity: 0;
}
.hero-text {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 22vh;
  display: flex; flex-direction: column; gap: 28px; pointer-events: none; will-change: transform;
}
.kicker { font-size: 12px; letter-spacing: 0.16em; color: var(--color-accent-300); }
.hero h1 { font-size: clamp(48px, 7vw, 104px); line-height: 0.95; letter-spacing: -0.045em; max-width: 9.5em; }
.hero-lede { font-size: 17px; line-height: 1.55; color: var(--color-neutral-300); max-width: 420px; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; pointer-events: auto; }
.hero-hint { position: absolute; left: var(--gutter); bottom: 32px; font-size: 12px; color: var(--color-neutral-400); pointer-events: none; }
@media (hover: none) { .hero-hint { display: none; } }

/* — sections — */
.section {
  max-width: 1200px; margin: 0 auto; padding: 160px var(--gutter) 0;
  display: flex; flex-direction: column; gap: 48px;
}
.section-pipeline { padding-top: 140px; }
.section-principles { gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.section-title { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -0.035em; }
.section-lede { font-size: 16px; line-height: 1.55; color: var(--color-neutral-300); text-wrap: pretty; }

/* pipeline */
.pipe-scroll { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.pipe { min-width: 960px; display: flex; flex-direction: column; }
.pipe canvas { width: 100%; height: 150px; display: block; }
.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.stage { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; transition: opacity .25s; }
.stage-name { font-size: 13px; font-family: var(--font-mono); color: var(--color-accent-300); }
.stage-desc { font-size: 14px; line-height: 1.5; color: var(--color-neutral-300); text-wrap: pretty; }

/* operator */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; }
.role { display: flex; flex-direction: column; gap: 14px; }
.role-rule { height: 1px; background: linear-gradient(90deg, var(--color-accent-500), transparent); }
.role .ico { font-size: 24px; color: var(--color-accent-400); }
.role h3 { font-size: 22px; letter-spacing: -0.02em; }
.role p { font-size: 15px; line-height: 1.55; color: var(--color-neutral-300); text-wrap: pretty; }
.roles-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.roles-4 h3 { font-size: 20px; }
.maker-credit { font-size: 14px; color: var(--color-neutral-400); }
.operator-close {font-size: clamp(20px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.02em; color: var(--color-neutral-300); max-width: 760px; line-height: 1.3; }
.operator-close span { color: var(--color-text); }

/* principles */
.principles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.principle {
  display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: baseline;
  padding: 28px 0; background: linear-gradient(90deg, var(--color-divider), transparent) top / 100% 1px no-repeat;
}
.principle-num { font-size: 12px; color: var(--color-accent-400); font-variant-numeric: tabular-nums; }
.principle h3 { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.02em; }
.principle p { font-size: 15px; line-height: 1.55; color: var(--color-neutral-300); text-wrap: pretty; }
@media (max-width: 720px) {
  .principle { grid-template-columns: 40px minmax(0, 1fr); gap: 8px 16px; }
  .principle p { grid-column: 2; }
}

/* battle-hardened */
.callout {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 80px);
  background: radial-gradient(80% 120% at 100% 0%, var(--color-section-glow) 0%, var(--color-section) 55%);
  display: flex; flex-direction: column; gap: 20px;
}
.callout .kicker { color: var(--color-accent-200); }
.callout h2 { font-size: clamp(28px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -0.03em; max-width: 760px; }
.callout p { font-size: 16px; line-height: 1.55; color: var(--color-accent-200); max-width: 520px; text-wrap: pretty; }

/* install */
.section-install { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 48px; align-items: start; }
.install-copy { display: flex; flex-direction: column; gap: 16px; }
.install-copy .section-lede { max-width: 420px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.install-cmds { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.terminal {
  position: relative; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-md);
  padding: 24px 24px 24px 28px; display: flex; flex-direction: column; gap: 10px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.6;
}
.terminal code { font: inherit; display: flex; gap: 12px; overflow-wrap: anywhere; }
.terminal code::before { content: "›"; color: var(--color-accent-400); flex: none; }
.terminal code.muted { color: var(--color-neutral-400); }
.terminal pre { margin: 0; font: inherit; white-space: pre-wrap; display: flex; flex-direction: column; gap: 10px; padding-right: 64px; }.copy-btn { position: absolute; top: 12px; right: 12px; gap: 6px; font-size: 12px; }

/* footer */
.footer {
  max-width: 1200px; margin: 0 auto; padding: 160px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px;
}
.footer-home { display: flex; flex-direction: column; gap: 10px; }
.footer-home a { display: flex; align-items: center; gap: 10px; color: var(--color-text); font-size: 14px; }
.footer-home a .ico { color: var(--color-accent-400); }
.footer-meta { font-size: 12px; color: var(--color-neutral-400); }
.footer-refs { margin-left: auto; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--color-neutral-400); }

/* Scroll reveal: only hidden once the script has marked the page ready. */
.js-reveal [data-reveal].pending { opacity: 0; transform: translateY(28px); }
.js-reveal [data-reveal].shown { transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.7,.1,1); }

/* Narrow viewports */
@media (max-width: 640px) {
  .topbar {
    gap: 12px; padding-block: 14px;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .crumb-parent span, .crumb-sep { display: none; }
  .crumb-self { white-space: nowrap; }
  .terminal { padding-top: 48px; }
  .terminal pre { white-space: pre; overflow-x: auto; padding-right: 0; }
  .topbar nav { gap: 16px; }
  .hero { min-height: 640px; }
  .hero-text { top: 96px; gap: 20px; }
  .hero-lede { font-size: 15px; }
  .section { padding-top: 112px; }
  .footer { padding-top: 112px; }
  .footer-refs { margin-left: 0; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
