/* Uptrig landing page — "spec sheet" editorial layout.
   Hulaki brand: colours, type and spacing come from tokens.css; this file is
   layout. CSS only, no JavaScript, works with JS disabled (CSP script-src 'none'). */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--post-blue); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.82em; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
/* Anchor targets clear the sticky header. */
[id] { scroll-margin-top: 88px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 22px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-md); z-index: 20; }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; line-height: 1.5; }
.nowrap { white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.eyebrow { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); flex: none; }
.display-xl { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(46px, 8.2vw, 92px); line-height: .92; letter-spacing: .005em; }
.display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(30px, 4.6vw, 46px); line-height: 1; letter-spacing: .01em; }
.lede { font-size: 19px; line-height: 1.6; max-width: 58ch; }
.ne { font-size: 22px; line-height: 1.6; color: var(--crimson); font-weight: 600; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }

/* Buttons and pills: the dashboard's Button / StatusPill, for a page without the component CSS. */
.btn { display: inline-flex; align-items: center; font-weight: 600; font-size: 16px; padding: 11px 20px; border-radius: var(--radius-md); text-decoration: none; border: 1.5px solid transparent; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out; }
.btn--primary { background: var(--crimson); color: var(--on-crimson); }
.btn--primary:hover { background: var(--crimson-hover); }
.btn--secondary { background: var(--surface); color: var(--post-blue); border-color: var(--control); }
.btn--secondary:hover { border-color: var(--post-blue); }
.btn--sm { font-size: 14px; padding: 6px 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 20px; font-weight: 600; padding: 1px 10px 1px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.pill::before { font-family: var(--font-mono); font-size: 11px; }
.pill--ok { background: var(--success-soft); color: var(--success); }
.pill--ok::before { content: "\2713"; }
.pill--fail { background: var(--danger-soft); color: var(--danger); }
.pill--fail::before { content: "\2715"; }
.pill--run { background: var(--stamp); color: var(--post-blue); }
.pill--run::before { content: "\21BB"; }
.pill--soon { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--control); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; justify-content: space-between; padding-block: 13px; }
.top__nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); align-items: center; font-weight: 500; }
.top__nav a:not(.btn) { color: var(--ink); text-decoration: none; touch-action: manipulation; }
.top__nav a:not(.btn):hover { color: var(--post-blue); }
.top__meta { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--control); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo__word { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.logo__dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo__light { display: none; }
  :root:not([data-theme="light"]) .logo__dark { display: inline; }
}
:root[data-theme="dark"] .logo__light { display: none; }
:root[data-theme="dark"] .logo__dark { display: inline; }
@media (max-width: 940px) { .top__meta { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) var(--space-16); }
.hero__inner { display: grid; gap: var(--space-12); grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: center; }
.hero__copy { display: grid; gap: var(--space-6); justify-items: start; }

/* The pipeline: two nodes joined by a dashed rail, cancelled by the postmark. */
.pipe { position: relative; margin: 0; display: grid; gap: 0; padding-right: 8px; }
.node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); display: grid; gap: var(--space-3); min-width: 0; }
.node__tag { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--ink-muted); }
.node__no { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--crimson); }
.node__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.node__meta .mono { font-size: 12.5px; color: var(--ink-muted); }
.link { display: grid; justify-items: center; gap: 4px; padding-block: 10px; }
.link__rail { width: 0; height: 26px; border-left: 2px dashed var(--control); }
.link__chip { font-size: 12px; background: var(--stamp); color: var(--post-blue); padding: 3px 10px; border-radius: var(--radius-full); max-width: 100%; text-align: center; }
.link__arrow { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 11px solid var(--control); }
.stamp { position: absolute; right: 0; top: 44%; transform: rotate(-9deg); line-height: 0; }
.stamp img { width: 96px; height: auto; }

.code { margin: 0; background: var(--stamp); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); overflow-x: auto; font-size: 13px; line-height: 1.55; color: var(--ink); }
.code__method { color: var(--crimson); font-weight: 500; }
.bubble { background: var(--stamp); border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 3px; padding: 12px 15px; font-size: 16px; line-height: 1.5; max-width: 38ch; overflow-wrap: anywhere; }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); }
.ticker__track { display: flex; width: max-content; padding-block: 12px; animation: ticker 36s linear infinite; }
.ticker__track > * { padding-right: 32px; }
.ticker span { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.ticker__sep { color: var(--crimson); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; justify-content: center; width: auto; }
  .ticker__track > :nth-child(n+6) { display: none; }
}

/* ---------- Bands + section heads ---------- */
.band { padding-block: clamp(48px, 7vw, 96px); }
.band--alt { background: var(--surface); border-block: 1px solid var(--line); }
.band .wrap { display: grid; gap: var(--space-8); }

.sheet { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--space-4); }
.sheet__code { flex: 1 0 100%; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--control); }
.sheet__rule { flex: 1; min-width: 48px; border-bottom: 1px dashed var(--control); transform: translateY(-4px); }

/* ---------- 01 Stations ---------- */
.stations { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.station { display: grid; gap: var(--space-3); align-content: start; border-top: 2px solid var(--ink); padding-top: var(--space-4); }
.station__no { font-size: 13px; letter-spacing: .14em; color: var(--crimson); }
.station code { background: var(--stamp); color: var(--post-blue); padding: 1px 6px; border-radius: var(--radius-sm); }

/* ---------- 02 Channels ---------- */
.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.channel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); display: grid; gap: var(--space-2); align-content: start; justify-items: start; background: var(--ground); }
.channel__code { font-size: 12px; letter-spacing: .14em; color: var(--control); }
.channel--soon h3, .channel--soon p { color: var(--ink-muted); }

/* ---------- 03 Reliability ---------- */
.reliable { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-4); }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: "\2713"; position: absolute; left: 0; top: 0; font-family: var(--font-mono); color: var(--success); font-weight: 500; }

.term { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.term__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--stamp); }
.term__dots { display: inline-flex; gap: 6px; }
.term__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--control); opacity: .55; }
.term__title { font-size: 12px; letter-spacing: .06em; color: var(--ink-muted); }
.log__row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); font-size: 15px; }
.log__row:first-child { border-top: 0; }
.log__row > span:nth-child(2) { font-weight: 600; }
.log__why { grid-column: 2 / -1; font-size: 14px; color: var(--danger); }
.log__why.muted { color: var(--ink-muted); }

/* ---------- 04 Uses ---------- */
.uses { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.use { margin: 0; display: grid; gap: var(--space-3); align-content: start; }
.use figcaption { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.use .bubble { background: var(--ground); border: 1px solid var(--line); }

/* ---------- 05 Deploy: tear-off cards ---------- */
.split { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tear { position: relative; }
.tear__cue { position: absolute; top: -9px; left: 16px; background: var(--ground); padding-inline: 8px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--control); z-index: 1; }
.split__col { background: var(--surface); border: 1px solid var(--line); border-top: 2px dashed var(--control); border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: var(--space-8); display: grid; gap: var(--space-4); align-content: start; justify-items: start; }
.split__col .code { width: 100%; }

/* ---------- 07 FAQ ---------- */
.faq { margin: 0; display: grid; gap: var(--space-6); }
.faq__item { display: grid; gap: var(--space-2); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.faq dt { font-size: 20px; line-height: 1.3; font-weight: 600; }
.faq dd { margin: 0; max-width: 72ch; color: var(--ink-muted); }
.faq code { background: var(--stamp); color: var(--post-blue); padding: 1px 6px; border-radius: var(--radius-sm); }
.faq abbr { text-decoration: none; border-bottom: 1px dotted var(--control); cursor: help; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: var(--space-8); }
.foot__inner { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.foot__links a { color: var(--ink-muted); text-decoration: none; font-size: 14px; }
.foot__links a:hover { color: var(--post-blue); text-decoration: underline; }
.foot__meta { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- Legal pages (privacy, terms) ---------- */
.prose { max-width: 72ch; display: grid; gap: var(--space-4); }
.prose h2 { font-size: 21px; line-height: 1.3; font-weight: 600; margin-top: var(--space-4); }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-2); }
.prose a { color: var(--post-blue); }
.prose .lede { max-width: 68ch; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero__inner, .reliable, .mcp { grid-template-columns: minmax(0, 1fr); }
  .stamp { right: 4px; top: 46%; }
  .stamp img { width: 76px; }
}
@media (max-width: 620px) {
  .top__nav a:not(.btn) { display: none; }
  .hero { padding-block: var(--space-12); }
  .stamp { display: none; }
  .log__row { grid-template-columns: 96px minmax(0, 1fr); }
  .log__row > span:nth-child(3) { grid-column: 2; }
}

/* ---------- 03 MCP (inverted band) ---------- */
.band--agent { background: var(--post-blue); color: var(--on-post-blue); }
.band--agent .sheet__code { color: var(--on-post-blue); opacity: .72; }
.band--agent .sheet__rule { border-color: var(--on-post-blue); opacity: .45; }
.band--agent .small.muted { color: var(--on-post-blue); opacity: .78; }
.band--agent .mcp__tools li { background: transparent; border-color: var(--on-post-blue); color: var(--on-post-blue); opacity: .85; }
.mcp { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.mcp__copy { display: grid; gap: var(--space-6); }
.mcp__tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mcp__tools li { font-size: 12px; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius-full); padding: 3px 11px; color: var(--ink-muted); }
.term--mcp { display: grid; }
.code--mcp { margin: 0; border-radius: 0; }
.term__result { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
.term__result .mono { font-size: 12.5px; }
.term__cursor { width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-left: auto; }

/* ---------- Motion ----------
   All CSS: CSS can't be blocked by the page's CSP the way scripts can, so the
   landing stays zero-JavaScript. Everything here is opt-in via
   prefers-reduced-motion, and the scroll reveals additionally degrade to the
   static page on browsers without the view() timeline. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: staggered entrance on load. */
  .hero__copy > *, .pipe .node, .pipe .link { animation: rise-in .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero__copy > :nth-child(2) { animation-delay: .06s; }
  .hero__copy > :nth-child(3) { animation-delay: .12s; }
  .hero__copy > :nth-child(4) { animation-delay: .18s; }
  .hero__copy > :nth-child(5) { animation-delay: .24s; }
  .hero__copy > :nth-child(6) { animation-delay: .30s; }
  .pipe .node { animation-delay: .12s; }
  .pipe .link { animation-delay: .26s; }
  .pipe .node--out { animation-delay: .38s; }

  /* The postmark lands on the card. */
  .stamp { animation: stamp-in .6s cubic-bezier(.2, 1.4, .4, 1) .55s both; }

  /* The event flows down the rail and the arrow nudges toward the customer. */
  .link__rail { width: 3px; height: 28px; border-left: 0; background-image: repeating-linear-gradient(180deg, var(--control) 0 6px, transparent 6px 12px); background-size: 3px 12px; animation: flow .9s linear infinite; }
  .link__arrow { animation: nudge 1.4s ease-in-out infinite; }

  /* A working run spins its glyph; the agent terminal blinks a caret. */
  .pill--run::before { display: inline-block; animation: spin 1.6s linear infinite; }
  .term__cursor { animation: blink 1.6s steps(1) infinite; }

  /* A faint, slowly drifting drafting grid behind the hero. */
  .hero::before { animation: pan 60s linear infinite; }

  /* Controls lift under the cursor. */
  .btn { transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 120ms ease-out; }
  .btn:hover { transform: translateY(-1px); }

  /* Cards step forward on hover. */
  .channel { transition: transform 160ms ease-out, border-color 160ms ease-out; }
  .channel:hover { transform: translateY(-3px); border-color: var(--post-blue); }
}

@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-22deg) scale(1.5); } to { opacity: 1; transform: rotate(-9deg) scale(1); } }
@keyframes flow { from { background-position-y: 0; } to { background-position-y: 12px; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes pan { to { background-position: 48px 96px; } }

/* The drafting grid is static markup, drawn only behind the hero. */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: -30% -10% auto -10%; height: 150%; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .6;
  -webkit-mask-image: radial-gradient(70% 62% at 26% 16%, #000 0%, transparent 72%);
  mask-image: radial-gradient(70% 62% at 26% 16%, #000 0%, transparent 72%);
}
.hero__inner { position: relative; z-index: 1; }

/* Scroll-driven reveals, only where the view() timeline exists. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sheet, .stations > li, .channel, .mcp__copy > *, .term, .checks > li, .use, .split > .tear {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 30%;
    }
  }
}
