/* The case page, in the home's world: the same paper, type and buttons, and
   a handful of parts of its own. Every case is built from the same five:
   the bar, the opening with its manifest, the plate, the chapters, and the
   way out (the next box, then the back wall). */

:root {
  --bg: #ecebe6; --ink: #111111; --ink-2: #2a2a28; --ink-dim: #6b6a66; --line: #cfccc2;
  --green: #127a12; --green-deep: #033003; --green-pale: #cfe9bd;
  --accent: #ef5a1c; --alt: #dcd7ca;
  --inset: clamp(16px, 1.9vw, 36px); --rule: 2px; --measure: 1180px;
  --font-display: 'Young Serif', Georgia, serif;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-print: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --fs-h1: clamp(42px, 6.4vw, 96px);
  --fs-lead: clamp(18px, 1.5vw, 22px);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--green-pale); color: var(--ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: var(--rule) solid currentColor; outline-offset: 3px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.mono {
  font-family: var(--font-mono); font-weight: 500; font-size: clamp(11px, 0.78vw, 13px);
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
}
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; }
.in { max-width: var(--measure); margin: 0 auto; }

/* ── The bar: the home's own top edge ─────────────────────────────────── */
.bar { padding: var(--inset); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; }
.id { display: grid; gap: 6px; }
.wordmark { font-family: var(--font-display); font-size: clamp(17px, 1.3vw, 23px); letter-spacing: -0.01em; line-height: 1; }
.id__role { opacity: 0.6; }
.links { display: flex; gap: clamp(14px, 2.6vw, 50px); }
.links a { padding-bottom: 6px; border-bottom: var(--rule) solid transparent; }
.links a[aria-current] { border-bottom-color: currentColor; }
@media (hover: hover) { .links a:hover { border-bottom-color: currentColor; } }

/* ── Buttons, the home's ─────────────────────────────────────────────── */
.cta {
  --at: 215deg; --lit: 0.38; --mx: 30%; --my: 0px;
  --body: #f6f5f0; --word: var(--ink); --edge: 17, 17, 17; --rest: 0.2; --shine: 239, 90, 28;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 0.7em;
  min-height: 48px; padding: 0 1.7em; border: 0; border-radius: 14px; background: var(--body); color: var(--word);
  line-height: 1; cursor: pointer; box-shadow: 0 14px 22px -16px rgba(17, 17, 17, 0.55);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
@property --at { syntax: '<angle>'; inherits: true; initial-value: 215deg; }
@keyframes orbit { to { --at: 575deg; } }
@media (hover: none), (pointer: coarse) { .cta { --lit: 0.7; animation: orbit 7s linear infinite; } .cta::after { display: none; } }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background:
    conic-gradient(from calc(var(--at) - 72deg), rgba(var(--shine), 0) 0deg, rgba(var(--shine), var(--lit)) 72deg, rgba(var(--shine), 0) 144deg, rgba(var(--shine), 0) 360deg),
    linear-gradient(rgba(var(--edge), var(--rest)), rgba(var(--edge), var(--rest)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.cta::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: radial-gradient(140px circle at var(--mx) var(--my), rgba(var(--shine), calc(var(--lit) * 0.2)), transparent 70%); }
.cta > span { transition: transform 0.15s ease; }
.cta:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.cta:active { transform: translateY(1px) scale(0.985); }
.cta--main { --body: #141414; --word: var(--bg); --edge: 255, 255, 255; --rest: 0.16; --shine: 255, 232, 208; }
@media (hover: hover) { .cta:hover > span { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .cta { animation: none; transition: none; } .cta > span { transition: none; } }

/* ── The opening ─────────────────────────────────────────────────────── */
.open { padding: clamp(40px, 7vw, 110px) var(--inset) clamp(36px, 5vw, 64px); }
.open h1 { font-size: var(--fs-h1); max-width: 13ch; }
.lede { margin-top: clamp(20px, 2.4vw, 30px); font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-2); max-width: 44ch; }
.open .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* The manifest: what a box carries, written on the box. The facts of the
   case in one row, under the story and never above it. */
.manifest {
  display: flex;
  margin-top: clamp(32px, 4vw, 52px); border-top: var(--rule) solid var(--ink); border-bottom: 1px solid var(--line);
}
/* As many fields as the case has facts for: none is made up to fill a row. */
.manifest > div { flex: 1 1 0; padding: 14px 18px 16px; border-left: 1px solid var(--line); min-width: 0; }
.manifest > .wide { flex-grow: 2; }
.manifest > div:first-child { padding-left: 0; border-left: 0; }
.manifest dt { color: var(--ink-dim); }
.manifest dd { margin-top: 8px; font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.state { display: inline-flex; align-items: center; gap: 8px; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.state--live::before { background: var(--green); }
.state--wip::before { border: 1.5px solid var(--ink); }
@media (max-width: 859px) {
  .manifest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manifest > div { padding: 14px 14px 16px 0; border-left: 0; border-top: 1px solid var(--line); }
  .manifest > div:nth-child(-n + 2) { border-top: 0; }
  .manifest > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  /* div.wide outranks the even-child rule above, which gave it a left rule. */
  .manifest > div.wide { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
  /* A field left alone on its row before the wide one takes the row. */
  .manifest > div:nth-child(odd):has(+ .wide) { grid-column: 1 / -1; }
}

/* ── The plate: the first picture, the whole measure ─────────────────── */
.plate { padding: 0 var(--inset) clamp(56px, 8vw, 120px); }
.plate__frame { border-radius: 10px; overflow: hidden; background: var(--plate, #111); padding: var(--plate-pad, 0); }
.plate__frame > * { margin: 0 auto; border-radius: 6px; }
.plate figcaption, .shot figcaption { margin-top: 12px; font-size: 14.5px; line-height: 1.45; color: var(--ink-dim); max-width: 62ch; }

/* ── A chapter: its heading in the left column, its story in the right,
   as the home's index is laid out ─────────────────────────────────────── */
.chapter { padding: 0 var(--inset) clamp(64px, 9vw, 140px); }
.chapter > .in {
  display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: 18px clamp(28px, 4vw, 72px);
  padding-top: 22px; border-top: 1px solid var(--ink);
}
.chapter h2 { font-size: clamp(28px, 3vw, 46px); max-width: 14ch; align-self: start; position: sticky; top: 24px; }
.body { display: grid; gap: 28px; align-content: start; min-width: 0; }
.body > p { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink-2); max-width: 44ch; }
.body > p a { border-bottom: 1px solid currentColor; }
@media (max-width: 859px) {
  .chapter > .in { grid-template-columns: minmax(0, 1fr); }
  .chapter h2 { position: static; max-width: none; }
}
/* A long Swedish compound on a phone: broken where the language allows,
   never run off the edge. */
@media (max-width: 600px) {
  .open h1, .chapter h2, .box__word { hyphens: auto; overflow-wrap: break-word; }
}

.shot img, .shot video { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.shot--photo img { border: 0; }
.pair { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 20px; align-items: center; max-width: 40em; }
.pair img { width: 100%; }
.pair p { font-family: var(--font-display); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.25; text-wrap: balance; }

/* The tally: one number, printed the way the containers are. */
.tally { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 4px clamp(18px, 2.4vw, 32px); }
.tally__n { font-family: var(--font-print); font-weight: 800; font-size: clamp(120px, 17vw, 260px); line-height: 0.78; letter-spacing: -0.04em; }
.tally__l { font-family: var(--font-display); font-size: clamp(22px, 2.3vw, 34px); line-height: 1.15; max-width: 14ch; padding-bottom: 0.2em; text-wrap: balance; }
.tally__note { grid-column: 1 / -1; margin-top: 18px; font-size: 14.5px; color: var(--ink-dim); max-width: 60ch; }

/* The fork: one thing comes in, and the ways it can go branch off it. Fewer
   words than a list, and the shape says what the words would. */
.fork { --gap: 28px; display: flex; align-items: center; max-width: 46em; }
.fork__from {
  position: relative; flex: none; max-width: 10em; padding: 14px 18px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-family: var(--font-display); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.2;
}
.fork__from::after { content: ""; position: absolute; top: 50%; left: 100%; width: var(--gap); border-top: 1.5px solid var(--ink); }
.fork__to { flex: 1; min-width: 0; display: grid; gap: 12px; margin-left: var(--gap); padding-left: var(--gap); }
.fork__to li {
  position: relative; display: grid; gap: 4px; padding: 12px 16px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
/* The spine, a stretch per row, and the stub that joins each row to it. */
.fork__to li::before { content: ""; position: absolute; left: calc(var(--gap) * -1 - 1px); top: -7px; bottom: -7px; border-left: 1.5px solid var(--ink); }
.fork__to li:first-child::before { top: 50%; }
.fork__to li:last-child::before { bottom: 50%; }
.fork__to li::after { content: ""; position: absolute; left: calc(var(--gap) * -1); top: 50%; width: var(--gap); border-top: 1.5px solid var(--ink); }
.fork__if { color: var(--ink-dim); }
.fork__then { font-family: var(--font-display); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.2; }
@media (max-width: 600px) {
  .fork { --gap: 20px; flex-direction: column; align-items: stretch; }
  .fork__from { max-width: none; }
  .fork__from::after { top: 100%; left: 18px; width: 0; height: 14px; border-top: 0; border-left: 1.5px solid var(--ink); }
  .fork__to { margin: 14px 0 0 18px; }
  .fork__to li:first-child::before { top: -15px; }
}

/* The ledger: what happens to a line, one case to a row. */
.ledger { border-top: var(--rule) solid var(--ink); max-width: 44em; }
.ledger li { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 6px 24px; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.ledger b { font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.15; }
.ledger span { font-size: 17px; line-height: 1.4; color: var(--ink-2); padding-top: 3px; }
@media (max-width: 520px) { .ledger li { grid-template-columns: minmax(0, 1fr); } }

/* ── The way out: the next box, then the back wall ─────────────────────── */
.next { padding: 0 var(--inset) clamp(56px, 7vw, 110px); }
.next .in { display: grid; gap: 16px; }
.next__all { justify-self: start; padding-bottom: 6px; border-bottom: var(--rule) solid currentColor; }
.box {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: clamp(150px, 20vw, 280px); padding: 0 clamp(30px, 4.6vw, 76px); color: var(--ink); border-radius: 3px;
  background:
    linear-gradient(rgba(17, 17, 17, 0.2), rgba(17, 17, 17, 0.2)) top / 100% 11px no-repeat,
    linear-gradient(rgba(17, 17, 17, 0.2), rgba(17, 17, 17, 0.2)) bottom / 100% 15px no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.13) 0 3px, transparent 3px 12px, rgba(255, 255, 255, 0.12) 12px 15px, transparent 15px 24px),
    var(--paint, var(--alt));
  box-shadow: 0 22px 34px -22px rgba(17, 17, 17, 0.5);
  transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1), box-shadow 0.3s ease;
}
.box::before, .box::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: clamp(12px, 1.5vw, 20px);
  background: linear-gradient(#111 0 16px, transparent 16px calc(100% - 20px), #111 calc(100% - 20px)), #2a2a28;
}
.box::before { left: 0; border-radius: 3px 0 0 3px; }
.box::after { right: 0; border-radius: 0 3px 3px 0; }
.box__word, .box__go { font-family: var(--font-print); font-weight: 800; text-transform: uppercase; font-size: clamp(30px, 6.4vw, 104px); line-height: 0.9; letter-spacing: -0.015em; }
.box__word { min-width: 0; text-wrap: balance; padding: 26px 0 54px; }
@media (max-width: 600px) { .box__word, .box__go { font-size: clamp(24px, 7.2vw, 40px); } }
.box__go { transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1); }
.box__note { position: absolute; left: clamp(30px, 4.6vw, 76px); right: clamp(30px, 4.6vw, 76px); bottom: clamp(22px, 2.4vw, 34px); }
.box:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
@media (hover: hover) {
  .box:hover { transform: translate(6px, -3px) rotate(-0.35deg); box-shadow: 0 34px 44px -26px rgba(17, 17, 17, 0.55); }
  .box:hover .box__go { transform: translateX(0.18em); }
}
@media (prefers-reduced-motion: reduce) { .box, .box__go { transition: none; } }

.wall { background: var(--ink); color: var(--bg); padding: clamp(72px, 10vw, 150px) var(--inset) clamp(48px, 6vw, 90px); }
.wall .in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: end; }
.wall h2 { font-size: clamp(38px, 5.2vw, 76px); }
.wall-lede { margin-top: 22px; font-size: var(--fs-lead); line-height: 1.45; opacity: 0.8; max-width: 30ch; }
.ways { border-top: var(--rule) solid currentColor; }
.way { border-bottom: 1px solid rgba(236, 235, 230, 0.3); }
.way__go { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 16px; padding: 20px 0; }
button.way__go { all: unset; box-sizing: border-box; width: 100%; cursor: copy; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 16px; padding: 20px 0; }
.way__k { grid-column: 1 / -1; opacity: 0.6; display: flex; align-items: center; gap: 10px; }
.way__tag { padding: 3px 7px 2px; border-radius: 4px; background: var(--green-pale); color: var(--ink); }
.way__done:not(:empty) { padding: 3px 7px 2px; border-radius: 4px; background: var(--bg); color: var(--ink); }
.way-v { font-family: var(--font-display); font-size: clamp(22px, 2.3vw, 34px); letter-spacing: -0.015em; line-height: 1.1; overflow-wrap: anywhere; }
@media (max-width: 420px) { .way--first .way-v { font-size: clamp(20px, 6.2vw, 26px); } }
.way-arr { font-family: var(--font-mono); font-size: clamp(16px, 1.4vw, 22px); }
button.way__go .way-arr { font-size: 12px; padding: 6px 10px; border: 1px solid rgba(236, 235, 230, 0.45); border-radius: 6px; }
.way__go:focus-visible { outline: 2px solid var(--green-pale); outline-offset: 4px; }
.foot { background: var(--ink); color: var(--bg); padding: 0 var(--inset) clamp(28px, 3vw, 44px); }
.foot .in { padding-top: 28px; border-top: 1px solid rgba(236, 235, 230, 0.3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }
@media (max-width: 859px) { .wall .in { grid-template-columns: minmax(0, 1fr); } }

/* ── Why: the claim stands, the reasoning waits behind a press ────────────
   A native disclosure, so it works without a script and with a keyboard.
   The cue is a small press with a plus that turns into a cross; what opens
   is the reasoning, in full ink, on a green rule. */
.why { max-width: 44em; interpolate-size: allow-keywords; }
.why > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
  transition: border-color 0.2s ease;
}
.why > summary::-webkit-details-marker { display: none; }
.why > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.why__sign { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1); }
.why__sign::before, .why__sign::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: var(--bg); translate: -50% -50%; }
.why__sign::after { rotate: 90deg; }
.why[open] .why__sign { transform: rotate(45deg); }
.why__on { display: none; }
.why[open] .why__on { display: inline; }
.why[open] .why__off { display: none; }
.why__said { margin-top: 16px; padding: 2px 0 2px 18px; border-left: 2px solid var(--green); display: grid; gap: 12px; }
.why__said p, .why__said li { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink); max-width: 44ch; }
.why__said ul, .why__said ol { display: grid; gap: 8px; }
.why::details-content { block-size: 0; overflow: clip; transition: block-size 0.35s cubic-bezier(0.2, 0.6, 0.2, 1), content-visibility 0.35s allow-discrete; }
.why[open]::details-content { block-size: auto; }
@media (hover: hover) { .why > summary:hover { border-color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .why::details-content, .why__sign { transition: none; } }

/* A way off the site: the pale button with the way out on its own key, an
   orange tile at its end holding a heavy arrow up and out. Nothing inside
   the site wears it, so the arrow alone says where a press goes. */
.cta--out { padding-right: 0; gap: 0.9em; }
.cta__out {
  align-self: stretch; display: grid; place-items: center; width: 40px; margin: 5px 5px 5px 0;
  border-radius: 10px; background: var(--accent); color: #111;
}
.cta__out svg { width: 22px; height: 22px; transition: transform 0.18s ease; }
.cta.cta--out > .cta__out { transform: none; }
@media (hover: hover) { .cta--out:hover .cta__out svg { transform: translate(2px, -2px); } }
@media (prefers-reduced-motion: reduce) { .cta__out svg { transition: none; } }

/* ── The picture first, on a phone ────────────────────────────────────────
   The headline, then the plate, then the story and the facts: opened on a
   phone, no case shows a screen of words before it shows itself. The order is
   visual only, so a page still reads the same without its styles. */
@media (max-width: 859px) {
  main { display: flex; flex-direction: column; }
  main > * { order: 5; min-width: 0; }
  .open, .open > .in { display: contents; }
  .open > .in > * { margin-left: var(--inset); margin-right: var(--inset); }
  .open > .in > h1 { order: 0; margin: 10px var(--inset) 20px; font-size: clamp(36px, 10.4vw, 64px); }
  main > .plate { order: 1; padding-bottom: 0; }
  .open > .in > .lede { order: 2; margin: 22px var(--inset) 0; }
  .open > .in > .manifest { order: 3; margin: 28px var(--inset) 0; }
  .open > .in > .manifest:last-child { margin-bottom: 64px; }
  .open > .in > .acts { order: 4; margin: 24px var(--inset) 64px; }
  /* A plate that is the product itself, a screen or more tall, waits for the
     one paragraph that says what it is. */
  main > .plate--long { order: 2; padding-top: 22px; }
  .open:has(+ .plate--long) > .in > .lede { order: 1; margin-top: 0; }
}

/* ── Kin: the things that came out of one case, each a row with its picture ── */
.kin { border-top: var(--rule) solid var(--ink); max-width: 48em; }
.kin li { border-bottom: 1px solid var(--line); }
.kin a { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(14px, 2vw, 28px); align-items: center; padding: 18px 0; }
.kin__pic { display: block; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #151515; }
.kin__pic > img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.kin__hands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6%; width: 76%; height: 100%; margin: 0 auto; align-items: center; }
.kin__say { display: grid; gap: 6px; min-width: 0; }
.kin__name { font-family: var(--font-display); font-size: clamp(20px, 2vw, 30px); line-height: 1.1; overflow-wrap: break-word; transition: color 0.18s ease; }
.kin__line { line-height: 1.4; color: var(--ink-2); }
.kin__proof { margin-top: 2px; color: var(--green); }
.kin a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (hover: hover) { .kin a:hover .kin__pic { border-color: var(--ink); } .kin a:hover .kin__name { color: var(--green-deep); } }
@media (max-width: 859px) { .kin a { padding: 14px 0; } .kin__line { font-size: 15px; } }
