/* AnalytiView temporary site · "Paper & Pencil" in three dimensions (design/DESIGN.md).
   Two lights, not two themes: daylight is the default, the lamp follows the visitor's system.
   Fonts are served from this site only. A local Palatino wins when the visitor has one; the
   Arabic face is fetched only for Arabic glyphs (unicode-range). No long dashes in any copy. */

@font-face { font-family: "AV Pagella"; src: url("/static/fonts/texgyrepagella-regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "AV Pagella"; src: url("/static/fonts/texgyrepagella-italic.otf") format("opentype");
  font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "AV Pagella"; src: url("/static/fonts/texgyrepagella-bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "AV Amiri"; src: url("/static/fonts/Amiri-Regular.ttf") format("truetype");
  font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "AV Amiri"; src: url("/static/fonts/Amiri-Bold.ttf") format("truetype");
  font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --paper: #F5F1E6; --paper-2: #EFEADC; --sheet: #FBF8F0; --sheet-edge: #E6DFCD;
  --graph: rgba(90, 80, 60, .055);
  --ink: #2B2A26; --ink-2: #5C584E; --ink-3: #8E897C;
  --pencil: #4A4740; --pencil-l: rgba(74, 71, 64, .42);
  --hl: rgba(240, 206, 122, .55); --hl-s: rgba(240, 206, 122, .30);
  --red: #B23A2E; --blue: #2F5D8C; --grn: #4A7A48;
  --rule: rgba(74, 71, 64, .20); --rule-2: rgba(74, 71, 64, .34);
  --shadow: 46, 38, 24;
  --sr: "Iowan Old Style", "Palatino Linotype", Palatino, "AV Pagella", "AV Amiri", Georgia, serif;
  --sa: "Segoe UI", system-ui, -apple-system, Roboto, "AV Amiri", sans-serif;
  --mo: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1916; --paper-2: #15140F; --sheet: #23211C; --sheet-edge: #2E2B25;
    --graph: rgba(255, 245, 220, .045);
    --ink: #EDE7D8; --ink-2: #B3AC9B; --ink-3: #7E786B;
    --pencil: #D8D2C2; --pencil-l: rgba(216, 210, 194, .40);
    --hl: rgba(226, 184, 92, .34); --hl-s: rgba(226, 184, 92, .18);
    --red: #D9695A; --blue: #7BA6D4; --grn: #7FB07C;
    --rule: rgba(216, 210, 194, .20); --rule-2: rgba(216, 210, 194, .32);
    --shadow: 0, 0, 0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sa);
  /* the engineering pad: a 26px grid, under a faint paper grain */
  background-image:
    linear-gradient(var(--graph) 1px, transparent 1px),
    linear-gradient(90deg, var(--graph) 1px, transparent 1px);
  background-size: 26px 26px;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .38;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .30  0 0 0 0 .22  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[dir="rtl"] body, [dir="rtl"] { font-family: var(--sa); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] .serif { font-family: "AV Amiri", var(--sr); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.serif { font-family: var(--sr); }
.mono { font-family: var(--mo); font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 10.5px/1.4 var(--mo); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 12.5px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the highlighter sweep: an angled stroke with uneven ends, never a filled box */
mark, .hl {
  color: inherit; padding: 0 .12em; margin: 0 -.04em;
  background: linear-gradient(101deg, transparent 0%, var(--hl) 5%, var(--hl) 94%, transparent 100%);
  border-radius: 2px 5px 3px 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* a hand-drawn rule: a wavering pencil line, not a border */
.rule {
  height: 10px; border: 0; margin: 34px 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='10' preserveAspectRatio='none'><path d='M1 5 C 60 3.2, 120 6.6, 200 4.6 S 330 3.4, 399 5.4' fill='none' stroke='%234A4740' stroke-opacity='.38' stroke-width='1.2' stroke-linecap='round'/></svg>") center / 100% 10px no-repeat;
}

/* ── the masthead ────────────────────────────────────────────────────────────────────── */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 6px; }
.brand { font: 400 25px/1 var(--sr); letter-spacing: .005em; text-decoration: none; white-space: nowrap; }
.brand i { color: #9C7A23; font-style: italic; }
@media (prefers-color-scheme: dark) { .brand i { color: #E2B85C; } }
.mast nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.linklike { background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--ink-2); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 4px; }
.linklike:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

/* ── the hero: words on the left, the 3D desk on the right ─────────────────────────────── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: center;
  padding: 26px 0 10px; min-height: 560px; }
.hero h1 { font: 400 clamp(34px, 4.6vw, 56px)/1.08 var(--sr); margin: 14px 0 18px; text-wrap: balance; letter-spacing: -.01em; }
[dir="rtl"] .hero h1 { line-height: 1.35; letter-spacing: 0; }
.hero .dek { font-size: 17.5px; color: var(--ink-2); max-width: 34em; margin: 0 0 26px; }
.desk { position: relative; aspect-ratio: 1 / .92; width: 100%; }
.desk canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.desk .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.desk[data-live="1"] .still { display: none; }

/* ── a sheet of paper, with real thickness: the 3D style in the page itself ────────────── */
.sheet {
  position: relative; background: var(--sheet); border-radius: 2px;
  box-shadow:
    0 1px 0 var(--sheet-edge), 0 2px 0 var(--sheet), 0 3px 0 var(--sheet-edge),   /* the sheets beneath */
    0 5px 0 var(--sheet), 0 6px 0 var(--sheet-edge),
    0 18px 30px -12px rgba(var(--shadow), .28), 0 40px 70px -30px rgba(var(--shadow), .30);
  transform: perspective(1400px) rotateX(1.4deg) rotate(var(--tilt, -.25deg));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s;
}
.sheet.tilt-r { transform: perspective(1400px) rotateX(1.2deg) rotate(.35deg); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .sheet:hover { transform: perspective(1400px) rotateX(0deg) translateY(-3px) rotate(0deg);
    box-shadow: 0 1px 0 var(--sheet-edge), 0 2px 0 var(--sheet), 0 3px 0 var(--sheet-edge),
      0 5px 0 var(--sheet), 0 6px 0 var(--sheet-edge),
      0 28px 40px -14px rgba(var(--shadow), .30), 0 60px 90px -36px rgba(var(--shadow), .32); }
}

/* ── the waitlist: a note on the desk ─────────────────────────────────────────────────── */
.note { padding: 20px 22px 18px; max-width: 520px; }
.note::after {                                   /* a strip of tape holding the note */
  content: ""; position: absolute; top: -11px; inset-inline-start: 38px; width: 92px; height: 22px;
  background: rgba(240, 206, 122, .42); transform: rotate(-4deg); border-radius: 1px;
  box-shadow: 0 1px 2px rgba(var(--shadow), .12);
}
.fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
.field { display: grid; gap: 4px; }
.field span { font: 600 10.5px/1.3 var(--mo); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
[dir="rtl"] .field span { letter-spacing: 0; font-size: 12.5px; }
.field input, .field textarea, .field select {
  width: 100%; font: 16px/1.4 var(--sa); color: var(--ink); background: transparent;
  border: 0; border-bottom: 1.5px dashed var(--rule-2); padding: 7px 2px; border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom: 1.5px solid var(--pencil); }
.field input::placeholder { color: var(--ink-3); opacity: .8; }
.trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.act {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font: 600 15.5px/1 var(--sa); color: var(--ink); background: none; border: 0; padding: 12px 16px 13px;
  background: linear-gradient(101deg, transparent 0%, var(--hl) 6%, var(--hl) 93%, transparent 100%);
  border-radius: 2px 6px 3px 7px; transform: rotate(-.6deg); transition: transform .2s, filter .2s;
}
.act:hover { transform: rotate(0) translateY(-1px); filter: saturate(1.25); }
.act[disabled] { opacity: .55; cursor: default; }
.act svg { width: 18px; height: 18px; }
[dir="rtl"] .act svg { transform: scaleX(-1); }
.small { font-size: 13.5px; color: var(--ink-3); margin: 12px 0 0; }
.status { min-height: 1.6em; font-size: 15px; margin: 10px 0 0; }
.status.ok { color: var(--grn); font-family: var(--sr); font-style: italic; font-size: 17px; }
.status.bad { color: var(--red); }

/* ── the plate: the video on its own sheet ─────────────────────────────────────────────── */
.plate { padding: 18px 18px 14px; margin: 18px auto 0; max-width: 960px; }
.plate video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--paper-2); border-radius: 1px; }
.caption { display: flex; gap: 10px; align-items: baseline; margin: 10px 4px 0; color: var(--ink-2);
  font: italic 15px/1.5 var(--sr); }
.caption .eyebrow { font-style: normal; flex: none; }
.marg { color: var(--red); font: italic 15.5px/1.5 var(--sr); }

/* ── the features: each on its own small sheet, with a pencil sketch of what it shows ───── */
.section-title { font: 400 clamp(26px, 3vw, 36px)/1.2 var(--sr); margin: 0 0 6px; text-wrap: balance; }
[dir="rtl"] .section-title { line-height: 1.55; margin-top: 6px; }
.features { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.features li { padding: 18px 20px 20px; }
.lede { color: var(--ink-2); font-size: 16px; margin: 4px 0 0; max-width: 40em; }
.more-line { margin-top: 24px; font: italic 17px/1.5 var(--sr); }
[dir="rtl"] .more-line { font-family: var(--sa); font-style: normal; font-size: 16px; }
.features li:nth-child(3n+2) { --tilt: .3deg; }
.features li:nth-child(3n) { --tilt: -.1deg; }
.features h3, .trust h3 { font: 400 21px/1.25 var(--sr); margin: 0 0 6px; text-wrap: balance; }
[dir="rtl"] .features h3, [dir="rtl"] .trust h3 { font-family: "AV Amiri", var(--sr); font-size: 22px; line-height: 1.45; }
.features p, .trust p { margin: 0; color: var(--ink-2); font-size: 15px; }
.sk { display: block; width: 120px; height: 64px; margin: 0 0 12px; fill: none; stroke: var(--pencil);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sk .r { stroke: var(--red); }
.sk .f { fill: var(--pencil); stroke: none; }
.sk .r.f { fill: var(--red); }
.sk .d { stroke: var(--pencil-l); stroke-dasharray: 2 3; }
.sk .m { stroke: var(--hl); stroke-width: 8; }
[dir="rtl"] .sk { transform: scaleX(-1); }          /* a sketch reads the way the page does */

/* ── why the numbers hold: three notes, each under a red pencil tick ─────────────────────── */
.trust { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.trust li { position: relative; padding-top: 16px; }
.trust li::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 64%; height: 8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='8' preserveAspectRatio='none'><path d='M1 4 C 50 2.6, 120 5.6, 199 3.6' fill='none' stroke='%23B23A2E' stroke-opacity='.7' stroke-width='1.4' stroke-linecap='round'/></svg>") 0 0 / 100% 8px no-repeat;
}

/* ── the figure ─────────────────────────────────────────────────────────────────────────── */
.figure { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 34px; align-items: end; padding: 28px 30px 26px; }
.figure .big { font: 400 clamp(54px, 8vw, 104px)/.95 var(--mo); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.figure .big mark { padding: 0 .06em; }
.figure .what { font: 400 clamp(20px, 2.3vw, 27px)/1.3 var(--sr); margin: 0 0 6px; }
.figure .more { color: var(--ink-2); margin: 0; max-width: 32em; }
[dir="rtl"] .figure .what { font-family: "AV Amiri", var(--sr); }

.closing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0; }
.closing p { font: 400 clamp(22px, 2.6vw, 30px)/1.3 var(--sr); margin: 0; }
[dir="rtl"] .closing p { font-family: "AV Amiri", var(--sr); }
[dir="rtl"] input[dir="ltr"] { text-align: right; }   /* an address reads left to right, sits on the right */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 26px 0 40px;
  font-size: 13.5px; color: var(--ink-3); }

section { margin: 56px 0; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; }
  .desk { max-width: 560px; margin: 0 auto; order: -1; aspect-ratio: 1 / .78; }
  .features, .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }   /* no lone card */
}
@media (max-width: 700px) {
  .features.three { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features, .trust { grid-template-columns: 1fr; gap: 22px; }
  .figure { grid-template-columns: 1fr; padding: 22px 20px; }
  .mast nav { gap: 12px; }
  .note { padding: 18px 16px 16px; }
  .plate { padding: 10px 10px 8px; }
  section { margin: 42px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── sign-in and the founder's page ────────────────────────────────────────────────────── */
.signin { max-width: 420px; margin: 60px auto 0; padding: 26px 24px 22px; }
.signin h1 { font: 400 30px/1.2 var(--sr); margin: 4px 0 18px; }
.signin [hidden], .twostep [hidden] { display: none; }
.twostep .steps { margin: 0 0 16px; padding-inline-start: 20px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.twostep .qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.twostep .qr canvas { max-width: 100%; height: auto; image-rendering: pixelated;
  border-radius: 4px; box-shadow: 0 1px 3px rgba(var(--shadow), .18); }
.twostep .key { display: inline-block; margin-top: 6px; font: 600 15px/1.4 var(--mo); letter-spacing: .06em;
  color: var(--ink); word-break: break-all; user-select: all; }
.twostep .fields { margin: 16px 0 14px; }
.twostep p { max-width: 62ch; }
.tabs { display: flex; gap: 22px; margin: 18px 0 8px; flex-wrap: wrap; }
.tabs.flush { margin: 0; }
.tabs button { background: none; border: 0; padding: 6px 4px; cursor: pointer; font: 15.5px/1.2 var(--sa); color: var(--ink-2); }
.tabs button[aria-selected="true"] { color: var(--ink);
  background: linear-gradient(101deg, transparent 0%, var(--hl) 6%, var(--hl) 93%, transparent 100%);
  border-radius: 2px 5px 3px 6px; }
.panel { padding: 22px 24px; margin-top: 10px; }
.panel[hidden] { display: none; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ledger th { text-align: start; font: 600 10.5px/1.3 var(--mo); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: 6px 10px 8px 0; border-bottom: 1px solid var(--rule-2); }
.ledger td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger tr.unread td { font-weight: 600; }
.ledger tr[data-uid] { cursor: pointer; }
.ledger tr[data-uid]:hover td { background: var(--hl-s); }
.scroll { overflow-x: auto; }
.chip { font: 600 11px/1 var(--mo); letter-spacing: .08em; text-transform: uppercase; }
.chip.ok { color: var(--grn); } .chip.warn { color: #A8842C; } .chip.bad, .chip.down { color: var(--red); }
.chip.unknown { color: var(--ink-3); }
.mailbody { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.6 var(--sa); margin: 14px 0 0;
  padding-top: 12px; border-top: 1px solid var(--rule); max-height: 60vh; overflow: auto; }
.meta { font-size: 13.5px; color: var(--ink-2); display: grid; gap: 2px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
textarea { min-height: 180px; resize: vertical; }

/* ── the Sessions tab: visits, replayed on a sheet ─────────────────────────────────────────
   The sheet tilts in 3D; the replay is a live document, so this panel lies flat. rrweb's core
   ships no stylesheet: without the wrapper rules its mouse-tail canvas pushes the replay frame
   out of the stage (platform frontend, index.css, the same rules). */
.sheet.sessions, .sheet.sessions:hover { transform: none; }
.ledger tr[data-id] { cursor: pointer; }
.ledger tr[data-id]:hover td, .ledger tr[data-id]:focus-visible td { background: var(--hl-s); }
.ss-head { font: 400 22px/1.3 var(--sr); margin: 0; }
.ss-head:focus { outline: none; }
.sessions .meta { margin: 6px 0 14px; }
.ss-stage { position: relative; width: 100%; max-height: 70vh; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
#ss-stage { position: absolute; inset: 0; }
.ss-stage-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px;
  text-align: center; color: var(--ink-2); font: italic 16px/1.5 var(--sr); pointer-events: none; }
.ss-stage-note:empty { display: none; }
.replayer-wrapper { position: relative; }
.replayer-wrapper > iframe { position: absolute; top: 0; left: 0; border: none; background: #fbf8f0; }
.replayer-mouse-tail { position: absolute; top: 0; left: 0; pointer-events: none; }
.replayer-mouse { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 2;
  border-radius: 50%; background: #B23A2E; box-shadow: 0 0 0 3px rgba(178, 58, 46, .22);
  transition: left .05s linear, top .05s linear; pointer-events: none; }
.replayer-mouse.active::after { content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1px solid #B23A2E; animation: ss-click .4s ease-out; }
@keyframes ss-click { from { transform: scale(.4); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.ss-deck { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0 4px; }
.ss-play { min-width: 76px; padding: 8px 14px; cursor: pointer; font: 600 14.5px/1 var(--sa); color: var(--ink);
  background: linear-gradient(101deg, transparent 0%, var(--hl) 6%, var(--hl) 93%, transparent 100%);
  border: 0; border-radius: 2px 6px 3px 7px; }
.ss-play[disabled] { opacity: .5; cursor: default; }
#ss-pos { flex: 1 1 220px; min-width: 0; accent-color: #B23A2E; }
.ss-clock { font-size: 13.5px; color: var(--ink-2); }
.ss-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.ss-opt select { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule-2);
  border-radius: 2px; padding: 2px 4px; }
.ss-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 18px; }
.ss-list { margin: 8px 0 0; padding-inline-start: 0; list-style: none; display: grid; gap: 6px; font-size: 14.5px; }
.ss-list li { overflow-wrap: anywhere; }
.ss-list .linklike { padding: 0 6px 0 0; font-size: 13.5px; }
.ss-gap { margin-top: 18px; }
.sessions #ss-analysis .ledger { margin-top: 8px; }
.sessions #ss-analysis .act { margin-top: 10px; }
@media (max-width: 760px) { .ss-cols { grid-template-columns: 1fr; } }
/* the still image is rendered from the live desk on a clear ground (hero3d.js #still) */
html.still-shot, html.still-shot body { background: transparent !important; }
html.still-shot body::before { display: none; }
