/* josephzakher.com: one stylesheet for every page.
   the look follows tutundzhian.com: one type size, ink and grey, a frosted pill at the top,
   a quiet centred column of words, and the work in grey plates with one clean image in the
   middle of each. tokens first (primitives, then roles), then the shared parts, then pages.
   breakpoints: sm 640, md 768, lg 1024, xl 1200. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  /* primitives */
  --white: #ffffff;
  --black: #000000;
  --gray-600: #6f6f6f;    /* text grey: 5.0:1 on white, 4.7:1 on the plate */
  --gray-500: #767676;    /* icon grey: 4.5:1 on white */
  --gray-100: #f7f7f7;    /* the plate: every card and image container */
  --gray-150: #f2f2f2;    /* the pill, quiet fills */
  --gray-200: #efefef;    /* lines */
  --red-600: #d30000;     /* the jz red until 27 Nov; now errors and review notes */
  --emerald-700: #047857; /* the brand since 27 Nov: the jz mark, the letter's signature, the cursor and every main button
                             (Joseph: orange to red, red to emerald green, "change logo color too") */

  /* roles */
  --background: var(--white);
  --foreground: var(--black);
  --muted-foreground: var(--gray-600);
  --icon: var(--gray-500);
  --plate: var(--gray-100);
  --card: var(--plate);
  --card-hover: color-mix(in srgb, var(--plate) 97%, var(--foreground));
  --muted: var(--gray-150);
  --border: var(--gray-200);
  --input: color-mix(in srgb, var(--foreground) 46%, var(--background));   /* 3.4:1 on white */
  --input-hover: color-mix(in srgb, var(--foreground) 60%, var(--background));
  --skeleton: var(--gray-200);
  --primary: var(--black);
  --primary-foreground: var(--white);
  --primary-hover: color-mix(in srgb, var(--primary) 84%, var(--background));
  --secondary: var(--muted);
  --secondary-foreground: var(--foreground);
  --secondary-hover: color-mix(in srgb, var(--muted) 92%, var(--foreground));
  --cta: var(--emerald-700);
  --cta-foreground: var(--white);   /* 5.5:1 on the emerald (black would be 3.8:1) */
  --cta-hover: color-mix(in srgb, var(--cta) 86%, var(--foreground));   /* darker: 6.9:1 (a lighter hover drops to 4.2:1) */
  --brand: var(--emerald-700);   /* the jz mark: 5.5:1 on white */
  --destructive: var(--red-600);
  --warning: var(--red-600);
  --ring: var(--foreground);

  /* radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;      /* a screen inside a plate */
  --radius-card: 26px;    /* plates and cards */
  --radius-dialog: 30px;  /* the menu */
  --radius-full: 9999px;  /* the pill, buttons, fields */

  /* motion */
  --duration-fast: 100ms;
  --duration-default: 150ms;
  --duration-moderate: 250ms;
  --duration-slow: 400ms;
  --duration-deliberate: 650ms;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* icons */
  --icon-sm: 16px;
  --icon-md: 20px;

  /* layout */
  --gutter: 26px;
  --text: 510px;          /* the column every page reads in, and the width of the pill */
  --plate-w: 860px;       /* the plates: two cards and their gap */
  --card-w: 420px;
  --gap: 20px;            /* between cards */
  --top: 200px;           /* the first line of a page */
  --section: 120px;       /* between sections */
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (max-width: 1199px) { :root { --card-w: 360px; } }
@media (max-width: 767px) { :root { --card-w: min(82vw, 300px); --gap: 16px; --top: 160px; --section: 96px; } }

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
h1, h2, h3 { font-size: inherit; font-weight: inherit; line-height: inherit; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  background: var(--background);
  color: var(--muted-foreground);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea { font: inherit; color: inherit; }
.col { width: min(100% - 2 * var(--gutter), var(--text)); margin: 0 auto; }
a { color: inherit; text-decoration: none; transition: color var(--duration-default) var(--ease); }
a:hover { color: var(--foreground); }
strong { color: var(--foreground); font-weight: 500; }
img, video { max-width: 100%; display: block; }

/* links inside running text: ink, underlined, as on tutundzhian.com */
main :is(p, dd, li) a:not([class]),
.hire a, .sub-note a, .tcard a, .lost a, .closing a, .footnote a, .idea-src a, .lt-link a, .more a, .doc .prose a {
  color: var(--foreground);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent);
  transition: text-decoration-color var(--duration-default) var(--ease);
}
main :is(p, dd, li) a:not([class]):hover,
.hire a:hover, .sub-note a:hover, .tcard a:hover, .lost a:hover, .closing a:hover, .footnote a:hover, .idea-src a:hover, .lt-link a:hover, .more a:hover, .doc .prose a:hover { text-decoration-color: currentColor; }
.sub-note a { color: inherit; }

/* keyboard focus: one ring everywhere, drawn outside the shape it surrounds */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
main:focus { outline: none; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 10000;
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px;
  background: var(--primary); color: var(--primary-foreground);
  border-radius: var(--radius-full);
  transform: translateY(-160%);
  transition: transform var(--duration-default) var(--ease);
}
.skip:focus, .skip:hover { transform: none; color: var(--primary-foreground); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- icons: lucide, stroke 2, 16px unless a component says otherwise ---------- */
.i {
  width: var(--icon-sm); height: var(--icon-sm); flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i-brand { fill: currentColor; stroke: none; }

/* ---------- buttons: one pill, three fills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-full);
  background: var(--primary); color: var(--primary-foreground);
  font-size: 15px; line-height: 22px; font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--duration-default) var(--ease), transform var(--duration-fast) var(--ease);
}
.btn:hover { background: var(--primary-hover); color: var(--primary-foreground); }
.btn:active { background: var(--primary); transform: scale(.98); }
.btn-ghost { background: var(--secondary); color: var(--secondary-foreground); }
.btn-ghost:hover { background: var(--secondary-hover); color: var(--secondary-foreground); }
.btn-ghost:active { background: var(--secondary-hover); }
.btn-cta { background: var(--cta); color: var(--cta-foreground); }
.btn-cta:hover { background: var(--cta-hover); color: var(--cta-foreground); }
.btn-cta:active { background: var(--cta); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; line-height: 20px; }

/* icon buttons: a 16px icon in a 40px circle, 44px on touch */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: var(--radius-full);
  background: var(--secondary); color: var(--secondary-foreground);
  transition: background-color var(--duration-default) var(--ease), opacity var(--duration-default) var(--ease), transform var(--duration-fast) var(--ease);
}
.icon-btn:hover { background: var(--secondary-hover); }
.icon-btn:active { transform: scale(.96); }
.icon-btn:disabled { opacity: .4; }
.icon-btn:disabled:hover { background: var(--secondary); }
.icon-btn:disabled:active { transform: none; }
.icon-btn--primary { background: var(--primary); color: var(--primary-foreground); }
.icon-btn--primary:hover { background: var(--primary-hover); }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }

/* ---------- custom cursor (script.js turns it on with html.has-cursor once a mouse moves) ---------- */
.has-cursor body, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor textarea, .has-cursor input { cursor: text; }
#cursor {
  opacity: 0;
  position: fixed; top: 0; left: 0;
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--brand) 40%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width var(--duration-default) var(--ease), height var(--duration-default) var(--ease), background-color var(--duration-default) var(--ease);
}
#cursor.hover { width: 36px; height: 36px; background: color-mix(in srgb, var(--brand) 16%, transparent); }
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }

/* ---------- the pill: frosted, at the top centre, on every page ---------- */
nav.pill {
  position: fixed; top: 30px; left: 50%; z-index: 100;
  transform: translateX(-50%);
  width: min(100% - 2 * var(--gutter), var(--text));   /* the column's width, so its edges line up with the words */
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  background: rgba(242, 242, 242, .75);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: .5px solid rgba(255, 255, 255, .65);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .07), inset 0 .5px 0 rgba(255, 255, 255, .95);
}
.pill-tab {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1 1 0; min-width: 0;
  height: 50px; padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--icon);
  transition: background-color var(--duration-slow) var(--ease), box-shadow var(--duration-slow) var(--ease), color var(--duration-default) var(--ease);
}
.pill-tab:hover { color: var(--foreground); }
.pill-tab[aria-current="page"], .pill-tab.is-current, .pill-tab[aria-expanded="true"] {
  background: rgba(255, 255, 255, .88); color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), inset 0 .5px 0 #fff;
}
.pill-jz span[aria-hidden] {
  font-family: "Caveat", cursive; font-size: 27px; line-height: 22px; font-weight: 600;
  color: var(--brand);
  transform: translateY(-1px);
}
/* the name of an icon tab, under it, for a pointer that rests or a key that lands */
.pill-tab::after {
  content: attr(data-tip);
  content: attr(data-tip) / "";
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translate(-50%, -4px);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--foreground); color: var(--background);
  font-size: 13px; line-height: 18px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-default) var(--ease), transform var(--duration-default) var(--ease);
}
@media (hover: hover) {
  .pill-tab:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 300ms; }
}
.pill-tab:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.pill-tab:focus-visible { outline-offset: 2px; }
/* a phone keeps work, apps, book, writing and services; story and contact wait in the menu,
   and the menu tab stands in for them when one of them is the page */
@media (max-width: 599px) {
  .pill-tab--wide { display: none; }
  .menu-btn.is-current-sm { background: rgba(255, 255, 255, .88); color: var(--foreground); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), inset 0 .5px 0 #fff; }
}


/* the menu: a white card over the blurred page, every page as a numbered row */
dialog.menu {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 24px 16px;
  border: 0; background: transparent;
  color: var(--muted-foreground);
}
dialog.menu[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
dialog.menu::backdrop {
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
dialog.menu[open] .menu-card { animation: menu-in var(--duration-moderate) var(--ease); }
dialog.menu[open]::backdrop { animation: fade-in var(--duration-moderate) var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.menu-card {
  width: min(100%, 410px);
  max-height: calc(100dvh - 140px);
  overflow-y: auto; scrollbar-width: none;
  padding: 40px 30px;
  display: flex; flex-direction: column; gap: 42px;
  background: var(--background);
  border-radius: var(--radius-dialog);
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .05);
}
.menu-card::-webkit-scrollbar { display: none; }
.menu-sec { display: flex; flex-direction: column; gap: 16px; }
.menu-sec p a { color: var(--muted-foreground); }
.menu-sec p a:hover { color: var(--foreground); }
.menu-k { color: var(--foreground); }
.menu-rows { list-style: none; border-top: 1px solid var(--border); margin-top: -2px; }
.menu-rows li { border-bottom: 1px solid var(--border); }
.menu-rows a {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px;
  color: var(--foreground);
}
.menu-rows a:hover, .menu-rows a[aria-current="page"] { color: var(--muted-foreground); }
.menu-n { color: inherit; }
.menu-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; flex: 0 0 auto;
  border: .5px solid rgba(255, 255, 255, .65); border-radius: var(--radius-full);
  background: rgba(226, 226, 226, .8);
  color: var(--foreground);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .07);
  transition: background-color var(--duration-default) var(--ease), transform var(--duration-fast) var(--ease);
}
.menu-close:hover { background: rgba(214, 214, 214, .9); }
.menu-close:active { transform: scale(.96); }
html:has(dialog.menu[open]) { overflow: hidden; }

/* ---------- page heads: a few lines, ink then grey, at the one size ---------- */
.ph, .hero, .book-hero { padding-top: var(--top); }
.ph-title, .h-title { color: var(--foreground); text-wrap: balance; }
.ph-lede { color: var(--muted-foreground); text-wrap: pretty; }
.ph-lede a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); }
.ph-kicker { color: var(--muted-foreground); margin-bottom: 22px; }

/* ---------- home: a short letter of an intro, then the rails ---------- */
.hero { padding-top: 226px; }
@media (max-width: 767px) { .hero { padding-top: 168px; } }
.hero-photo {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--plate);
  margin-bottom: 26px;
}
.hero .ph-lede, .hero .promise { margin-top: 22px; }
.promise { color: var(--muted-foreground); text-wrap: pretty; }
.hero-sub { margin-top: 32px; }

/* ---------- sections ---------- */
main section { margin-top: var(--section); }
.label { color: var(--foreground); }
.label + p, .label + .rows, .label + .list, .label + .disclosure, .label + .prose, .label + .doors, .label + .now-list,
.label + .particulars, .label + .inside, .label + .roles, .label + .bio, .label + .quote, .label + .arch-list { margin-top: 22px; }

/* ---------- rails: a row of cards that runs off the right edge ---------- */
.sec-rail { margin-top: 160px; }
.sec-rail + .sec-rail { margin-top: var(--section); }
@media (max-width: 767px) { .sec-rail { margin-top: 120px; } }
.rail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 40px;
  margin-bottom: 16px;
}
.rail-nav { display: flex; gap: 8px; }
/* a section's label with its way onward on the same line, on the right, in grey (home: in the press) */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sec-more { color: var(--muted-foreground); text-decoration: none; transition: color var(--duration-default) var(--ease); }
.sec-more:hover { color: var(--foreground); }
.rail-wrap {
  position: relative;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-left: max(var(--gutter), (100% - var(--text)) / 2);
}
.rail-wrap::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) { .rail-wrap { cursor: grab; } .rail-wrap.is-dragging { cursor: grabbing; scroll-snap-type: none; } }
.rail {
  display: flex; gap: var(--gap);
  width: max-content;
  list-style: none;
  padding: 8px max(var(--gutter), (100% - var(--text)) / 2) 16px;
}
.rail > li { scroll-snap-align: start; flex: 0 0 auto; }
.rail-wrap.is-dragging a { pointer-events: none; }

/* ---------- cards: the grey plate, the work in its centre, two lines under it ---------- */
.card { display: flex; flex-direction: column; width: var(--card-w); -webkit-tap-highlight-color: transparent; }
.card .cover {
  position: relative;
  width: 100%; aspect-ratio: 420 / 460;
  background: var(--plate);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.card .cover img.shot {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
  -webkit-user-drag: none; user-select: none;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover .cover img.shot { transform: scale(1.025); }
}
.card .cap { display: flex; flex-direction: column; margin-top: 16px; }
.card-name { color: var(--foreground); }
.card .meta, .card-line { color: var(--muted-foreground); }

/* things of joseph's own: the book as an object, each app as its icon */
.cover--thing { display: flex; align-items: center; justify-content: center; }
.thing-icon {
  width: 120px; height: 120px;
  border-radius: 27px;   /* the app icon corner */
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 16px 32px -14px rgba(0, 0, 0, .22);
}
.thing-icon--pixel { image-rendering: pixelated; }   /* 120px is 2x its 60px master, 240 and 360 are 4x and 6x */
.thing-book { display: flex; }
.card:hover .b3d-cover, .card:focus-visible .b3d-cover { transform: rotateY(-28deg); }
@media (max-width: 767px) { .thing-icon { width: 96px; height: 96px; border-radius: 22px; } }

/* ---------- clients and the press: every logo one grey mark ---------- */
.client-wall {
  /* two columns in the text column. a logo is --lu times its --k wide (tools/site.py CLIENTS);
     the widest is 4.58 --lu, so --lu shrinks before it would outgrow its column */
  --lu: min(36px, (100cqi - 16px) / 9.16);
  container-type: inline-size;
  list-style: none; margin-top: 32px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: start; align-items: center; gap: 32px 16px;
}
/* the press: one line from the column's left edge, running past the column where the page has room.
   --row is the line's width in --lu (tools/site.py press_wall: each logo's k, and one --lu between two),
   so --lu stays 36px as on the clients wall and shrinks only where the line would reach the page's gutter */
section:has(> .col > .press-wall) { container-type: inline-size; }   /* 100cqi: the page's width */
.press-wall {
  --room: calc((100cqi + min(100cqi - 2 * var(--gutter), var(--text))) / 2 - var(--gutter));
  --lu: min(36px, var(--room) / var(--row));
  list-style: none; margin-top: 32px;
  display: flex; align-items: center; gap: var(--lu); width: max-content;
}
.press-wall > li { flex: none; }
.client, .press-logo { display: flex; align-items: center; min-height: 44px; }
.client img, .press-logo img {
  display: block; width: calc(var(--lu) * var(--k)); max-width: 100%; height: auto;
  opacity: var(--o);   /* black marks drawn grey: dense ones lighter, thin ones darker */
  transition: opacity var(--duration-moderate) var(--ease);
}
a.client:hover img, a.client:focus-visible img,
.press-logo:hover img, .press-logo:focus-visible img { opacity: min(1, calc(var(--o) + .4)); }
.press-wall + .posts { margin-top: 32px; }   /* on the book page and /press, the articles under their logos */
@media (max-width: 599px) {
  .client-wall { --lu: min(32px, (100cqi - 16px) / 9.16); margin-top: 28px; gap: 28px var(--gap); }
  .press-wall { margin-top: 28px; }
  .press-wall + .posts { margin-top: 28px; }
}

/* ---------- home: the book and the apps, each in its own section ---------- */
.home-book .label + .card, .home-apps .sec-head + .app-grid { margin-top: 22px; }
.card--book { width: auto; }
.book-plate { cursor: pointer; }
.home-book .b3d { width: 168px; height: 260px; }
.home-book .card + p { margin-top: 22px; }
.home-book .more { margin-top: 16px; }
.app-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap); }
.app-grid .card { width: auto; }
@media (max-width: 767px) {
  .home-book .b3d { width: 120px; height: 185px; }
  .app-grid .thing-icon { width: 72px; height: 72px; border-radius: 17px; }
}

/* ---------- the letter: a disclosure on the plate, opened by click (and by a resting pointer) ---------- */
.letter {
  background: var(--plate);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.lt-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  width: 100%;
  padding: 32px;
  background: none; border: none; border-radius: var(--radius-card);
  text-align: left;
  font-size: 15px; line-height: 22px; font-weight: 500;
  color: var(--muted-foreground);
}
.lt-head:focus-visible { outline-offset: -4px; }
.lt-eyebrow { color: var(--muted-foreground); }
.lt-tease { color: var(--foreground); }
.lt-open {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 22px;
  color: var(--muted-foreground);
  transition: color var(--duration-default) var(--ease);
}
.lt-open .i { transition: transform var(--duration-slow) var(--ease); }
.letter:hover .lt-open, .letter.open .lt-open { color: var(--foreground); }
.letter.open .lt-open .i { transform: rotate(180deg); }
.lt-body {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--duration-slow) var(--ease), visibility 0s linear var(--duration-slow);
}
.lt-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 32px;
  color: var(--muted-foreground);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-moderate) var(--ease), transform var(--duration-slow) var(--ease);
}
.lt-inner p + p { margin-top: 22px; }
.lt-sign { color: var(--foreground); margin-top: 22px; }
.lt-link { margin-top: 16px; padding-bottom: 32px; }
.letter.open .lt-body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--duration-slow) var(--ease), visibility 0s; }
.letter.open .lt-inner { opacity: 1; transform: none; }
@media (hover: hover) {
  .letter:not(.open):hover .lt-body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--duration-slow) var(--ease) var(--duration-moderate), visibility 0s var(--duration-moderate); }
  .letter:not(.open):hover .lt-inner { opacity: 1; transform: none; transition-delay: var(--duration-moderate); }
}
@media (max-width: 639px) { .lt-head { padding: 24px; } .lt-inner { padding: 0 24px; } .lt-link { padding-bottom: 24px; } }

/* ---------- lists: rows between hairlines ---------- */
.list { list-style: none; }
.posts { border-top: 1px solid var(--border); }
.posts li { border-bottom: 1px solid var(--border); }
.post { display: flex; flex-direction: column; padding: 14px 0; }
.post .when { color: var(--muted-foreground); }
.post-body { display: flex; flex-direction: column; }
.post-title { color: var(--foreground); transition: color var(--duration-default) var(--ease); }
.post:hover .post-title { color: var(--muted-foreground); }
.post .gist { color: var(--muted-foreground); }
.home #writing .posts { margin-top: 22px; }

.now-list { display: flex; flex-direction: column; }
.now-row { display: flex; flex-direction: column; padding: 14px 0; border-top: 1px solid var(--border); }
.now-row:last-child { border-bottom: 1px solid var(--border); }
.now-row dt { color: var(--foreground); }
.now-row dd { color: var(--muted-foreground); }
.now-row dd p + p { margin-top: 12px; }

.particulars { display: flex; flex-direction: column; gap: 32px; }
.part { display: flex; flex-direction: column; }
.part dt { color: var(--foreground); }
.part dd { color: var(--muted-foreground); }
.part dd p + p { margin-top: 12px; }

.disclosure { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.disclosure + .disclosure { border-top: 0; }
.disclosure summary {
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 0; align-items: center;
  min-height: 46px; padding: 12px 0;
  list-style: none; color: var(--foreground); cursor: pointer;
}
.disclosure summary > :not(.i) { grid-column: 1; }
.disclosure summary .i { grid-column: 2; grid-row: 1; color: var(--icon); transition: transform var(--duration-moderate) var(--ease); }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure[open] summary .i { transform: rotate(180deg); }
.disclosure summary:hover .i { color: var(--foreground); }
.disc-hint { color: var(--muted-foreground); }
.disclosure > :not(summary) { padding-bottom: 24px; }
.disclosure .particulars { margin-top: 8px; }
.faq-a p { color: var(--muted-foreground); }
.faq-a p + p { margin-top: 12px; }

/* ---------- shared page parts ---------- */
.more { margin-top: 22px; }
.closing { margin-top: 40px; color: var(--muted-foreground); }
.updated, .footnote { margin-top: 32px; color: var(--muted-foreground); }
.footnote { margin-top: 12px; }
.prose p { color: var(--muted-foreground); }
.prose p + p { margin-top: 22px; }
.cta-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.doc section { margin-top: 96px; }
.doc .ph + section { margin-top: 72px; }
@media (max-width: 767px) { .doc section { margin-top: 72px; } .doc .ph + section { margin-top: 56px; } }
.case section p + p { margin-top: 22px; }

/* the plate as a panel for words: the newsletter, feature cards, the book's parts */
.subscribe, .tcard, .inside-card, .app-card {
  background: var(--plate);
  border-radius: var(--radius-card);
  padding: 32px;
}
@media (max-width: 639px) { .subscribe, .tcard, .inside-card, .app-card { padding: 24px; } }
.subscribe h2, .subscribe h3 { color: var(--foreground); }
.subscribe h2 + p, .subscribe h3 + p { margin-bottom: 22px; }
.sub-note { margin-top: 12px; color: var(--muted-foreground); text-wrap: pretty; }
.tcard { margin-bottom: 12px; }
.tcard .label { margin-bottom: 22px; }
.tcard .label + p { margin-top: 0; }
.tcard p + p { margin-top: 22px; }

/* ---------- fields: the email field and the message box share one look ---------- */
.sub-form { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-form .btn { flex: 1 0 auto; }
.sub-form input {
  flex: 999 1 160px; width: 0; min-width: 0;
  height: 44px; padding: 0 18px;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-full);
  font-size: 15px;
  transition: border-color var(--duration-default) var(--ease);
}
.subscribe .sub-form input { border-color: var(--input); }
.sub-form input:hover, .chatbox textarea:hover { border-color: var(--input-hover); }
.sub-form input::placeholder, .chatbox textarea::placeholder { color: var(--muted-foreground); }
.sub-form input[aria-invalid="true"], .chatbox textarea[aria-invalid="true"] { border-color: var(--destructive); }
.form-status {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 10px;
  color: var(--muted-foreground);
}
.form-status:empty { margin-top: 0; }
.form-status .i { margin-top: 3px; }
.form-status.is-error { color: var(--destructive); }
.form-status.is-done .i { color: var(--foreground); }

.chatbox { position: relative; }
.chatbox textarea {
  display: block;
  width: 100%; height: 148px;
  padding: 16px 18px 60px;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-card);
  font-size: 15px; line-height: 22px; font-weight: 500;
  resize: none;
  transition: border-color var(--duration-default) var(--ease);
}
.chatbox .send { position: absolute; right: 12px; bottom: 12px; }
.hint { color: var(--muted-foreground); margin-top: 8px; text-align: right; }
@media (hover: none), (pointer: coarse) { .hint { display: none; } }

/* ---------- footer: label and value stacks ---------- */
footer { margin-top: 160px; padding-bottom: 120px; }
@media (max-width: 767px) { footer { margin-top: 120px; padding-bottom: 96px; } }
footer .signature {
  font-family: "Caveat", cursive;
  font-size: 40px; line-height: 44px; font-weight: 600;
  color: var(--foreground);
  margin-bottom: 40px;
}
footer .fgroup, footer .fpair { margin-top: 52px; }
footer .col > .fgroup:first-child, footer .signature + .fgroup { margin-top: 0; }
footer .fpair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
footer .fpair .fgroup { margin-top: 0; }
footer .fk { color: var(--foreground); }
footer .fv, footer .flist a { color: var(--muted-foreground); }
footer .fv a, footer .flist a { display: inline-block; }
footer .flist a { padding-block: 1px; }   /* 24px targets, stacked (WCAG 2.2 target size) */
footer .fv a:hover, footer .flist a:hover { color: var(--foreground); }
footer .flist--media a { display: inline-flex; align-items: center; gap: 8px; }
.flist { list-style: none; }
footer .colophon { margin-top: 52px; color: var(--muted-foreground); }
footer .colophon time { white-space: nowrap; }
@media (pointer: coarse) { footer .flist a, footer .fv a { padding: 6px 0; } footer .flist li + li { margin-top: -4px; } }

/* ---------- plates: one clean image, centred on the grey, with room on every side ----------
   tools/plates.py moves a board's own background onto the plate grey and trims it, so the
   centring here gives every image the same air. */
.plates {
  width: min(100% - 2 * var(--gutter), var(--plate-w));
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.plate {
  position: relative; margin: 0;
  width: 100%; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  padding: 8%;
  background: var(--plate);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.plate > img, .plate > video { display: block; width: auto; height: auto; max-width: var(--fit, 100%); max-height: var(--fit, 100%); }
.plate--window > img {
  border-radius: var(--radius-xl);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .03), 0 24px 48px -24px rgba(0, 0, 0, .2);
}
.plate--photo > img, .plate--photo > video { border-radius: 16px; }
.plate--logo > img { max-width: var(--logo-w, 40%); max-height: 46%; }
.plate--group {
  display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
  gap: 4%;
}
.plate-g { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.plate-g img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
@media (max-width: 767px) {
  .plates { gap: 8px; }
  .plate { padding: 7%; }
  .plate--window > img { border-radius: var(--radius-md); }
  .plate--photo > img, .plate--photo > video { border-radius: 10px; }
}

/* enlarge: a plate opens its image full size; the button is there for keys and screen readers */
.plate[data-zoom] { cursor: zoom-in; }
.plate-zoom {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: var(--background); color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 4px 12px rgba(0, 0, 0, .06);
  opacity: 0;
}
.plate-zoom:hover { background: var(--card); }
.plate:hover .plate-zoom, .plate-zoom:focus-visible { opacity: 1; }
@media (hover: none) { .plate-zoom { display: none; } }

/* motion plates: a pause control on every looping video */
.plate-play {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  background: var(--background); color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .08);
}
.plate-play:hover { background: var(--card); }

/* the enlarged image: the plate grey edge to edge, the image whole in the middle */
dialog.zoom {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--plate);
}
dialog.zoom[open] { display: flex; align-items: center; justify-content: center; animation: fade-in var(--duration-moderate) var(--ease); }
dialog.zoom::backdrop { background: var(--plate); }
dialog.zoom img {
  max-width: calc(100% - 48px); max-height: calc(100% - 136px);
  width: auto; height: auto;
  object-fit: contain;
  cursor: zoom-out;
}
dialog.zoom.is-window img { border-radius: var(--radius-xl); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 24px 48px -24px rgba(0, 0, 0, .2); }
dialog.zoom.is-photo img { border-radius: 16px; }
.zoom-close { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); }
.zoom-close:active { transform: translateX(-50%) scale(.96); }
html:has(dialog.zoom[open]) { overflow: hidden; }

/* ---------- case studies (one template for all twelve, built by tools/cases.py) ---------- */
.cx-main { padding-top: var(--top); }
.cx-col { width: min(100% - 2 * var(--gutter), var(--text)); margin: 0 auto; }
.cx-title { margin: 0; }
.cx-name { display: block; color: var(--foreground); }
.cx-lead { display: block; color: var(--muted-foreground); text-wrap: pretty; }
.cx-sub { margin-top: 22px; color: var(--muted-foreground); }
.cx-hero { margin-top: 80px; }
.cx-info { margin-top: 80px; }
.cx-text p { color: var(--muted-foreground); text-wrap: pretty; }
.cx-text > * + * { margin-top: 22px; }
.cx-visits { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 22px; }
.cx-visits a {
  color: var(--foreground);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent);
}
.cx-visits a:hover { text-decoration-color: currentColor; }
.cx-facts { margin: 52px 0 0; border-top: 1px solid var(--border); }
.cx-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cx-fact dt { color: var(--foreground); flex: 0 0 auto; }
.cx-fact dd { margin: 0; color: var(--muted-foreground); text-align: right; }
.cx-tbc { color: var(--warning); }
.cx-sec { margin-top: var(--section); }
.cx-sec-head { margin-bottom: 32px; }
.cx-label { color: var(--foreground); }
.cx-label + .cx-text { margin-top: 22px; }
.cx-quote { margin: 0; padding-left: 16px; border-left: 2px solid var(--border); }
.cx-quote p { color: var(--foreground); }
.cx-quote .who { margin-top: 8px; color: var(--muted-foreground); }
.cx-text > .cx-quote { margin-top: 24px; }
.cx-note { margin-top: 22px; }
.cx-note p { color: var(--muted-foreground); }
.cx-cards {
  width: min(100% - 2 * var(--gutter), var(--plate-w));
  margin: 32px auto 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap);
}
.cx-cards .card { width: auto; }
@media (max-width: 639px) { .cx-cards { grid-template-columns: 1fr; } }
.hire { margin-top: 48px; color: var(--muted-foreground); }
.metric { color: var(--foreground); }

/* review builds only: an empty slot, and what goes there */
.plate--slot { text-align: center; }
.plate--slot::before {
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 1.5px dashed color-mix(in srgb, var(--plate) 60%, var(--foreground)); border-radius: 14px;
}
.slot-txt { position: relative; max-width: 480px; }
.slot-k { color: var(--foreground); }
.slot-v { color: var(--muted-foreground); margin-top: 6px; }
.slot-spec { margin-top: 12px; color: var(--warning); }

/* ---------- /work: two cards a row, the width of the plates ---------- */
.work-grid {
  list-style: none;
  width: min(100% - 2 * var(--gutter), var(--plate-w)); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap);
}
.work-grid .card { width: auto; }
@media (max-width: 639px) { .work-grid { grid-template-columns: 1fr; } }
.wide-page .closing { margin-top: 64px; }

/* ---------- story ---------- */
.roles { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.roles a { color: var(--foreground); }
.eras { list-style: none; margin-top: 52px; border-top: 1px solid var(--border); }
.eras li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.era-y { color: var(--muted-foreground); }
.era-t { color: var(--foreground); }
.photo-band { margin: 96px 0 0; }
.photo-band img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-card); background: var(--plate); }
.photo-band figcaption { margin-top: 12px; color: var(--muted-foreground); }

/* ---------- ideas ---------- */
.ideas { list-style: none; border-top: 1px solid var(--border); }
.idea { display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 32px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 120px; }
.idea-n { color: var(--icon); }
.idea-title { color: var(--foreground); margin-bottom: 22px; }
.idea-src { margin-top: 16px; }
.idea:target { background: linear-gradient(var(--plate), var(--plate)) no-repeat; background-size: 100% 100%; }

/* ---------- the letter page ---------- */
.letter-page p { color: var(--foreground); }
.letter-page .sig { font-family: "Caveat", cursive; font-size: 40px; line-height: 44px; font-weight: 600; color: var(--brand); margin-top: 28px; }

/* ---------- a book as an object: the cover hinges open on hover ---------- */
.b3d { position: relative; display: inline-block; perspective: 900px; flex: 0 0 auto; }
.b3d-pages {
  position: absolute;
  top: 3px; bottom: 3px; right: 2px;
  width: 24px;
  background: var(--white);
  border-radius: 1px 4px 4px 1px;
  box-shadow:
    inset 0 1.9px 3px 0 rgba(255, 255, 255, 0.43),
    inset 3.6px 0 3.6px 0 rgba(0, 0, 0, 0.15),
    1px 1px 4px rgba(13, 13, 13, 0.12);
}
.b3d-cover {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform var(--duration-deliberate) var(--ease);
  border-radius: 2px 6px 6px 2px;
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 10px 26px rgba(13, 13, 13, 0.16);
  backface-visibility: hidden;
}
.b3d-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b3d-cover::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 8px;
  background: linear-gradient(to right, rgba(0,0,0,0.14), rgba(255,255,255,0.12) 60%, rgba(0,0,0,0.05));
  z-index: 1;
}
.b3d--md { width: 132px; height: 204px; }
.b3d--lg { width: 220px; height: 340px; }
.b3d--lg .b3d-cover { border-radius: 2px 8px 8px 2px; box-shadow: 0 30px 60px -20px rgba(13, 13, 13, .35), 0 4px 12px rgba(13, 13, 13, .10); }
@media (min-width: 768px) { .b3d--lg { width: 260px; height: 402px; } }
@media (max-width: 767px) { .b3d--md { width: 112px; height: 173px; } }

/* ---------- the book page ---------- */
.book-q { color: var(--foreground); margin-top: 22px; }
.book-title { color: var(--foreground); }
.book-sub { color: var(--muted-foreground); }
.book-by { margin-top: 22px; color: var(--muted-foreground); }
.book-when { color: var(--muted-foreground); }
.book-form { margin-top: 32px; }
/* buy the book: where it goes, the sum, then stripe (the form in tools/site.py buy_section) */
.buy-form { margin-top: 32px; display: flex; flex-direction: column; gap: 22px; }
.buy-field { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.buy-field label { color: var(--foreground); }
.select { position: relative; }
.select select {
  appearance: none; width: 100%; height: 44px; padding: 0 46px 0 18px;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-full);
  font: inherit; cursor: pointer;
  transition: border-color var(--duration-default) var(--ease);
}
.select select:hover { border-color: var(--input-hover); }
.select select:invalid { color: var(--muted-foreground); }   /* "choose a country" reads as a placeholder */
.select .i { position: absolute; right: 18px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--muted-foreground); }
.buy-sum { margin: 0; border-top: 1px solid var(--border); }
.buy-sum > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.buy-sum dt { color: var(--muted-foreground); }
.buy-sum dd { margin: 0; color: var(--foreground); font-variant-numeric: tabular-nums; text-align: right; }
.buy-total dt { color: var(--foreground); }
.buy-btn { align-self: flex-start; }
.buy-btn:disabled { opacity: .9; cursor: progress; }   /* white on the faded emerald stays 4.5:1 */
.buy-alert { display: none; color: var(--destructive); }
.buy-alert:target { display: block; }   /* the checkout sends a bad request back to #buy-choose */
.buy-alert.is-gone { display: none; }   /* script.js: the form was used again */
.buy-alert a { color: inherit; text-decoration: underline; }
.buy-notes { list-style: none; margin-top: 32px; display: flex; flex-direction: column; gap: 6px; color: var(--muted-foreground); text-wrap: pretty; }
.buy-notes a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); text-underline-offset: 3px; }
.buy-notes a:hover { text-decoration-color: currentColor; }
@media (max-width: 639px) { .buy-btn { align-self: stretch; } }
/* paperback or ebook (27 Nov): two radios drawn as one pill in the menu's language, a grey track with the
   chosen one in white. Each format keeps its own form and :has shows the chosen one; a browser without
   :has shows both, and each still works on its own. */
.buy-format {
  display: flex; gap: 4px;
  margin: 32px 0 0; padding: 4px; border: 0; min-width: 0;
  background: var(--plate); border-radius: var(--radius-full);
}
.buy-format label {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-full);
  color: var(--muted-foreground);   /* 4.7:1 on the plate */
  cursor: pointer;
  transition: background-color var(--duration-default) var(--ease), box-shadow var(--duration-default) var(--ease), color var(--duration-default) var(--ease);
}
.buy-format label:hover { color: var(--foreground); }
.buy-format input:checked + label {
  background: var(--background); color: var(--foreground); font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .06);
}
.buy-format input:focus-visible + label { outline: 2px solid var(--ring); outline-offset: 2px; }
.buy-pane { margin-top: 32px; }
/* how many books (27 Nov): 1, or a package of 5, 10 or 20, in the same pill as the format */
.buy-count legend { margin: 0 0 8px; padding: 0; color: var(--foreground); }
.buy-seg { margin: 0; }
.buy-sum > div[hidden] { display: none; }
.buy-sum [data-sum="off"], .buy-sum [data-sum="off-row"] dd { color: var(--cta); }
/* the sale (27 Nov, black friday until monday): one line in the brand's green, under the hero's button and at the
   top of the buy section; script.js shows it until it ends */
.sale-note { margin: 0; color: var(--cta); font-weight: 500; text-wrap: pretty; }
.sale-note[hidden] { display: none; }
.book-sale { margin-top: 16px; }
.buy-sale { margin-top: 12px; }
.buy:has(#format-ebook:checked) #buy-paperback,
.buy:has(#format-paperback:checked) #buy-ebook { display: none; }

.buy-have { margin-top: 22px; color: var(--muted-foreground); }
.buy-have a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); text-underline-offset: 3px; }
.buy-have a:hover { text-decoration-color: currentColor; }

/* the ebook's pages: /ebook after paying, the sign-in at /read, /read/reset and /read/account. The functions
   show the part that fits (data-when) and the message a form came back with (data-why). */
.ebook [hidden] { display: none !important; }
.doc .ph + .ebook { margin-top: 0; }   /* the part that shows reads as the title's lede: ink, then grey */
.ebook-file { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ebook-file .sub-note { margin-top: 0; }
.ebook-file + .prose, .ebook-notes { margin-top: 32px; }
.ebook-notes { color: var(--muted-foreground); }
.ebook-alert, .ebook-ok { margin: 0; text-wrap: pretty; }
.ebook-alert { color: var(--destructive); }
.ebook-ok { color: var(--foreground); }
.ebook-alert a, .ebook-ok a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.ebook-buy { margin-top: 32px; color: var(--muted-foreground); text-wrap: pretty; }
.ebook-buy--next { margin-top: 8px; }
[data-when="unknown"]:not([hidden]) + .ebook-buy { margin-top: 22px; }
.ebook-buy a, .ebook .prose a, .ebook-notes a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); text-underline-offset: 3px; }
.ebook-buy a:hover, .ebook .prose a:hover, .ebook-notes a:hover { text-decoration-color: currentColor; }
.ebook strong { font-weight: 500; }
.field-hint { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 20px; }
.field[readonly] { background: var(--plate); border-color: var(--border); color: var(--foreground); }
/* the account: devices, a new password, signing out */
.account-label { margin-top: 64px; }
.account-label + .ebook-ok { margin-top: 16px; }
.account .prose { margin-top: 16px; }
.devices { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--border); }
.device { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.device p { margin: 0; }
.device .sub-note { margin-top: 2px; }
.device form { margin: 0; flex: none; }
.device-this { flex: none; color: var(--muted-foreground); }
.account-act { margin-top: 22px; }
.account-out { margin-top: 64px; }
.account-privacy { margin-top: 22px; }
.field {
  width: 100%; height: 44px; padding: 0 18px;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-full);
  font: inherit;
  transition: border-color var(--duration-default) var(--ease);
}
.field:hover { border-color: var(--input-hover); }
.field::placeholder { color: var(--muted-foreground); }
@media (pointer: coarse) { .field { font-size: 16px; } }   /* iOS zooms into a field under 16px */
@media (max-width: 639px) { .ebook-file .btn, .account-act .btn { flex: 1 1 100%; width: 100%; } }
.book-plates { margin-top: 80px; }
.book-stage { cursor: default; }
/* a phone's 4:3 plate is shorter than the book: the plate takes the book's height */
@media (max-width: 639px) { .book-stage { aspect-ratio: auto; padding-block: 48px; } }
/* the launch: the book release on its plate, then the other photos two to a row */
.launch-plates { margin-top: 40px; }
.plates-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.launch .plate > img { width: 100%; }
.launch-more { margin-top: 40px; }
.book .cx-facts { margin-top: 22px; }
@media (max-width: 767px) { .plates-two { gap: 8px; } }
@media (max-width: 639px) { .plates-two { grid-template-columns: minmax(0, 1fr); } }
.book-stage:hover .b3d-cover { transform: rotateY(-24deg); }
.inside { list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: part; }
.inside-card { counter-increment: part; }
.inside-card h3 { color: var(--foreground); }
.inside-card h3::before { content: "part " counter(part) " · "; content: "part " counter(part) " · " / ""; color: var(--muted-foreground); }
.inside-card p { color: var(--muted-foreground); margin-top: 12px; }
/* each part's question pages, under its card (5 Dec 2026) */
.part-qs { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.part-qs a { color: var(--foreground); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); }
.part-qs a:hover { text-decoration-color: currentColor; }
.author { display: flex; flex-direction: column; gap: 26px; }
.author img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-full); }

/* ---------- apps page ---------- */
.calm-def { color: var(--foreground); margin-bottom: 32px; }
.calm-def a { color: var(--muted-foreground); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); }
.app-cards { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.app-card { display: flex; flex-direction: column; gap: 22px; }
.app-icon-sm { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 22px -10px rgba(0, 0, 0, .25); }
.app-name { color: var(--foreground); }
.app-card p { color: var(--muted-foreground); }
.app-card p + p { margin-top: 12px; }
.app-card .more { margin-top: 16px; }

/* ---------- studio ---------- */
.arch-list { list-style: none; border-top: 1px solid var(--border); }
.arch { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--border); }
.arch .an { color: var(--foreground); transition: color var(--duration-default) var(--ease); }
.arch .at { color: var(--muted-foreground); }
.arch:hover .an { color: var(--muted-foreground); }
.quote + .quote { margin-top: 40px; }
.quote p { color: var(--muted-foreground); }
.quote .who { color: var(--foreground); margin-top: 12px; }

/* ---------- press ---------- */
.bio + .bio { margin-top: 40px; }
.bio-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bio-head h3 { color: var(--foreground); }
.copy-status { color: var(--muted-foreground); }
.assets { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 22px; }
.asset img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); background: var(--plate); }
.asset img.contain { object-fit: contain; padding: 14%; }
.asset a { display: inline-flex; align-items: flex-start; gap: 6px; min-height: 32px; margin-top: 8px; color: var(--foreground); }
.asset a .i { margin-top: 3px; }
/* the launch photos keep their own 3:2, the release across the column */
.assets--photos .asset img { height: auto; aspect-ratio: 3 / 2; }
.asset--lead { grid-column: 1 / -1; }
@media (max-width: 767px) { .assets--photos .asset img { border-radius: 16px; } }   /* the photo corner from the book page */

/* ---------- doc pages: tabilog, privacy ---------- */
.case.doc main > header { padding-top: var(--top); }
.case .h-title { margin-top: 0; }
.case .h-sub { color: var(--muted-foreground); }
.case .back { display: inline-flex; align-items: center; gap: 1ch; min-height: 24px; color: var(--muted-foreground); }
.case .back:hover { color: var(--foreground); }
.links { margin-top: 32px; border-top: 1px solid var(--border); }
.links a {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center;
  min-height: 46px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}
.links .i { color: var(--icon); transition: color var(--duration-default) var(--ease); }
.links .key { color: var(--foreground); }
.links a:hover .i, .links a:hover .value { color: var(--foreground); }

/* ---------- touch, contrast, motion ---------- */
@media (pointer: coarse) {
  /* links that end in an arrow stay inline, so the space and the underline before the arrow stay as on a desktop;
     11px above and below a 22px line make them 44px to tap */
  .more a, .idea-src a, .lt-link a, .lost .routes a, .roles a, .cx-visits a { display: inline-block; padding-block: 11px; }
  .sec-more { display: inline-block; padding-block: 11px; margin-block: -11px; }   /* 44px to tap, the row keeps its height */
  .case .back, .asset a { display: inline-flex; align-items: center; min-height: 44px; }
  .menu-rows a { height: 48px; }
  .btn-sm { height: 44px; }
}
@media (forced-colors: active), (prefers-contrast: more) {
  #cursor { display: none !important; }
  .has-cursor body, .has-cursor a, .has-cursor button, .has-cursor textarea { cursor: auto; }
  nav.pill, .menu-card { border: 1px solid CanvasText; }
  .plate, .card .cover { outline: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover .b3d-cover, .book-stage:hover .b3d-cover { transform: none; }
  .btn:active, .icon-btn:active { transform: none; }
}

/* the sleep hub, its questions and the downloads (4 Dec 2026): the free things are cards without part numbers,
   the email form is the subscribe card's, and a question page is prose with its own headings and steps */
.inside--free .inside-card h3::before { content: none; }
.inside--free .inside-card .btn { margin-top: 18px; gap: 8px; }
.lead { margin-top: 12px; }
.lead .sub-note { margin-top: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sleep-qs { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.sleep-qs a { color: var(--foreground); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); }
.sleep-qs p { color: var(--muted-foreground); margin-top: 4px; }
/* the questions by the book's seven parts (5 Dec 2026) */
.sleep-part { margin-top: 40px; }
.label + .sleep-part { margin-top: 22px; }
.sleep-part h3 { color: var(--muted-foreground); font-size: inherit; font-weight: 400; }
.sleep-part h3 + .sleep-qs { margin-top: 14px; }
.home-book .sleep-teaser { margin-top: 28px; }
.prose.article h2 { color: var(--foreground); font-size: inherit; font-weight: 500; margin-top: 44px; }
.prose.article h2:first-child { margin-top: 0; }
.prose.article h2 + p { margin-top: 12px; }
.prose.article a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose.article ol.steps { margin: 12px 0 0; padding-left: 22px; color: var(--muted-foreground); }
.prose.article ol.steps li + li { margin-top: 8px; }
/* the essays brought home from Medium (5 Dec 2026): his words as published, in the question pages' reading measure */
.essay-meta { color: var(--muted-foreground); margin-bottom: 36px; }
.essay-meta a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 36%, transparent); }
.prose.essay h3 { color: var(--foreground); font-size: inherit; font-weight: 500; margin-top: 32px; }
.prose.essay h3 + p, .prose.essay h3 + ul, .prose.essay h3 + ol { margin-top: 10px; }
.prose.essay > * + ul, .prose.essay > * + ol, .prose.essay > * + blockquote, .prose.essay > * + figure, .prose.essay > * + pre { margin-top: 22px; }
.prose.essay ul, .prose.essay ol { padding-left: 22px; color: var(--muted-foreground); }
.prose.essay li + li { margin-top: 8px; }
.prose.essay ul + p, .prose.essay ol + p, .prose.essay blockquote + p, .prose.essay figure + p, .prose.essay pre + p { margin-top: 22px; }
.prose.essay blockquote { border-left: 2px solid var(--border); padding-left: 18px; }
.prose.essay blockquote p { color: var(--foreground); }
.prose.essay blockquote.pull { border-left: 0; padding-left: 0; }   /* Medium's pull quote: set apart by size, not a rule */
.prose.essay blockquote.pull p { font-size: 1.25em; line-height: 1.45; }
.prose.essay figure img { display: block; width: auto; max-width: 100%; height: auto; margin-inline: auto; border-radius: 8px; background: var(--muted); }   /* a small picture keeps its own size */
.prose.essay figcaption { color: var(--muted-foreground); font-size: 0.875em; margin-top: 10px; }
.prose.essay pre { overflow-x: auto; padding: 16px; border-radius: 8px; background: var(--muted); font-size: 0.875em; line-height: 1.6; }
.prose.essay strong { color: var(--foreground); font-weight: 500; }
.prose.essay hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* the free things, shown (4 Dec 2026, "showcase the freebies better on the page"): real pages of the guide fanned on
   the book's paper, and a sample of how the coach starts; two cards on the plates' width, one above the other on a phone */
.freebies { width: min(100% - 2 * var(--gutter), var(--plate-w)); margin: 22px auto 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.freebie { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius-card); overflow: hidden; }
.freebie-art { position: relative; height: 420px; }
.freebie-text { padding: 26px 30px 32px; }
.freebie-text h3 { color: var(--foreground); }
.freebie-meta { color: var(--muted-foreground); margin-top: 4px; }
.freebie-text .freebie-meta + p { margin-top: 14px; color: var(--muted-foreground); }
.guide-fan { background: #e8e9f5; }   /* the book cover's paper, a shade deeper so its pages stand out */
.guide-fan .pg { position: absolute; top: 50%; left: 50%; width: 46%; height: auto; aspect-ratio: 560 / 794; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(43, 43, 58, .08), 0 22px 40px -18px rgba(43, 43, 58, .38);
  transition: transform var(--duration-default, .3s) var(--ease, ease); }
.guide-fan .pg--front { transform: translate(-50%, -50%); z-index: 3; }
.guide-fan .pg--mid { transform: translate(-88%, -47%) rotate(-7deg); z-index: 2; }
.guide-fan .pg--back { transform: translate(-12%, -47%) rotate(7deg); z-index: 1; }
.freebie:hover .pg--mid { transform: translate(-96%, -48%) rotate(-10deg); }
.freebie:hover .pg--back { transform: translate(-4%, -48%) rotate(10deg); }
@media (prefers-reduced-motion: reduce) { .guide-fan .pg { transition: none; } }
.chat { display: flex; flex-direction: column; justify-content: center; padding: 28px 26px 18px; }
.chat-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 9px 14px; border-radius: 18px; font-size: 14px; line-height: 20px; }
.msg--you { align-self: flex-end; background: var(--foreground); color: var(--background); border-bottom-right-radius: 6px; }
.msg--coach { align-self: flex-start; background: var(--background); color: var(--foreground); border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.chat-note { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.lead--get { margin-top: 0; }
.lead--card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 26px; align-items: start; }
.lead-thumb img, .sleep-teaser img { display: block; width: 100%; height: auto; border-radius: 3px; transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(43, 43, 58, .08), 0 14px 26px -12px rgba(43, 43, 58, .35); }
.sleep-teaser { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 12px;
  padding: 20px 24px; background: var(--card); border-radius: var(--radius-card); color: inherit; text-decoration: none; }
.sleep-teaser:hover { background: var(--card-hover); }
.sleep-teaser strong { display: block; color: var(--foreground); font-weight: 500; }
.sleep-teaser span span { display: block; color: var(--muted-foreground); }
@media (max-width: 767px) {
  .freebies { grid-template-columns: 1fr; }
  .freebie-art { height: auto; }
  .guide-fan { aspect-ratio: 1 / 1; }
  .freebie-text { padding: 22px 24px 26px; }
  .chat { padding: 22px 18px 14px; }
  .lead--card { display: block; }
  .lead--card .lead-thumb { display: block; width: 72px; margin: 0 0 20px 4px; }
  .sleep-teaser { padding: 18px 20px; gap: 16px; }
}
