/* Flowrensic landing page
   A lens over a flow line. Light theme only, per DESIGN.md.
   Tokens first, then layout primitives, then sections in document order. */

:root {
  /* The four colors. Everything else is one of these at an opacity. */
  --white: #FFFFFF;
  --ink: #111827;
  --blue: #2563EB;
  --gray: #E5E7EB;

  /* --muted is 5.3:1 on white, for body text. --faint is 3.4:1, large text only. */
  --muted: rgba(17, 24, 39, 0.64);
  --faint: rgba(17, 24, 39, 0.5);
  --on-ink: #FFFFFF;
  --on-blue: #FFFFFF;
  --rail: rgba(255, 255, 255, 0.45);
  --tick-off: rgba(255, 255, 255, 0.5);

  --shell: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --border: 3px;
  --radius: 18px;
  --shadow: 6px 6px 0 var(--ink);

  --sans: Inter, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Lens position. main.js overwrites it; this is event 7, the signal. */
  --lens: 31.2%;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--blue); }
a:focus-visible,
input:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

code, .mono { font-family: var(--mono); }
.accent { color: var(--blue); }

.u-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Masthead --- */

.masthead {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-mark { display: block; }

.brand-name {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-name sup { font-size: 10px; font-weight: 500; margin-left: 2px; }

.tagline {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Hero --- */

.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(32px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 32px 64px;
}

.hero-title {
  margin: 0;
  flex: 999 1 640px;
  font-size: clamp(56px, 10vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.hero-lede {
  margin: 0;
  flex: 1 1 280px;
  max-width: 360px;
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Exhibit: the lens over the flow line --- */

.exhibit {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  border: var(--border) solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--ink);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--on-ink);
}

.panel-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-status { margin: 0; font-size: 13px; }

.status-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
}

.strip {
  position: relative;
  height: 340px;
  background: var(--blue);
  overflow: hidden;
  touch-action: pan-y;
  cursor: crosshair;
}

.rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--rail);
}

.rail--lens { background: var(--gray); }

/* Even spacing: 21 ticks, centres landing exactly on 3% and 97%. */
.ticks {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0 calc(3% - 2px);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* The tick is the bar. Its label and number hang off its own ends, so each
   one clears its own tick instead of sitting at a fixed height and running
   through the tall ones. */
.tick {
  position: relative;
  width: 4px;
  height: var(--h);
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--tick-off);
}

.tick--run { --h: 110px; }
.tick--sig { --h: 90px; }
.tick--act { --h: 60px; }
.tick--wft { --h: 28px; }

.tick--evidence { background: var(--white); }

.ticks--lens .tick { background: var(--ink); }
.ticks--lens .tick--evidence { background: var(--blue); }

.tick-label,
.tick-num {
  position: absolute;
  left: 50%;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 400;
}

.tick-label {
  bottom: calc(100% + 8px);
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  font-size: 11px;
  line-height: 14px;
}

.tick-num {
  top: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
}

.tick--evidence .tick-label { color: var(--blue); font-weight: 700; }

/* The lens: a white disc punched through the blue strip. */
.lens-view {
  position: absolute;
  inset: 0;
  background: var(--white);
  clip-path: circle(min(150px, 30vw) at var(--lens) 50%);
}

.lens-ring,
.lens-grip {
  position: absolute;
  top: 50%;
  left: var(--lens);
  pointer-events: none;
}

.lens-ring {
  width: min(300px, 60vw);
  height: min(300px, 60vw);
  transform: translate(-50%, -50%);
  border: 8px solid var(--ink);
  border-radius: 50%;
}

.lens-grip {
  width: 80px;
  height: 14px;
  background: var(--ink);
  border-radius: 7px;
  transform-origin: 0 50%;
  transform: translate(min(102px, 20vw), min(102px, 20vw)) rotate(45deg);
}

.panel-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 16px 20px;
  border-top: var(--border) solid var(--ink);
  background: var(--white);
}

.control-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lens-range {
  flex: 1 1 240px;
  min-height: 44px;
  accent-color: var(--ink);
}

.panel-read {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 22px;
  min-height: 104px;
  border-top: var(--border) solid var(--ink);
  background: var(--white);
}

.panel-read[data-evidence] { background: var(--gray); }

.read-id { margin: 0; font-size: 14px; font-weight: 600; }
.read-note { margin: 0; font-size: 18px; line-height: 1.5; max-width: 820px; }

.exhibit-caption { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* --- Sections --- */

.section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 128px) var(--gutter) clamp(56px, 7vw, 88px);
}

.section--engines { padding-top: 0; padding-bottom: clamp(64px, 8vw, 104px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 48px;
  padding-bottom: 32px;
}

.section-title {
  margin: 0;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.section-note { margin: 0; font-size: 17px; color: var(--muted); }

/* --- Cards --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.card-num {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--blue);
}

.card-title {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.card-text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }

.card--blue { background: var(--blue); color: var(--on-blue); }
.card--blue .card-num { color: var(--on-blue); }
.card--blue .card-text { color: var(--on-blue); }

.card--gray { background: var(--gray); }

.card--ink {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 6px 6px 0 var(--blue);
}

.card--ink .card-num { color: var(--on-ink); }
.card--ink .card-text { color: var(--gray); }

/* --- Engines --- */

.engines {
  margin: 0;
  max-width: 1160px;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--faint);
}

.engine-lead {
  padding: 0 8px;
  border-radius: 8px;
  background: var(--gray);
  color: var(--ink);
}

.legal {
  margin: 28px 0 0;
  max-width: 680px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* --- Footer --- */

.site-footer { border-top: var(--border) solid var(--ink); }

.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px var(--gutter) 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  font-size: 14px;
  font-weight: 500;
}

.footer-mark { margin: 0; }
.footer-mark sup { font-size: 8px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }

.footer-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

/* --- Motion --- */

.wiggle {
  animation: frwig 3.2s ease-in-out infinite;
  transform-origin: 50% 60%;
}

@keyframes frwig {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-8deg); }
  90% { transform: rotate(6deg); }
  95% { transform: rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wiggle { animation: none; }
  html { scroll-behavior: auto; }
}

html { scroll-behavior: smooth; }
