/* ─────────────────────────────────────────────────────────────
   Arcus — notes
   A page under a pile of engineer’s notebook sheets.
   main.js sets the theme colours, the scale (--s) and every sheet
   transform; this file only describes what things look like.
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: 'Figtree'; font-weight: 300 900; font-display: swap;
  src: url(fonts/Figtree-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-display: swap;
  src: local('Geist Mono'), url(fonts/GeistMono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 500; font-display: swap;
  src: url(fonts/Caveat-500-latin.ttf) format('truetype'); }

:root {
  --bg: #FFFFFF;                 /* page colour                        — set by the design panel */
  --fg: #000;                    /* primary foreground (by contrast)   — set by main.js */
  --fg2: rgb(126 135 137);       /* secondary, softer foreground       — set by main.js */
  --paper: #FFFCF8;
  --muted: #747474;
  --accent: #2546ad;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-gutter: 20px;
  --mobile-controls-clearance: 96px;
  --reading-gap: clamp(16px, 1.25vw, 24px);
  --group-gap: clamp(24px, 2vw, 32px);
  --tight: 1;                    /* 1 as designed; main.js closes the statement's gaps a little when a desktop window is short */
  --sans: 'Figtree', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hand: 'Caveat', cursive;
  --s: 1;              /* design scale: 1 at 1920px wide  — set by main.js */
  --ls: 1;             /* logo scale (never below 0.66)    — set by main.js */
  --lk: 1;             /* logo size multiplier              — set by the design panel */
  --hb: 92px;          /* header height (layout only)       — set by main.js */
  --hs: 54px; --bs: 24px; --gap: 43px;               /* type — set by main.js */
  --tx: 37px; --ty: 248px; --tw: 651px; --hw: 596px;  /* text column — set by main.js */
  --pw: 1296px; --ph: 837.75px;                       /* one sheet — set by main.js */
  --u: max(1px, calc(.55px + .6px * var(--s)));       /* instrument unit: 1px at 1440 wide, growing gently with the layout */
  --rule: 1px;                                        /* scale ticks: whole device pixels, about 1px — set by main.js */
}

html, body { margin: 0; color: var(--fg); }
html {
  background-color: var(--bg);
  overflow-x: clip; scroll-behavior: auto; scrollbar-gutter: stable;
}
body { overflow-x: clip; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
html { scrollbar-width: thin; scrollbar-color: #c9c8c2 transparent; }
* { -webkit-tap-highlight-color: transparent; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); color: var(--fg); }

/* ── header: a transparent foreground layer; only the logo and the links take pointer events ── */
.hdr { position: fixed; left: 0; top: 0; right: 0; z-index: 10; height: 0; overflow: visible; pointer-events: none; }
.logo {
  pointer-events: auto; position: absolute; display: block; color: var(--fg);
  left: calc(41.25px * var(--ls)); top: calc(38.57px * var(--ls) * var(--lk));
}
.logo:focus { outline: none; }
.logo:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; border-radius: 2px; }
.logo__wm { display: block; width: calc(106px * var(--ls) * var(--lk)); height: calc(31px * var(--ls) * var(--lk)); fill: currentColor; }
.logo__sym {
  position: absolute; fill: currentColor; transform: rotate(180deg);   /* the Figma node is rotated 180°; the export is not */
  left: calc(108.25px * var(--ls) * var(--lk)); top: calc(-14.07px * var(--ls) * var(--lk));
  width: calc(31.31px * var(--ls) * var(--lk)); height: calc(23.13px * var(--ls) * var(--lk));
}
[data-layout="integrated"] .logo { display: none; }         /* the symbol lives in the heading instead */

.nav { position: absolute; right: max(28px * var(--s), 16px); top: max(33px * var(--s), 20px); display: flex; gap: max(5px * var(--s), 4px); }
.nav__a {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; box-sizing: border-box;
  padding: max(8px * var(--s), 6px) max(9px * var(--s), 7px);
  border-radius: 2px; color: var(--fg); text-decoration: none; white-space: nowrap;
  font: 400 max(15px * var(--s), 14px)/1.3 var(--sans); letter-spacing: 0;
}
/* The label is plain ink on the bench. A halo in the page colour, invisible at rest, keeps it legible for the
   moment a turning sheet passes beneath it; there is no box to cut a hole in the grid or the paper. */
.nav__a {
  --h: var(--bg);
  text-shadow: 0 0 2px var(--h), 0 0 2px var(--h),
    3px 0 3px var(--h), -3px 0 3px var(--h), 0 3px 3px var(--h), 0 -3px 3px var(--h), 2px 2px 3px var(--h), -2px 2px 3px var(--h), 2px -2px 3px var(--h), -2px -2px 3px var(--h),
    7px 0 5px var(--h), -7px 0 5px var(--h), 0 7px 5px var(--h), 0 -7px 5px var(--h), 5px 5px 5px var(--h), -5px 5px 5px var(--h), 5px -5px 5px var(--h), -5px -5px 5px var(--h);
}
.compact .nav__a { background: var(--bg); text-shadow: none; }
.nav__a:hover { color: var(--accent); }
.nav__a:focus-visible { box-shadow: 0 0 0 1px var(--fg); }
.nav__a[aria-disabled="true"] { cursor: default; }

/* ── the pinned scene ── */
.scroller { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }


/* website copy: selectable text, sits under the sheets */
.text {
  position: absolute; z-index: 1;
  left: var(--tx); top: var(--ty); width: var(--tw);
  /* short desktop screens: the copy scrolls up as a solid, fully readable block */
}
.h1 { margin: 0; max-width: var(--hw); font-weight: 500; font-size: var(--hs); line-height: 1.12; letter-spacing: -.02em; color: var(--fg); }
.h1--int { display: none; }
[data-layout="integrated"] .h1--sep { display: none; }
[data-layout="integrated"] .h1--int { display: block; max-width: none; white-space: nowrap; font-size: min(var(--hs), calc(var(--tm, var(--tw)) / 13.7)); }   /* always two lines (break in the markup); the long line is ~13.3em, so it never overflows the column, which would be clipped by the column’s mask */
.compact .h1--int { font-size: min(var(--hs), 6.2vw); }   /* phones: shrink so both lines fit the width */
[data-layout="integrated"] .body { margin-top: calc((var(--gap) + 20px * var(--s)) * var(--tight)); }
.h1__brand { white-space: nowrap; color: var(--fg); text-decoration: none; }
.h1__brand:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; border-radius: 2px; }
.h1__sym { display: inline-block; width: 0.92em; height: 0.68em; margin-right: 0.16em; vertical-align: -0.02em; fill: currentColor; transform: rotate(180deg); }   /* same export as the header: rotated 180° so the arrow points up-right, sized to the cap height */
.h1__rest { color: var(--fg2); }
.body { margin-top: calc(var(--gap) * var(--tight)); font-weight: 400; font-size: var(--bs); line-height: 1.45; }
.body p { margin: 0; transition: opacity .25s cubic-bezier(.25, 1, .5, 1); }
html:not(.compact) .body p { text-wrap: pretty; }   /* desktop: no paragraph ends on a stranded word */
.body p:first-child { font-size: 1.1em; line-height: 1.4; font-weight: 500; }
.body p + p { margin-top: calc(var(--reading-gap) * var(--tight)); }
.body p[data-para="1"], .body p[data-para="4"], .body p[data-para="5"] { margin-top: calc(var(--group-gap) * var(--tight)); }
.body strong { color: var(--accent); font-weight: 500; }
html:not(.compact) .body strong { white-space: nowrap; }   /* the result is never split across two lines */
.evaluation-note { display: block; margin-top: 6px; color: var(--muted); font: 500 1.05em/1.15 var(--hand); transform: rotate(-1deg); transform-origin: left; }   /* a pencilled margin note: the notes’ hand, small and grey so it sits behind the result */

/* The reading: the evaluation sentence, plotted. A printed scale (hairline, ticks, mono numerals)
   with the result marked on it by hand, in the same ink as the notes. */
.reading {
  display: block; position: relative;
  width: 100%; width: round(down, 100%, 50px);          /* a whole number of pixels per tick, where round() exists */
  height: calc(30 * var(--u)); margin-top: calc(14 * var(--u));
  color: var(--muted); user-select: none; container-type: inline-size;
}
.no-reading .reading { display: none; }
@container (max-width: 380px) { .reading__n--end { display: none; } }   /* narrow columns: the circled 87 needs the room */
html:not(.no-reading) .reading + .evaluation-note { margin-top: calc(13 * var(--u)); }
.reading__scale { position: absolute; left: 0; top: calc(6 * var(--u)); width: 100%; height: calc(8 * var(--u)); overflow: visible; fill: none; stroke: currentColor; }
.reading__scale path { stroke-width: var(--rule); vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.reading__axis, .reading__major { opacity: .8; }
.reading__minor { opacity: .45; }
.reading__n { position: absolute; top: calc(17 * var(--u)); transform: translateX(-50%); font: 400 calc(11 * var(--u))/1 var(--mono); font-variant-numeric: tabular-nums; }
.reading__n--start { left: 0; transform: none; }
.reading__n--from { left: 33%; }
.reading__n--to { left: 87%; color: var(--fg); }
.reading__n--end { left: 100%; transform: translateX(-100%); }

/* ink on the scale: a ring where it started, a stroke to where it got to, and that number circled */
.ink { position: absolute; overflow: visible; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ink--rise { left: calc(33% + 5 * var(--u)); width: calc(54% - 5 * var(--u)); top: calc(-2 * var(--u)); height: calc(16 * var(--u)); }
.ink--rise path { vector-effect: non-scaling-stroke; }
.ink--head { left: 87%; top: calc(6 * var(--u)); width: calc(14 * var(--u)); height: calc(14 * var(--u)); margin: calc(-7 * var(--u)) 0 0 calc(-9 * var(--u)); }
.ink--from { left: 33%; top: calc(6 * var(--u)); width: calc(12 * var(--u)); height: calc(12 * var(--u)); margin: calc(-6 * var(--u)) 0 0 calc(-6 * var(--u)); }
.ink--from circle { fill: var(--bg); stroke: none; }
.ink--mark { left: 87%; top: calc(22.5 * var(--u)); width: calc(34 * var(--u)); height: calc(24 * var(--u)); margin: calc(-12 * var(--u)) 0 0 calc(-17 * var(--u)); stroke-width: 1.25; }

/* Arrival only: the result is marked once, as it would be by hand, and then the page is still. */
@keyframes ink-rise { from { clip-path: inset(-6px 100% -6px 0); } to { clip-path: inset(-6px -2px -6px 0); } }
@keyframes ink-draw { from { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
.ink--rise { animation: ink-rise 560ms cubic-bezier(.3, .1, .2, 1) 450ms both; }
.ink--head path, .ink--mark path { stroke-dasharray: 1; animation: ink-draw 140ms ease-out 990ms both; }
.ink--mark path { animation-duration: 380ms; animation-delay: 1180ms; }
@media (prefers-reduced-motion: reduce) { .ink--rise, .ink--head path, .ink--mark path { animation: none; } }
.contact-prompt { display: block; margin-bottom: 8px; color: inherit; text-decoration: none; }
.contact-prompt:hover { color: var(--accent); }
.contact-prompt:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.contact-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: inherit; font-weight: 500; text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color 120ms ease-out; }
.contact-link svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.25; }
.contact-link:hover { color: var(--accent); }
.contact-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; }
.ink-link { position: relative; }
.ink-link::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 7px; height: 1px; background: var(--accent); transform: rotate(-.8deg) scaleX(.3); transform-origin: left; opacity: 0; transition: transform 180ms ease-out, opacity 120ms ease-out; }
.ink-link:hover::after, .ink-link:focus-visible::after { opacity: 1; transform: rotate(-.8deg) scaleX(1); }

/* sheets: each one an independent transformed element, layered in DOM order (bottom first) */
.sheets { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sheet {
  position: absolute; left: 0; top: 0; margin: 0;
  width: var(--pw); height: var(--ph);
  transform-origin: 0 0;                 /* Figma rotates about the sheet’s top-left corner */
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(0, 24, 80, .32), 0 1px 2px rgba(0, 24, 80, .18);
  pointer-events: auto;
}
/* transparent looks (folded paper, metal plates): no paper backing, the shadow follows the silhouette */
[data-look="folded"] .sheet, [data-look="metal"] .sheet { background: none; box-shadow: none; filter: drop-shadow(0 6px 10px rgba(0, 24, 80, .32)); }
.compact[data-look="folded"] .sheet, .compact[data-look="metal"] .sheet { box-shadow: none; filter: drop-shadow(0 4px 8px rgba(0, 24, 80, .30)); }

/* shadow strength (design panel): off / minimal / medium; “current” keeps the values above */
[data-shadow="off"] .sheet { box-shadow: none !important; filter: none !important; }
[data-shadow="min"] .sheet { box-shadow: 0 2px 6px rgba(0, 24, 80, .16); }
[data-shadow="mid"] .sheet { box-shadow: 0 4px 12px rgba(0, 24, 80, .24), 0 1px 2px rgba(0, 24, 80, .14); }
[data-shadow="min"][data-look="folded"] .sheet, [data-shadow="min"][data-look="metal"] .sheet { box-shadow: none; filter: drop-shadow(0 2px 4px rgba(0, 24, 80, .18)); }
[data-shadow="mid"][data-look="folded"] .sheet, [data-shadow="mid"][data-look="metal"] .sheet { box-shadow: none; filter: drop-shadow(0 4px 7px rgba(0, 24, 80, .26)); }
.sheet picture { display: block; width: 100%; height: 100%; }
.sheet__img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
/* Each desktop sheet keeps its own layer, so a turn only moves a finished picture and never redraws the paper and its shadow. */
html:not(.compact) .sheet { will-change: transform; }
.notes-meta { margin: 0;
  position: absolute; z-index: 1; left: var(--nx); top: var(--ny); width: var(--nw);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; column-gap: 16px; row-gap: 0;
  color: var(--muted); font: 400 11px/1.5 var(--mono); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.notes-invitation { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; color: var(--accent); font: 500 23px/1.2 var(--hand); transform: rotate(-1.4deg); }
.notes-invitation svg { width: 34px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

/* touch / keyboard alternative to hover; on phones, the way back to the papers */
.reveal {
  display: none;
  position: fixed; left: 20px; bottom: 20px; z-index: 11;
  margin: 0; padding: 8px 12px; min-height: 44px; border: 0; border-radius: 2px;
  background: var(--bg); color: var(--accent);
  font: 500 22px/1.2 var(--hand); letter-spacing: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px;
  -webkit-appearance: none; appearance: none;
  opacity: 0; pointer-events: none;      /* hidden for fine pointers unless it has keyboard focus */
  transition: opacity .25s ease;
}
.reveal:focus-visible, .reveal.show { opacity: 1; pointer-events: auto; }
.reveal:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--fg); }
.reveal[aria-pressed="true"] { background: var(--bg); color: var(--accent); }

/* ── phones: the copy flows normally, pinned under a fixed paper layer for the first stretch ── */
.compact .hdr { position: absolute; }
.compact .nav { display: none; }
.compact .logo { left: var(--mobile-gutter); }
.compact .stage { position: sticky; top: 0; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; padding: calc(var(--hb) + 8px) var(--mobile-gutter) calc(var(--mobile-controls-clearance) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.compact[data-layout="integrated"] .stage { padding-top: var(--mobile-gutter); }
.compact .text { position: static; width: auto; padding-right: 14px; transform: none; cursor: default; }
.compact .h1 { max-width: none; }
/* phones: the statement alone, as one plain page. The working notes are a desktop feature. */
.compact .stage { position: relative; min-height: 0; padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
.compact .sheets, .compact .notes-meta, .compact .reveal { display: none; }
.compact .sheet:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

/* ── design debug panel ── */
.dbg-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: #17181B; color: #fff; font: 500 14px/1 var(--sans); cursor: pointer; opacity: .55;
  -webkit-appearance: none; appearance: none;
}
.dbg-toggle:hover, .dbg-toggle:focus-visible, .dbg-toggle[aria-expanded="true"] { opacity: 1; outline: none; }
.dbg-toggle:focus-visible { box-shadow: 0 0 0 2px #fff; }
.dbg {
  position: fixed; right: 16px; bottom: 64px; z-index: 30; width: min(300px, calc(100vw - 32px));
  padding: 12px 14px 14px; box-sizing: border-box; border-radius: 12px;
  background: #17181B; color: #fff; font: 400 12px/1.4 var(--mono);
  box-shadow: 0 12px 40px rgba(0,0,0,.35); overscroll-behavior: contain; max-height: calc(100vh - 90px); overflow: auto;
}
.dbg__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.dbg__row:first-child { border-top: 0; padding-top: 0; }
.dbg__head { justify-content: space-between; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.7); }
.dbg__label { width: 100%; color: rgba(255,255,255,.55); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.dbg__x { border: 0; background: transparent; color: #fff; font: 400 18px/1 var(--sans); cursor: pointer; padding: 0 2px; }
.dbg__swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.dbg__sw { width: 24px; height: 24px; border-radius: 999px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.dbg__sw[aria-pressed="true"] { border-color: #fff; }
.dbg__inline { display: flex; gap: 8px; align-items: center; width: 100%; }
.dbg__color { width: 36px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.dbg__hex { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: #0F1012; color: #fff; font: 400 12px/1 var(--mono); text-transform: uppercase; }
.dbg__seg { display: flex; gap: 4px; flex-wrap: wrap; }
.dbg__opt, .dbg__btn { padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; font: 400 12px/1 var(--mono); cursor: pointer; }
.dbg__opt[aria-checked="true"], .dbg__opt[aria-pressed="true"] { background: #fff; color: #17181B; border-color: #fff; }
.dbg__btn { width: 100%; }
.dbg__range { width: 100%; accent-color: #fff; }
#dbgLogoRow[hidden] { display: none; }

/* ── reduced motion: same layout, no tweened transitions ── */
.reduce .body p, .reduce .reveal, .reduce .ink-link::after { transition: none; }
.reduce .ink--rise, .reduce .ink--head path, .reduce .ink--mark path { animation: none; }

/* The filter definitions take no space. This used to be an inline style, which a strict content policy blocks. */
.svg-defs { position: absolute; }
