/* ============================================================
   Blixo design system · locked tokens (design-spec-locked.md)
   Hand-written stylesheet (sanctioned fallback, see BUILD-NOTES)
   ============================================================ */

:root {
  --canvas: #F9F5EA;
  --canvas-2: #F4EFE1;
  --ink: #12151C;
  --muted: #6A6455;
  --line: rgba(18, 21, 28, .16);
  --card: #F1EBDA;
  --accent: #1D43D8;
  --accent-strong: #122FA3;
  --accent-soft: #DDE4F8;
  --accent-ink: #F4F6FD;
  --sky: #B9C8F0;
  --dark-bg: #0E1424;
  --dark-ink: #E9EBF2;
  --dark-muted: #8A92A8;
  --line-dark: rgba(233, 235, 242, .14);
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-display); line-height: 1.5; overflow-x: hidden; font-size: 16px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.025em; line-height: 1.06; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--canvas); padding: 10px 16px; z-index: 200; }
.skip-link:focus { left: 0; }

/* ---------- mono label system ---------- */
.mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 400; }
.mono-wide { letter-spacing: .14em; }
.eyebrow { color: var(--muted); display: block; margin-bottom: 18px; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
section { position: relative; }
.hairline-b { border-bottom: 1px solid var(--line); }
.hairline-t { border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--canvas);
  font-size: .92rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn .arw { transition: transform .18s ease; display: inline-block; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn:hover .arw { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.cobalt { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.cobalt:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.on-cobalt { background: var(--canvas); border-color: var(--canvas); color: var(--ink); }
.btn.on-cobalt:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--accent-strong); }
.btn.ghost-cobalt { background: transparent; border-color: rgba(244, 246, 253, .4); color: var(--accent-ink); }
.btn.ghost-cobalt:hover { border-color: var(--accent-ink); color: var(--accent-ink); background: rgba(244,246,253,.08); }
.btn.on-dark { background: var(--dark-ink); border-color: var(--dark-ink); color: var(--dark-bg); }
.btn.on-dark:hover { background: var(--sky); border-color: var(--sky); color: var(--dark-bg); }
.btn.ghost-dark { background: transparent; border-color: var(--line-dark); color: var(--dark-ink); }
.btn.ghost-dark:hover { border-color: var(--sky); color: var(--sky); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- chips ---------- */
.chip {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; font-size: .66rem;
  padding: 5px 10px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; display: inline-block;
}
.chip.live { border-color: var(--accent); color: var(--accent); }
.chip.soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-strong); }
.chip.dark { border-color: var(--line-dark); color: var(--dark-muted); }

/* ---------- header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--canvas); border-bottom: 1px solid var(--line); }
.site-header .nav { display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 32px; }
.logo { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 22px; flex: 1; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: .9rem; opacity: .85; transition: opacity .15s ease, color .15s ease; }
.nav-links a:hover { opacity: 1; }
.nav-links a.active { color: var(--accent); opacity: 1; }
.lang-switch { border: 1px solid var(--line); padding: 5px 10px; color: var(--muted); text-decoration: none; flex-shrink: 0; transition: color .15s ease, border-color .15s ease; }
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }
#menuBtn { display: none; width: 38px; height: 38px; border: 1px solid var(--line); flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
#menuBtn span { display: block; width: 16px; height: 1.5px; background: var(--ink); }
#mobileMenu { border-top: 1px solid var(--line); background: var(--canvas); }
#mobileMenu nav { display: flex; flex-direction: column; padding: 14px 32px 22px; }
#mobileMenu a { color: var(--ink); text-decoration: none; padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
#mobileMenu a.btn { margin-top: 16px; justify-content: center; border-bottom: none; color: var(--canvas); }

/* ---------- footer ---------- */
.foot-cta { background: var(--accent); color: var(--accent-ink); }
.foot-cta .wrap { padding-top: 96px; padding-bottom: 96px; }
.foot-cta .eyebrow { color: var(--sky); }
.foot-cta h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); letter-spacing: -.03em; max-width: 18ch; }
.foot-cta p { margin-top: 20px; max-width: 52ch; color: var(--sky); font-size: 1.02rem; }
.foot-cta .btn-row { margin-top: 36px; }
.foot-links { background: var(--canvas); border-bottom: 1px solid var(--line); }
.foot-links .cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; padding-top: 64px; padding-bottom: 64px; }
.foot-links .col > .mono { color: var(--muted); display: block; margin-bottom: 16px; }
.foot-links ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.foot-links a { color: var(--ink); opacity: .85; text-decoration: none; font-size: .94rem; }
.foot-links a:hover { color: var(--accent); opacity: 1; }
.foot-meta .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-meta .mono { color: var(--muted); }
.foot-meta a { color: var(--muted); text-decoration: none; }
.foot-meta a:hover { color: var(--accent); }
.meta-right { display: inline-flex; align-items: center; gap: 14px; }
.foot-glyph { overflow: hidden; }
.foot-glyph .glyph {
  font-weight: 700; letter-spacing: -.05em; line-height: .78; color: var(--accent);
  font-size: clamp(6rem, 19vw, 17rem); user-select: none; transform: translateY(.16em);
}
.foot-glyph .glyph span { color: var(--ink); }

/* ---------- reveal primitives (GSAP-driven, CSS fallbacks) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.w > span { display: inline-block; transform: translateY(112%); will-change: transform; }
.no-js .w > span, .gsap-off .w > span { transform: none; }

[data-rise] { opacity: 0; transform: translateY(22px); will-change: transform, opacity; }
.no-js [data-rise], .gsap-off [data-rise] { opacity: 1; transform: none; }

[data-wipe] { clip-path: inset(0 100% 0 0); will-change: clip-path; }
.no-js [data-wipe], .gsap-off [data-wipe] { clip-path: inset(0 0 0 0); }

/* ---------- marquee divider ---------- */
.mq { overflow: hidden; background: var(--accent); color: var(--accent-ink); padding: 13px 0; white-space: nowrap; }
.mq .mq-in { display: inline-block; animation: mq 30s linear infinite; }
@keyframes mq { to { transform: translateX(-50%); } }
.mq span { margin: 0 26px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- ledger ---------- */
.ltab { border-top: 1.5px solid var(--ink); }
.lrow {
  display: grid; grid-template-columns: 110px 1.1fr 1fr 150px; gap: 20px; align-items: center;
  padding: 18px 4px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: scaleX(.88); transform-origin: left; will-change: transform, opacity;
}
.no-js .lrow, .gsap-off .lrow { opacity: 1; transform: none; }
.lrow .when { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.lrow .what { font-weight: 500; font-size: .95rem; }
.lrow .why { color: var(--muted); font-size: .9rem; }
.lrow .verdict { justify-self: end; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; }
.lrow .verdict.ok { background: var(--accent-soft); color: var(--accent-strong); }
.lrow .verdict.no { border: 1.5px solid var(--accent); color: var(--accent); }

/* ---------- shared section pieces ---------- */
.sect { padding: 110px 0; }
.sect-title { font-size: clamp(2rem, 3.8vw, 3rem); max-width: 20ch; }
.sect-lede { color: var(--muted); margin-top: 16px; max-width: 52ch; font-size: 1.03rem; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 56px; }
.link-plain { color: var(--accent); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.link-plain:hover { text-decoration: underline; text-underline-offset: 4px; }

.dark-sect { background: var(--dark-bg); color: var(--dark-ink); }
.dark-sect .eyebrow { color: var(--dark-muted); }

.figure { position: relative; }
.figure img { width: 100%; }
.figure .fig-tag { position: absolute; top: 12px; left: 12px; background: var(--canvas); border: 1px solid var(--line); padding: 4px 10px; color: var(--muted); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--canvas); border: 1px solid var(--line);
  padding: 13px 14px; border-radius: 0; outline: none; transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }

/* ---------- accordion ---------- */
.acc { border-top: 1.5px solid var(--ink); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 24px; padding: 22px 4px; font-weight: 500; font-size: 1.05rem;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; font-weight: 400; color: var(--accent); font-size: 1.4rem; line-height: 1; transition: transform .2s ease; }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc .acc-body { padding: 0 4px 24px; color: var(--muted); max-width: 62ch; }

/* ---------- counters ---------- */
.cnt-num { font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 700; letter-spacing: -.03em; color: var(--accent); line-height: 1; }

/* ---------- scroll hint ---------- */
.hint { position: absolute; bottom: 26px; left: 32px; color: var(--muted); z-index: 6; display: flex; gap: 10px; align-items: center; }
.hint .a { display: inline-flex; flex-direction: column; line-height: .8; }
.hint .a span { animation: hop 1.6s infinite; }
.hint .a span:nth-child(2) { animation-delay: .2s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(4px); opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .nav-links { display: none; }
  #menuBtn { display: flex; }
  .site-header .nav { gap: 14px; }
  .site-header .nav > .lang-switch { margin-left: auto; }
}
@media (max-width: 900px) {
  .foot-links .cols { grid-template-columns: repeat(2, 1fr); }
  .lrow { grid-template-columns: 1fr 130px; }
  .lrow .when, .lrow .why { display: none; }
  .sect { padding: 80px 0; }
  /* headline reveal masks are sized for single-line desktop titles; on mobile
     titles wrap, so drop the clip and show the text statically (no mask slide) */
  .w { overflow: visible; }
  .w > span { transform: none !important; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .site-header .nav { padding: 0 20px; }
  #mobileMenu nav { padding: 10px 20px 20px; }
  .header-cta { display: none; }
  .foot-links .cols { grid-template-columns: 1fr; gap: 28px; }
  .foot-cta .wrap { padding-top: 68px; padding-bottom: 68px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .w > span { transform: none !important; }
  [data-rise] { opacity: 1 !important; transform: none !important; }
  [data-wipe] { clip-path: inset(0 0 0 0) !important; }
  .lrow { opacity: 1 !important; transform: none !important; }
  .mq .mq-in { animation: none !important; }
  .hint .a span { animation: none !important; }
}

/* ============================================================
   Blixo docked chat rail (Aurora bleed) + slide-in panel
   ============================================================ */
.blxc-rail { position: fixed; top: 60px; left: 0; bottom: 0; width: 72px; z-index: 940; background: none; overflow: visible; transition: opacity .35s ease; }
html.blxc-open .blxc-rail { opacity: 0; pointer-events: none; }

/* Signal traffic: three hair-thin lanes, comets at staggered speeds */
.blxc-seam { position: absolute; top: 0; left: 0; bottom: 0; width: 24px; overflow: hidden; background: linear-gradient(var(--canvas-2), var(--card)); border-right: 1px solid var(--line); }
.blxc-lane { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(18,21,28,.08); }
.blxc-lane:nth-child(1) { left: 18px; }
.blxc-lane:nth-child(2) { left: 12px; }
.blxc-lane:nth-child(3) { left: 6px; }
.blxc-comet { position: absolute; left: 50%; transform: translateX(-50%); width: 2px; height: 70px; border-radius: 2px;
  background: linear-gradient(to bottom, transparent, rgba(185,200,240,.18) 42%, rgba(185,200,240,.9) 86%, #fff 100%);
  box-shadow: 0 0 8px 1px rgba(185,200,240,.7), 0 0 18px 3px rgba(29,67,216,.35); animation: blxc-comet 3.2s linear infinite; }
.blxc-comet::after { content: ""; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(185,200,240,.9), 0 0 18px 5px rgba(29,67,216,.45); }
.blxc-lane:nth-child(1) .blxc-comet { animation-duration: 2.6s; }
.blxc-lane:nth-child(2) .blxc-comet { animation-duration: 3.9s; animation-delay: .8s; }
.blxc-lane:nth-child(3) .blxc-comet { animation-duration: 3.1s; animation-delay: 1.6s; }
@keyframes blxc-comet { 0% { top: -80px; opacity: 0; } 7% { opacity: 1; } 93% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.blxc-goo { position: absolute; top: 0; bottom: 0; left: 0; width: 72px; height: 100%; pointer-events: none; overflow: visible; }
.blxc-goo path { fill: var(--accent); filter: drop-shadow(-7px 0 16px rgba(29,67,216,.4)); }
.blxc-dropicon { position: absolute; left: 0; top: 0; width: 24px; height: 24px; color: var(--accent-ink); pointer-events: none; opacity: 0; will-change: transform, opacity; }
.blxc-dropicon svg { width: 100%; height: 100%; display: block; }

/* touch / coarse-pointer fallback: a static tappable dot instead of the follower */
.blxc-touchdot { display: none; }
.blxc-rail.blxc-static .blxc-touchdot { display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; left: 12px; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px rgba(29,67,216,.6); }
.blxc-rail.blxc-static .blxc-touchdot svg { width: 22px; height: 22px; }

.blxc-scrim { position: fixed; inset: 0; background: rgba(14,20,36,.30); opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s; z-index: 930; }
html.blxc-open .blxc-scrim { opacity: 1; visibility: visible; }

.blxc-panel { position: fixed; top: 0; left: 0; bottom: 0; width: min(384px, 100%); display: flex; flex-direction: column; background: var(--canvas); border-right: 1px solid var(--ink); transform: translateX(-100%); transition: transform .5s cubic-bezier(.22,1,.36,1); z-index: 950; }
html.blxc-open .blxc-panel { transform: translateX(0); }
.blxc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--dark-bg); color: var(--dark-ink); flex: none; }
.blxc-who b { font-weight: 500; font-size: 1rem; display: block; }
.blxc-who small { font-size: .72rem; color: var(--dark-muted); }
.blxc-close { color: var(--dark-muted); font-size: 1.5rem; line-height: 1; padding: 2px 8px; }
.blxc-close:hover { color: var(--dark-ink); }
.blxc-prism { width: 26px; height: 26px; flex: none; background: conic-gradient(from 210deg, var(--sky), #fff, var(--accent), var(--sky)); transform: rotate(45deg); border-radius: 5px; animation: blxc-pulse 2.6s ease-in-out infinite; }
@keyframes blxc-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(185,200,240,.5); } 50% { box-shadow: 0 0 0 8px rgba(185,200,240,0); } }
/* the message list owns the scroll, so the chips and status stay pinned below it */
.blxc-body { flex: 1; min-height: 0; overflow: hidden; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--canvas-2); }
.blxc-msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }
.blxc-msg.bot { align-self: flex-start; background: var(--canvas); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.blxc-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.blxc-chips { display: flex; flex: none; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 2px; }
.blxc-chip { border: 1px solid var(--line); background: var(--canvas); border-radius: 999px; padding: 8px 14px; font-size: .82rem; text-align: left; transition: border-color .18s ease, color .18s ease; }
.blxc-chip:hover { border-color: var(--accent); color: var(--accent); }
.blxc-input { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); background: var(--canvas); }
.blxc-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 12px 16px; font: inherit; font-size: .9rem; background: var(--canvas-2); }
.blxc-input input:focus { outline: none; border-color: var(--accent); }
.blxc-input button { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--ink); color: var(--canvas); font-size: 1.05rem; }

/* chat rail: live conversation */
.blxc-msgs { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.blxc-msg.streaming::after { content: '\258B'; animation: blxc-blink 1s steps(1) infinite; opacity: .6; }
@keyframes blxc-blink { 50% { opacity: 0; } }
.blxc-status { flex: none; font-size: .85rem; color: var(--muted); margin: 0; }
.blxc-new { margin-left: auto; font-size: .8rem; border: 1px solid var(--line-dark); color: var(--dark-muted); background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.blxc-new:hover { border-color: var(--dark-ink); color: var(--dark-ink); }
.blxc-input input:disabled, .blxc-input button:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 900px) {
  .blxc-panel { width: 100%; }
  .blxc-rail { width: 44px; }
  .blxc-goo, .blxc-dropicon { display: none; }
}
/* the chat panel floats OVER the site: no page reflow, no dim, no outside-click
   close. Closing is via the X button or Esc only. */
.blxc-scrim { display: none; }

@media (prefers-reduced-motion: reduce) {
  .blxc-comet { animation: none; opacity: 0; }
  .blxc-prism { animation: none; }
  .blxc-msg.streaming::after { animation: none; }
  .blxc-panel, .blxc-scrim, .blxc-rail, body { transition: none; }
}
