/* =========================================================
   Ark Novae: design tokens
   ========================================================= */
:root {
  /* Brand palette */
  --porcelain: #F5F3EE;
  --porcelain-2: #ECE8E0;
  --paper: #FBFAF7;
  --ink: #0A1C24;
  --ink-2: #102A34;
  --ink-3: #18394425;
  --graphite: #182C33;
  --teal: #0B746D;
  --teal-dark: #085C56;
  --teal-soft: #E1F0EC;
  --mint: #83E8CE;
  --amber: #E9B46B;
  --amber-ink: #8A5A12;
  --danger: #A3392B;

  /* Text */
  --text: var(--graphite);
  --muted: #4B5D63;
  --on-ink: #EAF2F0;
  --on-ink-muted: #A8BEBC;

  /* Lines, radii, shadows */
  --line: rgba(24, 44, 51, .12);
  --line-strong: rgba(24, 44, 51, .2);
  --line-ink: rgba(131, 232, 206, .16);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(10, 28, 36, .06), 0 2px 8px rgba(10, 28, 36, .05);
  --shadow-md: 0 18px 40px -22px rgba(10, 28, 36, .35);
  --shadow-ink: 0 24px 60px -30px rgba(0, 0, 0, .8);

  /* Type */
  --font-display: Manrope, "Segoe UI", system-ui, sans-serif;
  --font-body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Layout */
  --maxw: 1320px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 9vw, 136px);
  --header-h: 68px;

  /* Motion */
  --dur-fast: 150ms;
  --dur-panel: 320ms;
  --dur-section: 600ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--porcelain);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  font-weight: 700;
}
h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
ul, ol { padding: 0; margin: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.cinema :focus-visible, .cta :focus-visible { outline-color: var(--mint); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--graphite); padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 600; box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}
.eyebrow--mint { color: var(--mint); }

.tag {
  display: inline-block; font-style: normal; font-size: .72rem; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: var(--porcelain-2); color: var(--muted);
  vertical-align: middle; letter-spacing: .01em;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .92rem; border-radius: 10px; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .92rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 10px 24px -12px rgba(11, 116, 109, .9); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-ghost { color: var(--on-ink); border-color: rgba(234, 242, 240, .28); }
.btn-ghost:hover { border-color: var(--mint); }
.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal-soft); }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(10, 28, 36, .72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-ink);
  color: var(--on-ink);
  transition: background var(--dur-panel) var(--ease), color var(--dur-panel) var(--ease), border-color var(--dur-panel) var(--ease);
}
.site-header.is-light { background: rgba(245, 243, 238, .86); color: var(--graphite); border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo--dark { color: var(--graphite); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links > a:not(.btn) { color: inherit; opacity: .82; font-weight: 500; font-size: .95rem; }
.nav-links > a:not(.btn):hover { opacity: 1; text-decoration: none; }

.motion-toggle {
  display: inline-flex; align-items: center; gap: 6px; background: none; cursor: pointer;
  border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 500; opacity: .85; min-height: 36px;
}
.motion-toggle:hover { opacity: 1; }
.motion-toggle svg { fill: currentColor; }
.motion-toggle .i-play { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: block; }
.motion-toggle[aria-pressed="true"] .i-pause { display: none; }

.menu-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; min-width: 44px; min-height: 44px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px auto; border-radius: 2px; }

/* =========================================================
   Cinematic area (dark)
   ========================================================= */
.cinema {
  position: relative;
  z-index: 1;
  background:
    radial-gradient(1100px 700px at 72% 18%, #173843 0%, rgba(23, 56, 67, 0) 60%),
    var(--ink);
  color: var(--on-ink);
  margin-top: calc(var(--header-h) * -1);
}

.hero { position: relative; z-index: 1; padding: calc(var(--header-h) + 56px) 0 72px; }
@media (min-width: 1024px) {
  .hero { min-height: max(640px, 100svh); display: flex; align-items: center; padding: calc(var(--header-h) + 24px) 0 48px; }
}
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: center; }
.hero-copy { grid-column: 1 / span 6; position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(3rem, 4.9vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: .4em;
}
.lead { font-size: clamp(1.08rem, 1.3vw, 1.22rem); color: var(--on-ink-muted); max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 28px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--on-ink-muted); font-size: .92rem; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

/* Stage: illustrated fallback first, WebGL crossfades in when ready. */
.stage { grid-column: 7 / span 6; position: relative; }
.stage-view { position: relative; aspect-ratio: 4 / 3; }
.stage-fallback, .stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-fallback { object-fit: contain; transition: opacity 700ms var(--ease); }
.stage-canvas { opacity: 0; transition: opacity 700ms var(--ease); touch-action: pan-y; }
.stage.is-webgl .stage-canvas { opacity: 1; }
.stage.is-webgl .stage-fallback { opacity: 0; }

.stage-hero-ui { position: static; }
.stage-sample {
  position: absolute; top: 2%; right: 0; z-index: 2;
  width: 214px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--paper); color: var(--graphite); box-shadow: var(--shadow-ink);
  border: 1px solid rgba(255, 255, 255, .6);
}
.sample-tag { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.sample-title { font-weight: 600; font-size: .88rem; margin: 0 0 6px; }
.sample-big { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; margin: 0 0 8px; }
.sample-big span { font-family: var(--font-body); font-size: .85rem; font-weight: 500; color: var(--muted); }
.sample-row { display: flex; gap: 10px; font-size: .78rem; color: var(--muted); margin: 0; }

.zone-ui { margin-top: 16px; position: relative; z-index: 2; }
.zone-label { font-size: .8rem; font-weight: 600; color: var(--on-ink-muted); margin: 0 0 8px; }
.zone-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.zone-buttons button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: rgba(16, 42, 52, .72); color: var(--on-ink); border: 1px solid var(--line-ink);
  font-size: .88rem; font-weight: 500;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.zone-buttons button:hover { border-color: rgba(131, 232, 206, .5); }
.zone-buttons button[aria-pressed="true"] { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.zone-panel {
  margin-top: 12px; padding: 14px 16px; border-radius: var(--r-md); max-width: 520px;
  background: rgba(16, 42, 52, .92); border: 1px solid var(--line-ink);
}
.zone-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; color: #fff; }
.zone-text { margin: 0; color: var(--on-ink-muted); font-size: .95rem; }

/* ---------- Story (static by default) ---------- */
.story { position: relative; z-index: 1; padding: 24px 0 var(--section-y); }
.skip-story {
  position: absolute; left: var(--gutter); top: 0; z-index: 3;
  font-size: .85rem; color: var(--on-ink-muted); padding: 8px 0; text-decoration: underline;
  text-underline-offset: 3px;
}
.skip-story:hover, .skip-story:focus { color: var(--mint); }
.story-rail { display: none; }
.story-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-top: 40px; }
.story-step {
  padding: 28px; border-radius: var(--r-lg); border: 1px solid var(--line-ink);
  background: linear-gradient(180deg, rgba(23, 56, 67, .55), rgba(16, 42, 52, .35));
}
.story-step h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); color: #fff; }
.story-step p { color: var(--on-ink-muted); }
.step-n { font-family: var(--font-display); font-weight: 700; color: var(--mint); font-size: .9rem; letter-spacing: .08em; }
.step-roles { display: grid; gap: 6px; margin-top: 4px; }
.step-roles li { padding-left: 16px; position: relative; color: var(--on-ink-muted); }
.step-roles li::before { content: ""; position: absolute; left: 0; top: .65em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--mint); }
.step-roles b { color: var(--on-ink); font-weight: 600; }
.story-ghost { display: none; }
.story-labels { display: none; }
.cinema-on .story-labels { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.story-labels span {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: rgba(10, 28, 36, .86); color: var(--on-ink); border: 1px solid rgba(131, 232, 206, .45);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .8);
}
.story-labels [data-label="sis"], .story-labels [data-label="lms"] { background: var(--mint); color: var(--ink); border-color: var(--mint); }

/* ---------- Enhanced cinematic mode (desktop, motion allowed, WebGL) ---------- */
.cinema-on .hero { min-height: max(640px, 100svh); display: flex; align-items: center; padding: calc(var(--header-h) + 24px) 0 48px; pointer-events: none; }
.cinema-on .hero-copy { pointer-events: auto; }
.cinema-on .stage { position: fixed; inset: 0; z-index: 0; grid-column: auto; }
.cinema-on .stage-view { position: absolute; inset: 0; aspect-ratio: auto; }
.cinema-on .stage-fallback { left: 42%; right: 2%; top: 14%; bottom: 14%; width: auto; height: auto; }
.cinema-on .stage-hero-ui { position: absolute; inset: 0; pointer-events: none; }
.cinema-on .stage-hero-ui > * { pointer-events: auto; }
.cinema-on .stage-sample { top: calc(var(--header-h) + 4vh); bottom: auto; right: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); }
@media (max-height: 780px) {
  .cinema-on .stage-sample { width: 176px; padding: 10px 12px; top: calc(var(--header-h) + 12px); }
  .cinema-on .sample-row { display: none; }
  .cinema-on .sample-big { font-size: 1.5rem; margin: 0; }
}
.cinema-on .zone-ui { position: absolute; left: 44%; right: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); bottom: 36px; margin: 0; }
.cinema-on .zone-panel { position: absolute; bottom: calc(100% + 12px); left: 0; margin: 0; }

.cinema-on .story { height: 260vh; padding: 0; pointer-events: none; }
.cinema-on .skip-story { pointer-events: auto; top: 16px; }
.cinema-on .story-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.cinema-on .story-grid { position: static; }
.cinema-on .story-rail {
  display: flex; gap: 18px; margin-bottom: 28px; font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: rgba(168, 190, 188, .55);
}
.cinema-on .story-rail li { position: relative; padding-top: 12px; transition: color var(--dur-panel) var(--ease); }
.cinema-on .story-rail li::before { content: ""; position: absolute; top: 0; left: 0; width: 28px; height: 2px; background: currentColor; border-radius: 2px; transition: width var(--dur-panel) var(--ease); }
.cinema-on .story-rail li.is-active { color: var(--mint); }
.cinema-on .story-rail li.is-active::before { width: 44px; }
.cinema-on .story-steps { display: block; position: relative; padding: 0; min-height: 320px; width: min(29vw, 420px); }
.cinema-on .story-step { position: absolute; inset: 0 0 auto 0; padding: 0; border: 0; background: none; pointer-events: auto; }
.cinema-on .story-step h3 { font-size: clamp(2rem, 3.1vw, 3rem); line-height: 1.08; }
.cinema-on .story-step p:not(.step-n) { font-size: 1.08rem; }

.cinema-on .story-ghost {
  display: block; position: absolute; left: 38.5vw; width: 53vw; top: 50%;
  aspect-ratio: 12.9 / 8.3; transform: translateY(-50%);
  background: var(--porcelain); color: var(--graphite); border-radius: 18px; box-shadow: var(--shadow-ink);
  overflow: hidden; opacity: 0; visibility: hidden;
}
.ghost-bar { display: flex; justify-content: space-between; padding: 1.6% 2.4%; font-size: .8rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.ghost-bar span:first-child { font-family: var(--font-display); font-weight: 800; }
.ghost-bar span:last-child { color: var(--muted); font-weight: 500; }
.ghost-body {
  display: grid; height: 88%; padding: 2.2%; gap: 2.2%;
  grid-template-columns: 10% 1fr 1fr 1fr;
  grid-template-rows: 26% 1fr;
}
.ghost-side { grid-row: 1 / span 2; background: var(--graphite); border-radius: 10px; padding: 14px 10px; display: grid; align-content: start; gap: 10px; }
.ghost-side i { height: 10px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.ghost-side i:first-child { background: var(--mint); }
.ghost-stat, .ghost-main, .ghost-aside { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ghost-stat small, .ghost-main small, .ghost-aside small { font-size: .74rem; color: var(--muted); font-weight: 600; }
.ghost-stat b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.ghost-main { grid-column: 2 / span 2; }
.ghost-main i, .ghost-aside i { height: 12px; border-radius: 4px; background: var(--porcelain-2); }
.ghost-main i:nth-child(2) { width: 80%; } .ghost-main i:nth-child(4) { width: 60%; }

/* =========================================================
   Light sections
   ========================================================= */
.section { padding: var(--section-y) 0; position: relative; z-index: 2; background: var(--porcelain); }
.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-head--left { margin-left: 0; text-align: left; }
.section-head p:not(.eyebrow), .section-lead { color: var(--muted); font-size: 1.1rem; }

/* Line mask reveal for section headings */
.mask { overflow: hidden; padding-bottom: .08em; }
.mask > span { display: inline-block; }
.js .mask[data-reveal] > span { transform: translateY(105%); transition: transform 700ms var(--ease); }
.js .mask[data-reveal].is-in > span { transform: none; }
.js [data-reveal]:not(.mask) { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-section) var(--ease), transform var(--dur-section) var(--ease); }
.js [data-reveal]:not(.mask).is-in { opacity: 1; transform: none; }
.js [data-stagger] > * { transition-delay: calc(var(--i, 0) * 60ms); }

/* ---------- Product preview ---------- */
.preview { padding-top: calc(var(--section-y) * .8); }
.demo {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.demo-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--porcelain);
}
.demo-badge { font-size: .78rem; font-weight: 600; color: var(--teal-dark); background: var(--teal-soft); padding: 4px 10px; border-radius: 999px; }
.demo-context { font-size: .9rem; color: var(--muted); flex: 1; }
.demo-reset { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 500; cursor: pointer; min-height: 36px; }
.demo-reset:hover { border-color: var(--teal); color: var(--teal); }

.demo-tabs { position: relative; display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.demo-tabs [role="tab"] {
  position: relative; background: none; border: 0; cursor: pointer; white-space: nowrap;
  padding: 12px 16px 14px; font-weight: 600; font-size: .95rem; color: var(--muted); min-height: 44px;
  transition: color var(--dur-fast) var(--ease);
}
.demo-tabs [role="tab"]:hover { color: var(--graphite); }
.demo-tabs [role="tab"][aria-selected="true"] { color: var(--teal-dark); }
.demo-indicator { position: absolute; left: 0; bottom: -1px; height: 3px; background: var(--teal); border-radius: 3px 3px 0 0; transition: transform var(--dur-panel) var(--ease), width var(--dur-panel) var(--ease); }

.demo-panel { padding: 24px 20px; min-height: 460px; outline-offset: -3px; }
.demo-nojs { color: var(--muted); }
.js .demo.is-ready .demo-nojs { display: none; }
.demo-live { min-height: 1.6em; margin: 0; padding: 0 20px; font-size: .92rem; color: var(--teal-dark); font-weight: 500; }
.demo-note { margin: 0; padding: 10px 20px 18px; font-size: .82rem; color: var(--muted); }

.dv h4 { font-family: var(--font-body); font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.dv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dv-span { grid-column: 1 / -1; }
.dv-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; background: #fff; }
.dv-foot { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }
.dv-line { margin: 0 0 12px; font-size: .95rem; }
.dv-ok { margin: 0; color: var(--teal-dark); font-weight: 600; font-size: .92rem; }
.dv-big { margin: 0 0 8px; font-size: 1.1rem; }
.dv-hello { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 16px; }
.dv-hello h4 { font-family: var(--font-display); font-size: 1.4rem; text-transform: none; letter-spacing: -.01em; color: var(--graphite); margin: 0; }
.dv-hello p { margin: 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: #fff; }
.kpi-label { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi strong { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .95rem; color: var(--muted); font-weight: 600; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 36px 1fr 56px; align-items: center; gap: 12px; font-size: .9rem; }
.bar-label { font-weight: 600; }
.bar-track { height: 12px; border-radius: 6px; background: var(--porcelain-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 6px; background: #8FB9B4; transition: width 700ms var(--ease); }
.bar-row.is-focus .bar-fill { background: var(--teal); }
.bar-row.is-focus .bar-label::after { content: " ●"; color: var(--teal); font-size: .6rem; vertical-align: middle; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.tasks { display: grid; }
.tasks li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.tasks li:first-child { border-top: 0; padding-top: 0; }
.tasks b { font-variant-numeric: tabular-nums; }
.tasks b.ok { color: var(--teal-dark); }

.dv-teacher { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.dv-stack { display: grid; gap: 16px; align-content: start; }
.dv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.counts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.roster { max-height: 360px; overflow-y: auto; border-top: 1px solid var(--line); margin: 0 -18px -18px; padding: 0 18px; }
.roster-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.roster-row.is-focus { background: linear-gradient(90deg, var(--teal-soft), transparent); margin: 0 -18px; padding: 8px 18px; }
.roster-name { font-size: .93rem; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg-btn { background: #fff; border: 0; border-left: 1px solid var(--line); padding: 0 12px; min-height: 36px; font-size: .82rem; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg-btn:first-child { border-left: 0; }
.seg-btn:hover { background: var(--porcelain); }
.seg-btn[aria-pressed="true"].seg-btn--present { background: var(--teal); color: #fff; }
.seg-btn[aria-pressed="true"].seg-btn--late { background: var(--amber); color: #3a2606; }
.seg-btn[aria-pressed="true"].seg-btn--absent { background: var(--graphite); color: #fff; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status--present { background: var(--teal-soft); color: var(--teal-dark); }
.status--late { background: #FBEBD3; color: var(--amber-ink); }
.status--absent { background: #E7E9EA; color: var(--graphite); }
.status--open { background: var(--porcelain-2); color: var(--muted); }

.schedule li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.schedule li:first-child { border-top: 0; padding-top: 0; }
.schedule time { font-variant-numeric: tabular-nums; color: var(--muted); }
.schedule small { color: var(--muted); }
.grades li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.grades li:first-child { border-top: 0; padding-top: 0; }
.g-title { font-weight: 600; font-size: .95rem; }
.g-grade { font-family: var(--font-display); font-size: 1.2rem; grid-row: span 2; align-self: center; }
.g-fb { color: var(--muted); font-size: .88rem; }
.notes li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; font-size: .92rem; }
.notes li:first-child { border-top: 0; padding-top: 0; }
.notes span { color: var(--muted); }

/* ---------- Features: editorial grid ---------- */
.fgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.fcard {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 20px;
  transition: border-color var(--dur-panel) var(--ease), box-shadow var(--dur-panel) var(--ease), transform var(--dur-panel) var(--ease);
}
.fcard:hover, .fcard:focus-within { border-color: rgba(11, 116, 109, .35); box-shadow: var(--shadow-md); }
.fcard--lg:first-child { grid-column: span 7; }
.fcard--lg:nth-child(2) { grid-column: span 5; }
.fcard--md { grid-column: span 6; }
.fcard--wide { grid-column: span 8; flex-direction: row; align-items: center; }
.fcard--wide .fcard-copy { flex: 0 0 38%; }
.fcard--wide .fdemo { flex: 1; }
.fcard--narrow { grid-column: span 4; }
.fcard-copy p { color: var(--muted); margin: 0; }
.fdemo { margin-top: 0; }

.day-picker, .ann-picker, .metric-picker, .stepper { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.day-picker button, .ann-picker button, .metric-picker button, .stepper button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.day-picker button:hover, .ann-picker button:hover, .metric-picker button:hover, .stepper button:hover { border-color: var(--teal); color: var(--teal-dark); }
.day-picker button[aria-pressed="true"], .ann-picker button[aria-pressed="true"],
.metric-picker button[aria-pressed="true"], .stepper button[aria-pressed="true"] { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.metric-picker { margin: 18px 0 0; }

.periods { display: grid; gap: 8px; min-height: 236px; }
.period { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); }
.period-n { font-weight: 700; color: var(--teal-dark); font-size: .85rem; }
.period-s { display: flex; flex-direction: column; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.period-s small { font-weight: 400; color: var(--muted); }

.assess { display: grid; gap: 10px; margin-bottom: 16px; }
.assess li { display: grid; grid-template-columns: 1fr 44px 90px 30px; align-items: center; gap: 10px; font-size: .92rem; }
.assess .w { color: var(--muted); font-variant-numeric: tabular-nums; }
.assess b { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--porcelain-2); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.report { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 16px; background: #fff; }
.report-k { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.report-grade { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; }
.report-grade b { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.report-grade span { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-c { margin: 0; font-size: .92rem; }

.stepper button { position: relative; }
.stepper button.is-done { color: var(--teal-dark); border-color: var(--teal); }
.stepper button.is-done::before { content: "✓ "; }
.stage-card { padding: 16px 18px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); min-height: 86px; }
.stage-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.stage-card .sc-k { color: var(--graphite); font-weight: 600; margin-bottom: 4px; }

.fdemo--split { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: end; }
.ann-picker { flex-direction: column; align-items: stretch; margin: 0; }
.phone { border-radius: 26px; background: var(--graphite); padding: 10px; max-width: 260px; justify-self: end; width: 100%; }
.phone-screen { background: #fff; border-radius: 18px; padding: 16px; min-height: 140px; }
.phone-from { font-size: .72rem; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.phone-title { font-weight: 700; margin: 0 0 4px; font-family: var(--font-display); }
.phone-body { font-size: .88rem; color: var(--muted); margin: 0; }
.phone-note { color: rgba(255, 255, 255, .7); font-size: .74rem; text-align: center; margin: 8px 0 2px; }

.chart { margin: 0; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dots circle { fill: var(--paper); stroke: var(--teal); stroke-width: 2; }
.chart figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }

.integ { width: 100%; height: auto; }
.integ-line { fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-dasharray: 160; stroke-dashoffset: 0; }
.js .fcard:not(.is-in) .integ-line { stroke-dashoffset: 160; }
.integ-line { transition: stroke-dashoffset 1100ms var(--ease) 200ms; }
.integ-hub { fill: var(--graphite); }
.integ-hub-t { fill: #fff; font: 600 9px var(--font-body); }
.integ-node rect { fill: #fff; stroke: var(--line-strong); }
.integ-node text { fill: var(--graphite); font: 500 9.5px var(--font-body); }

.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.module { padding: clamp(22px, 2.4vw, 32px); border-radius: var(--r-lg); border: 1px solid var(--line); background: transparent; }
.module-tag { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; padding: 3px 10px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-dark); margin-bottom: 12px; }
.module-tag--lms { background: #FBEBD3; color: var(--amber-ink); }
.checks { display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' fill='none' stroke='%230B746D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ---------- Security ---------- */
.security { background: var(--porcelain-2); }
.security-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.security .checks { margin-top: 24px; }
.layers { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.layers figcaption { font-weight: 600; margin-bottom: 14px; }
.layers table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 460px; }
.layers th, .layers td { text-align: left; padding: 11px 10px; border-top: 1px solid var(--line); }
.layers thead th { border-top: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.layers tbody th { font-weight: 600; }
.layers td::before { display: inline-block; width: 1.2em; font-weight: 700; }
.layers td.y::before { content: "●"; color: var(--teal); font-size: .7em; }
.layers td.o::before { content: "◐"; color: var(--teal); }
.layers td.n { color: var(--muted); }
.layers td.n::before { content: "–"; }
.layers-note { font-size: .82rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- Onboarding timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; position: relative; padding-top: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: 28px; height: 2px; background: var(--teal);
  transform-origin: left; transform: scaleX(1);
}
.js .timeline:not(.is-in)::before { transform: scaleX(0); }
.js .timeline::before { transition: transform 1200ms var(--ease); }
.timeline li { position: relative; }
.js .timeline > li { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); transition-delay: calc(200ms + var(--i, 0) * 220ms); }
.js .timeline.is-in > li { opacity: 1; transform: none; }
.js .timeline[data-reveal] { opacity: 1; transform: none; }
.tl-dot { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--porcelain); border: 2px solid var(--teal); color: var(--teal-dark); font-weight: 700; margin-bottom: 18px; position: relative; z-index: 1; }
.timeline p { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { background: var(--porcelain); }
details { border-top: 1px solid var(--line-strong); }
details:last-of-type { border-bottom: 1px solid var(--line-strong); }
summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; min-height: 44px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(var(--teal), var(--teal)) center/14px 2px no-repeat, linear-gradient(var(--teal), var(--teal)) center/2px 14px no-repeat;
  transition: transform var(--dur-panel) var(--ease);
}
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); padding: 0 4px 22px; margin: 0; max-width: 64ch; }

/* ---------- CTA ---------- */
.cta { position: relative; z-index: 2; background: var(--ink); color: var(--on-ink); padding: var(--section-y) 0; overflow: hidden; }
.cta-motif { position: absolute; left: max(0px, calc((100vw - var(--maxw)) / 2)); bottom: -6px; width: min(620px, 46vw); opacity: .55; pointer-events: none; }
@media (max-width: 1023px) { .cta-motif { display: none; } }
.cta-motif .m-base { stroke: rgba(131, 232, 206, .35); stroke-width: 1.5; }
.cta-motif .m-arch { fill: none; stroke: var(--mint); stroke-width: 2.5; stroke-linecap: round; }
.cta-motif .m-b { fill: rgba(234, 242, 240, .08); stroke: rgba(234, 242, 240, .25); }
.cta-motif .m-path { fill: none; stroke: var(--mint); stroke-opacity: .6; stroke-width: 1.5; stroke-dasharray: 3 6; }
.cta-grid { position: relative; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.cta h2 { font-size: clamp(2.2rem, 4.2vw, 3.8rem); font-weight: 800; color: #fff; }
.cta-copy p:not(.eyebrow) { color: var(--on-ink-muted); font-size: 1.1rem; }

.demo-form { background: var(--paper); color: var(--graphite); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow-ink); display: grid; gap: 4px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: #fff; font: inherit; color: inherit;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 1.3em; margin: 4px 0 6px; font-size: .82rem; color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 12px 0 0; font-size: .92rem; min-height: 1.4em; }
.form-status[data-kind="info"] { color: var(--amber-ink); background: #FBEBD3; padding: 10px 12px; border-radius: 10px; }
.form-status[data-kind="error"] { color: var(--danger); }
.form-status[data-kind="ok"] { color: var(--teal-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--porcelain); padding: 56px 0 28px; position: relative; z-index: 2; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-h { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.footer-grid nav a { display: block; color: var(--graphite); margin-bottom: 8px; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .nav-links { gap: 18px; }
  .fcard--wide { grid-column: span 12; }
  .fcard--narrow { grid-column: span 12; flex-direction: row; align-items: center; }
  .fcard--narrow .fcard-copy { flex: 1; }
  .fcard--narrow .integ { flex: 0 0 280px; }
}

@media (max-width: 1023px) {
  .hero { padding: calc(var(--header-h) + 40px) 0 56px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy, .stage { grid-column: 1; }
  .stage { margin-top: 36px; }
  .stage-sample { position: relative; top: auto; right: auto; margin-top: 4px; }
  .fcard--lg:first-child, .fcard--lg:nth-child(2), .fcard--md { grid-column: span 12; }
  .security-grid, .cta-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dv-teacher { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); color: var(--on-ink); padding: 8px var(--gutter) 20px; border-bottom: 1px solid var(--line-ink);
  }
  .site-header.is-light .nav-links { background: var(--porcelain); color: var(--graphite); border-bottom-color: var(--line); }
  .nav-links.is-open { display: flex; }
  .nav-links > a:not(.btn) { padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); min-height: 44px; }
  .motion-toggle { align-self: flex-start; margin-top: 14px; }
  .nav-links .btn { margin-top: 14px; }
}

@media (max-width: 760px) {
  .story-steps { grid-template-columns: 1fr; }
  .dv-grid { grid-template-columns: 1fr; }
  .fcard--wide, .fcard--narrow { flex-direction: column; align-items: stretch; }
  .fcard--narrow .integ { flex: none; }
  .fdemo--split { grid-template-columns: 1fr; }
  .ann-picker { flex-direction: row; }
  .phone { justify-self: stretch; max-width: none; }
  .modules { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 24px; padding-left: 0; }
  .timeline::before { left: 20px; right: auto; top: 20px; bottom: 20px; width: 2px; height: auto; transform-origin: top; }
  .js .timeline:not(.is-in)::before { transform: scaleY(0); }
  .timeline li { padding-left: 62px; }
  .tl-dot { position: absolute; left: 0; top: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .assess li { grid-template-columns: 1fr 40px 64px 28px; }
  .demo-panel { padding: 18px 14px; }
  .demo-top { padding: 12px 14px; }
  .demo-context { flex-basis: 100%; order: 3; font-size: .85rem; }
  .demo-tabs { padding: 6px 8px 0; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 2.65rem; }
  .kpi strong { font-size: 1.4rem; }
  .roster-row { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Motion off (OS setting or the header toggle)
   ========================================================= */
.motion-off { scroll-behavior: auto; }
.motion-off *, .motion-off *::before, .motion-off *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}
.motion-off .btn:hover { transform: none; }
