/* Framework27 V2 — component styles. Contract: DESIGN-SYSTEM.md §6.
   Pages compose these classes; do not write page-local CSS without adding the
   component to DESIGN-SYSTEM.md first. */

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--char);
  background: var(--ink); /* ink edges around bands */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--blue); color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--blue); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--r-s) 0;
  font-family: var(--font-mono); font-size: var(--fs-small);
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

/* ---------- layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--pad); }
.container--narrow { max-width: 860px; }

.band { padding-block: var(--s8); }
.band--dark { background: var(--ink); color: var(--text-d); }
.band--dark-2 { background: var(--ink-2); color: var(--text-d); }
.band--light { background: var(--paper); color: var(--char); }
.band--hero { padding-block: calc(var(--s8) + 72px) var(--s8); }
@media (max-width: 760px) { .band { padding-block: var(--s6); } .band--hero { padding-block: calc(var(--s6) + 72px) var(--s6); } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; }
.h-hero { font-size: var(--fs-hero); line-height: 1.05; max-width: 22ch; }
.h2 { font-size: var(--fs-h2); line-height: 1.15; max-width: 26ch; }
.h3 { font-size: var(--fs-h3); line-height: 1.3; }
p { max-width: 68ch; }
.lead { font-size: calc(var(--fs-body) * 1.13); }
.small { font-size: var(--fs-small); }
.mute { color: var(--mute-l); }
.band--dark .mute, .band--dark-2 .mute { color: var(--mute-d); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.measure { max-width: 68ch; }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--mute-l); display: block; margin-bottom: var(--s3);
}
.band--dark .eyebrow, .band--dark-2 .eyebrow { color: var(--blue-hi); }

.section-head { margin-bottom: var(--s6); }
.section-head p { margin-top: var(--s3); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  transition: background var(--t-med), border-color var(--t-med), backdrop-filter var(--t-med);
  border-bottom: 1px solid transparent;
}
.nav--scrolled { background: rgba(10,10,10,.82); backdrop-filter: blur(14px); border-color: var(--line-d); }
.nav-inner {
  max-width: var(--container); margin: 0 auto; padding: 14px var(--pad);
  display: flex; align-items: center; gap: var(--s4);
  color: var(--text-d);
}
.nav-logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.nav-logo .mono { color: var(--blue-hi); font-weight: 500; }
.nav-links { display: flex; gap: var(--s3); list-style: none; margin-left: auto; }
.nav-links a { text-decoration: none; font-size: var(--fs-small); color: var(--mute-d); transition: color var(--t-fast); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }
.nav .btn { margin-left: var(--s2); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-d); color: var(--text-d); border-radius: var(--r-s); padding: 8px 12px; font-family: var(--font-mono); font-size: var(--fs-small); }
@media (max-width: 900px) {
  .nav-links, .nav .btn { display: none; }
  .nav-toggle { display: block; }
  .nav--open { background: var(--ink); }
  .nav--open .nav-links {
    display: flex; flex-direction: column; position: fixed; inset: 64px 0 auto 0;
    background: var(--ink); padding: var(--s4) var(--pad) var(--s5); gap: var(--s3);
    border-bottom: 1px solid var(--line-d); margin: 0;
  }
  .nav--open .nav-links a { font-size: 1.2rem; font-family: var(--font-head); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 500; font-size: .95rem;
  padding: 13px 22px; border-radius: var(--r-btn); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn-arrow { display: inline-block; transition: transform var(--t-fast); }
.btn:hover .btn-arrow { transform: translateX(2px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hi); }
.btn--ghost { border-color: var(--line-l); color: var(--char); background: transparent; }
.band--dark .btn--ghost, .band--dark-2 .btn--ghost, .nav .btn--ghost { border-color: var(--line-d); color: var(--text-d); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.band--dark .btn--ghost:hover { color: var(--blue-hi); border-color: var(--blue-hi); }
.btn--lg { padding: 16px 28px; font-size: 1.05rem; }

.cta-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s4); }
.trust-line { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .06em; color: var(--mute-d); margin-top: var(--s3); }

/* ---------- system grid (the product artefact) ---------- */
.sysgrid { border: 1px solid var(--line-d); border-radius: var(--r-m); overflow: hidden; background: var(--ink-2); }
.sysgrid-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line-d);
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase; color: var(--mute-d);
}
.sysrow {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s2); align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--line-d);
  transition: background var(--t-fast);
}
.sysrow:last-child { border-bottom: none; }
.sysrow:hover { background: var(--ink-3); }
.sysrow .idx { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--mute-d); }
.sysrow .name { font-family: var(--font-head); font-weight: 500; font-size: .98rem; color: var(--text-d); }
.sysrow .desc { grid-column: 2; font-size: var(--fs-small); color: var(--mute-d); max-width: 56ch; }
.sysgrid--hero .sysrow { padding: 10px 18px; }
.sysgrid--hero .desc { display: none; }
@media (max-width: 900px) { .sysgrid--hero .sysrow { padding: 9px 14px; } }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot--live { background: var(--live); }
.dot--gate { background: var(--gate); }
.dot--queue { background: var(--queue); }
.dot-wrap { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; color: var(--mute-d); }
@media (prefers-reduced-motion: no-preference) {
  .dot--live { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(47,191,113,.35); }
    50% { box-shadow: 0 0 0 5px rgba(47,191,113,0); }
  }
}

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat { border-left: 2px solid var(--blue); padding-left: var(--s2); }
.stat-num { font-family: var(--font-mono); font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 500; line-height: 1.1; font-feature-settings: "tnum"; }
.stat-label { font-size: var(--fs-small); color: var(--mute-l); margin-top: 6px; }
.band--dark .stat-label, .band--dark-2 .stat-label { color: var(--mute-d); }

/* ---------- cards ---------- */
.card {
  border-radius: var(--r-m); padding: var(--s4);
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.band--light .card { background: var(--paper-2); box-shadow: var(--shadow-card); border: 1px solid transparent; }
.band--dark .card, .band--dark-2 .card { background: var(--ink-3); border: 1px solid var(--line-d); }
.card:hover { transform: translateY(-3px); }
.band--light .card:hover { border-color: rgba(0,87,255,.35); }
.band--dark .card:hover, .band--dark-2 .card:hover { border-color: rgba(255,255,255,.18); }
.card .card-kicker { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; color: var(--blue); display: block; margin-bottom: var(--s2); }
.card .h3 { margin-bottom: var(--s2); }
.card p { font-size: .95rem; }
.band--light .card p { color: var(--mute-l); }
.band--dark .card p, .band--dark-2 .card p { color: var(--mute-d); }

/* ---------- timeline (7-day rail) ---------- */
.timeline { display: grid; gap: var(--s3); }
.tl-step { display: grid; grid-template-columns: 92px 1fr; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line-l); }
.band--dark .tl-step, .band--dark-2 .tl-step { border-color: var(--line-d); }
.tl-day { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--blue); letter-spacing: .06em; padding-top: 3px; }
.tl-step .h3 { margin-bottom: 6px; }
.tl-step p { font-size: .95rem; color: var(--mute-l); }
.band--dark .tl-step p, .band--dark-2 .tl-step p { color: var(--mute-d); }
@media (max-width: 640px) { .tl-step { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- score bars ---------- */
.scorebar { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: baseline; padding-block: 10px; }
.scorebar-label { font-size: var(--fs-small); }
.scorebar-val { font-family: var(--font-mono); font-size: var(--fs-small); }
.scorebar-track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line-d); overflow: hidden; }
.band--light .scorebar-track { background: var(--line-l); }
.scorebar-fill { height: 100%; background: var(--blue); border-radius: 2px; transform-origin: left; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line-l); }
.band--dark .faq, .band--dark-2 .faq { border-color: var(--line-d); }
.faq-item { border-bottom: 1px solid var(--line-l); }
.band--dark .faq-item, .band--dark-2 .faq-item { border-color: var(--line-d); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding: var(--s3) 0; font-family: var(--font-head); font-weight: 500; font-size: 1.05rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--blue); font-size: 1.2rem; transition: transform var(--t-fast); flex: none; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 0 var(--s3); max-width: 62ch; color: var(--mute-l); font-size: .97rem; }
.band--dark .faq-item .faq-body, .band--dark-2 .faq-item .faq-body { color: var(--mute-d); }

/* ---------- pricing tiers ---------- */
.tier-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s3); align-items: stretch; }
.tier { display: flex; flex-direction: column; gap: var(--s2); }
.tier--featured { border-top: 3px solid var(--blue); }
.tier .tier-name { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--mute-l); }
.band--dark .tier .tier-name, .band--dark-2 .tier .tier-name { color: var(--mute-d); }
.tier .tier-price { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 500; font-feature-settings: "tnum"; }
.tier .tier-price .per { font-size: .9rem; color: var(--mute-l); }
.tier ul { list-style: none; display: grid; gap: 8px; font-size: .92rem; }
.tier ul li { padding-left: 18px; position: relative; color: var(--mute-l); }
.band--dark .tier ul li, .band--dark-2 .tier ul li { color: var(--mute-d); }
.tier ul li::before { content: "·"; position: absolute; left: 4px; color: var(--blue); font-weight: 700; }
.tier .btn { margin-top: auto; justify-content: center; }

/* ---------- forms ---------- */
.form { display: grid; gap: var(--s3); }
.form-row { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field label { display: block; font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase; color: var(--mute-d); margin-bottom: 8px; }
.input, .select, .textarea {
  width: 100%; background: var(--ink-3); border: 1px solid var(--line-d); border-radius: 12px;
  padding: 13px 16px; color: var(--text-d); font-family: var(--font-body); font-size: 1rem;
  transition: border-color var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 49%, var(--mute-d) 50%), linear-gradient(135deg, var(--mute-d) 50%, transparent 51%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-note { font-family: var(--font-mono); font-size: var(--fs-small); padding: 14px 16px; border-radius: var(--r-s); display: none; }
.form-note--ok { background: rgba(47,191,113,.1); color: var(--live); border: 1px solid rgba(47,191,113,.3); }
.form-note--err { background: rgba(232,161,58,.1); color: var(--gate); border: 1px solid rgba(232,161,58,.3); }
.form-note.is-visible { display: block; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line-d); padding-block: 14px; }
.marquee-inner { display: flex; gap: var(--s5); white-space: nowrap; font-family: var(--font-mono); font-size: var(--fs-small); letter-spacing: .1em; text-transform: uppercase; color: var(--mute-d); will-change: transform; }
.marquee-inner span { display: inline-flex; align-items: center; gap: var(--s5); }

/* ---------- pin section (home loop) ---------- */
.pin-stage { position: relative; }
.pin-panels { display: grid; gap: var(--s3); }
@media (min-width: 901px) {
  .pin-panels { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--mute-d); border-top: 1px solid var(--line-d); padding-block: var(--s6); font-size: var(--fs-small); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s4); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--text-d); margin-bottom: var(--s2); font-weight: 500; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer a { text-decoration: none; color: var(--mute-d); transition: color var(--t-fast); }
.footer a:hover { color: #fff; }
.footer-brand { font-family: var(--font-head); font-weight: 700; color: var(--text-d); font-size: 1.05rem; margin-bottom: var(--s2); }
.footer-legal { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line-d); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }

/* ---------- CRAFT LAYER (ruled IN 25/08 — Rob: "nothing but the best") ---------- */

/* cross-page view transitions (progressive — Chrome/Edge native) */
@view-transition { navigation: auto; }

/* hero canvas — living grid behind hero content */
.band--hero { position: relative; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; }
.band--hero > .container { position: relative; z-index: 1; }

/* scroll progress readout (JS-injected) */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 150; background: var(--blue); transform-origin: left; transform: scaleX(0); pointer-events: none; }

/* custom cursor (JS-injected; fine-pointer devices only) */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor body, html.has-cursor a, html.has-cursor button, html.has-cursor summary, html.has-cursor label { cursor: none; }
  html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto; }
}
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 200; border-radius: 50%; mix-blend-mode: difference; }
.cursor-dot { width: 6px; height: 6px; background: #fff; margin: -3px 0 0 -3px; }
.cursor-ring { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.8); margin: -15px 0 0 -15px; transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), opacity .25s; }
.cursor-ring.is-active { width: 52px; height: 52px; margin: -26px 0 0 -26px; }

/* blinking readout caret */
.caret::after { content: "▍"; margin-left: 6px; color: var(--blue-hi); animation: blink 1.1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .caret::after { animation: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* sysgrid boot sweep — a light bar the JS drives down the grid once */
.sysgrid { position: relative; }
.sweep { position: absolute; left: 0; right: 0; top: 0; height: 42px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(0,87,255,0) 0%, rgba(0,87,255,.12) 50%, rgba(0,87,255,0) 100%); }

/* word-mask hero (JS wraps words; static text without JS) */
.h-hero .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.h-hero .wi { display: inline-block; }

/* card tilt — JS drives transform; keep hover lift for non-fine pointers */
@media (hover: hover) and (pointer: fine) {
  .card[data-tilted] { transition: border-color var(--t-med), box-shadow var(--t-med); }
}

/* ---------- reveal defaults (JS enhances; safe without JS) ---------- */
[data-reveal], [data-hero-line] { opacity: 1; }
.js [data-reveal] { opacity: 0; transform: translateY(28px); }
.js [data-hero-line] { opacity: 0; transform: translateY(34px); }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js [data-hero-line] { opacity: 1 !important; transform: none !important; }
  .marquee-inner { transform: none !important; }
  html { scroll-behavior: auto; }
}
