/* ════════════════════════════════════════════════════════════════
   spectrum.css — cerver's shared "riso color-block" design system.
   Used by the use-case pages (and any page that wants the look).
   Mirrors the root landing: warm paper, a .block primitive with a
   texture library, a stage hero, a hover megamenu, section rhythm.
   ════════════════════════════════════════════════════════════════ */
:root {
  --paper:  #f4f1e8;
  --paper-2:#eae5d7;
  --ink:    #1b1a16;
  --muted:  #6c685c;
  --faint:  #a39d8c;
  --line:   #d9d3c2;

  /* warm spectrum — agents */
  --c-yellow:#ecd24f;
  --c-amber: #e6a93f;
  --c-orange:#df7536;
  --c-coral: #dd8a6b;
  --c-pink:  #e08cb4;
  /* cool spectrum — compute */
  --c-magenta:#d2588f;
  --c-blue:   #6ba2dd;
  --c-mint:   #9fd0ab;
  --c-green:  #4f9d74;
  --c-forest: #356f52;
  --c-indigo: #7b86cf;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --max: 1100px;

  /* per-page accent — override on <body style="--accent:var(--c-…)"> */
  --accent: var(--c-orange);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
.mono, code, pre { font-family: var(--mono); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 40px; }

/* —— page paper grain —— */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(70,58,34,0.6) 0.6px, transparent 1.1px);
  background-size: 5px 5px; opacity: 0.07; mix-blend-mode: multiply;
}
.page { position: relative; z-index: 1; }

/* ─── THE BLOCK primitive ───
   props: --c colour, --tex grain pitch, --texop strength. Default
   texture = dots; add a .tex-* class for another character. */
.block { position: relative; background: var(--c, var(--c-coral)); overflow: hidden; }
.block::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: multiply; opacity: var(--texop, 0.58);
  background-image:
    radial-gradient(rgba(34,22,8,0.85) 0.8px, transparent 1.3px),
    radial-gradient(rgba(34,22,8,0.45) 0.7px, transparent 1.2px);
  background-size: var(--tex,5px) var(--tex,5px),
                   calc(var(--tex,5px) * 1.8) calc(var(--tex,5px) * 1.8);
  background-position: 0 0, calc(var(--tex,5px) * 0.5) calc(var(--tex,5px) * 0.8);
}
.tex-sand::after {
  background-image:
    radial-gradient(rgba(34,22,8,0.6) 0.5px, transparent 0.9px),
    radial-gradient(rgba(34,22,8,0.4) 0.5px, transparent 0.8px);
  background-size: 3px 3px, 4px 4px; background-position: 0 0, 1.5px 2px;
}
.tex-rock::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.34' numOctaves='5' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.9' intercept='-0.38'/%3E%3CfeFuncG type='linear' slope='1.9' intercept='-0.38'/%3E%3CfeFuncB type='linear' slope='1.9' intercept='-0.38'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E");
  background-size: 200px 200px; opacity: calc(var(--texop, 0.58) * 1.7);
}
.tex-rings::after {
  background-image: radial-gradient(circle, transparent 0 1.5px, rgba(34,22,8,0.55) 1.5px 2.3px, transparent 2.3px);
  background-size: var(--tex,10px) var(--tex,10px);
}
.tex-lines::after {
  background-image: repeating-linear-gradient(48deg, rgba(34,22,8,0.5) 0 1px, transparent 1px var(--tex,6px));
  background-size: auto;
}
.tex-cross::after {
  background-image:
    repeating-linear-gradient(45deg,  rgba(34,22,8,0.42) 0 1px, transparent 1px var(--tex,7px)),
    repeating-linear-gradient(-45deg, rgba(34,22,8,0.42) 0 1px, transparent 1px var(--tex,7px));
  background-size: auto;
}

/* ─── header / nav ─── */
header { position: sticky; top: 0; z-index: 40; background: rgba(244,241,232,0.86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.brand svg { display: block; color: var(--accent); }
.brand svg > *:not([fill]) { fill: currentColor; }
nav.primary { display: flex; align-items: center; gap: 24px; }
nav.primary > a { font-family: var(--mono); font-size: 13px; color: var(--muted); transition: color .15s; }
nav.primary > a:hover { color: var(--ink); }

/* hover megamenus (products + use-cases) */
/* not position:relative — so the flyout anchors to .bar (the topbar)
   and both menus align to the same right edge, below the bar. */
.nav-item { align-self: stretch; display: inline-flex; align-items: center; outline: none; }
.nav-trigger { font-family: var(--mono); font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: color .15s; }
.nav-trigger:hover, .nav-item:hover .nav-trigger, .nav-item.is-open .nav-trigger { color: var(--ink); }
.nav-caret { font-size: 8px; transition: transform .15s; }
.nav-item:hover .nav-caret, .nav-item.is-open .nav-caret { transform: translateY(1px); }
.flyout {
  /* float a small gap below the topbar as a fully-bordered panel */
  position: absolute; top: calc(100% + 8px); right: 0; padding: 22px 24px;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 26px 60px rgba(27,26,22,0.16);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility 0s .12s; z-index: 60;
}
.nav-item:hover .flyout, .nav-item:focus-within .flyout, .nav-item.is-open .flyout {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .12s ease, transform .12s ease, visibility 0s 0s;
}
/* table layout: subgrid aligns every column's header + item rows so the
   panel reads as a clean grid, not four mismatched stacks. */
.flyout--products { min-width: 660px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: auto repeat(4, auto); column-gap: 24px; row-gap: 12px; }
.flyout--products .flyout-col { display: grid; grid-template-rows: subgrid; grid-row: span 5; gap: 0; }
.flyout--uc { min-width: 360px; display: flex; flex-direction: column; gap: 4px; }
.flyout-col-head { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.coming-soon-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: rgba(223,117,54,0.12); padding: 2px 6px; }
.flyout-item { display: block; padding: 7px 0; }
.flyout-item-title { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); line-height: 1.3; }
.flyout-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.flyout-item:hover .flyout-item-title { text-decoration: underline; }
/* use-cases items: chip + text */
.uc-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 8px; border-radius: 2px; transition: background .12s; }
.uc-item:hover { background: var(--paper-2); }
.uc-item .chip { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.uc-item .t { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.uc-item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* hamburger + mobile sheet */
.menu-btn { display: none; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.menu-btn span { width: 20px; height: 1.6px; background: var(--ink); transition: transform .18s, opacity .18s; }
.menu-btn.open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }
.sheet { display: none; border-bottom: 1px solid var(--line); }
.sheet.open { display: block; }
.sheet a { display: block; font-family: var(--mono); font-size: 15px; padding: 15px 0; border-top: 1px solid var(--line); }
.sheet a:first-child { border-top: 0; }
.sheet .sheet-head { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 0 6px; border-top: 1px solid var(--line); }

/* ─── hero stage ─── */
.hero { position: relative; }
.field {
  position: relative; display: grid; grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr); min-height: 72vh;
  max-width: 1320px; margin: 0 auto; padding: 34px 40px 0;
}
.field::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid rgba(27,26,22,0.26); z-index: 0; }
.lockup {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.lockup::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 60%; height: 86%;
  background: radial-gradient(ellipse at center, var(--paper) 42%, rgba(244,241,232,0.82) 60%, rgba(244,241,232,0) 78%);
}
.lockup .mark { color: var(--accent); margin-bottom: 18px; }
.lockup .eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 16px; }
.lockup h1 { margin: 0; font-size: clamp(36px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.022em; font-weight: 700; max-width: 18ch; }
.lockup p { margin: 22px 0 0; max-width: 48ch; color: var(--muted); font-size: clamp(16px, 1.7vw, 19px); }
.lockup .cta { margin: 30px 0 0; display: flex; gap: 26px; align-items: center; flex-wrap: wrap; justify-content: center; }
.lockup .cta a { font-family: var(--mono); font-size: 14px; border-bottom: 1px solid var(--faint); padding-bottom: 3px; transition: border-color .15s; }
.lockup .cta a:hover { border-color: var(--ink); }
.lockup .cta a.muted { color: var(--muted); }
.hero-mini-chart { display: none; }

/* spectrum divider band */
.spectrum { display: flex; height: 12px; }
.spectrum .block { flex: 1; }

/* ─── section rhythm ─── */
section.pad { border-bottom: 1px solid var(--line); }
.pad .wrap { padding-top: 96px; padding-bottom: 96px; }
.num { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .04em; margin-bottom: 24px; display: inline-flex; align-items: center; gap: 10px; }
.num .chip { width: 11px; height: 11px; }
h2 { margin: 0; max-width: 24ch; font-size: clamp(26px, 3.5vw, 40px); line-height: 1.1; letter-spacing: -0.015em; font-weight: 700; }
.body { margin: 20px 0 0; max-width: 58ch; color: var(--muted); font-size: 18px; }
.lead { margin: 0; max-width: 60ch; color: var(--muted); font-size: 18px; }

.defs { margin: 52px 0 0; }
.def { display: grid; grid-template-columns: 26px 190px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); align-items: baseline; }
.def:last-child { border-bottom: 1px solid var(--line); }
.def .chip { width: 14px; height: 14px; align-self: center; }
.def dt { font-family: var(--mono); font-size: 15px; }
.def dd { margin: 0; color: var(--muted); font-size: 17px; }
.def dd b { color: var(--ink); font-weight: 600; }

/* value cards (3-up) */
.cards { margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.card { background: var(--paper); padding: 24px; transition: background .18s, transform .18s; }
.card:hover { background: #fbf9f2; transform: translateY(-2px); }
.card .chip { width: 18px; height: 18px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* code / example block */
.example { margin: 40px 0 0; border: 1px solid var(--line); background: #fbf9f2; padding: 24px 26px; overflow-x: auto; }
.example pre { margin: 0; font-size: 14px; line-height: 1.85; color: var(--muted); }
.example .fg { color: var(--ink); }
.example .s { color: var(--accent); }
.example .ok { color: var(--c-green); }

/* install / cta band */
.install-cmd { margin: 36px 0 0; padding: 20px 22px; border: 1px solid var(--line); background: #fbf9f2; display: flex; align-items: center; gap: 16px; font-family: var(--mono); font-size: 15px; overflow-x: auto; }
.install-cmd .s { color: var(--accent); }
.install-cmd code { white-space: nowrap; }
.copy { margin-left: auto; flex: none; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: none; border: 0; cursor: pointer; }
.copy:hover { color: var(--ink); }
.copy.done { color: var(--c-green); }
.caption { margin: 22px 0 0; color: var(--muted); font-size: 16px; max-width: 56ch; }

/* footer */
footer { padding: 46px 40px; max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
footer a:hover { color: var(--ink); }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ─── responsive ─── */
@media (max-width: 900px) { .nav-item { display: none; } }
@media (max-width: 860px) {
  /* Below this width the text leads; the block field becomes a compact
     mini-chart inside the copy instead of a full-width visual before it. */
  .hero.usecase-hero { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
  .hero.usecase-hero .lockup { position: static; order: 1; padding: 54px 28px 36px; }
  .hero.usecase-hero .field { display: none; }
  .hero.usecase-hero .lockup::before { width: min(560px, 112vw); height: 76%; opacity: .72; }
  .hero.usecase-hero .lockup h1 { font-size: clamp(38px, 11vw, 54px); max-width: 12ch; }
  .hero.usecase-hero .lockup p { max-width: 34ch; margin-top: 18px; font-size: 18px; line-height: 1.58; }
  .hero.usecase-hero .hero-mini-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    width: min(330px, 88vw);
    height: 104px;
    margin: 28px auto 0;
    padding: 0 6px;
  }
  .hero-mini-side { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 4px; }
  .hero-mini-side .block { min-width: 0; }
  .hero-mini-side.left .block:nth-child(1),
  .hero-mini-side.right .block:nth-child(3) { height: 96px; }
  .hero-mini-side.left .block:nth-child(2),
  .hero-mini-side.right .block:nth-child(2) { height: 62px; }
  .hero-mini-side.left .block:nth-child(3),
  .hero-mini-side.right .block:nth-child(1) { height: 38px; }
  .hero.usecase-hero .lockup .cta { margin-top: 26px; gap: 18px 24px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .wrap, footer { padding-left: 22px; padding-right: 22px; }
  .pad .wrap { padding-top: 62px; padding-bottom: 62px; }
  nav.primary { display: none; }
  .menu-btn { display: flex; }
  .hero.usecase-hero .lockup { padding: 54px 22px 44px; }
  .def { grid-template-columns: 14px 1fr; gap: 14px; }
  .def dt { grid-column: 2; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
