/* vighneshrege.com
   Layout: home is an index of large words; each section is its own page with a breadcrumb back out.
   Going in, a page's content rises softly into place; coming home, the index settles from above. */
:root {
  --bg: #eceee9;
  --surface: #f6f7f3;
  --ink: #1d2138;
  --muted: #5d6275;
  --rule: #c9ccc4;
  --accent: #383d94;
  --hemp: #a8834a;
  --display: "Gloock", "Bodoni 72", Didot, Georgia, serif;
  --body: "Literata", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13151f; --surface: #1b1e2b; --ink: #e7e5dd; --muted: #a0a3b2;
    --rule: #2e3243; --accent: #a3a9f2; --hemp: #d3ae70; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13151f; --surface: #1b1e2b; --ink: #e7e5dd; --muted: #a0a3b2;
  --rule: #2e3243; --accent: #a3a9f2; --hemp: #d3ae70; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
.inner {
  max-width: 60rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
p { margin: 0; }

/* Soft movement between pages */
.rise { animation: rise 0.55s cubic-bezier(.2,.7,.2,1) both; }
.settle { animation: settle 0.55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise, .settle { animation: none; } }

/* Home */
.home-head { display: grid; gap: 1.1rem; padding-top: calc(env(safe-area-inset-top, 0px) + 4.5rem); margin-bottom: 3rem; }
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.rope { width: min(22rem, 100%); height: 22px; display: block; color: var(--hemp); }
.role { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin: 0; }
.intro { max-width: 34rem; margin: 0; font-size: 1.15rem; }

/* The index of doors: big words that lead into each page */
.doors { list-style: none; margin: 0; padding: 0; }
.doors li + li { border-top: 1px solid var(--rule); }
.door {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding: 1.3rem 0;
  color: var(--ink);
  text-decoration: none;
}
.door .word {
  font-family: var(--display);
  font-size: clamp(2.1rem, 6.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  transition: color 0.25s;
}
.door .what { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted); text-align: right; max-width: 16rem; }
.door .kind { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); order: -1; }
.door:hover .word, .door:focus-visible .word { color: var(--accent); }
.doors.small .door .word { font-size: clamp(1.7rem, 4.6vw, 2.8rem); }

/* Breadcrumb at the top of every section page */
.crumbs {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.crumbs .inner { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.3rem 0.6rem; padding-block: 0.9rem; font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.crumbs .inner::-webkit-scrollbar { display: none; }
.crumbs .inner > * { flex: none; }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; padding-block: 0.2rem; }
.crumbs a:first-child { color: var(--ink); }
.crumbs a:hover { color: var(--accent); border-color: var(--accent); }
.crumbs .sep { color: var(--rule); }
.crumbs .here { color: var(--ink); }

/* Section pages */
.view-head { padding-top: 3rem; margin-bottom: 2rem; display: grid; gap: 0.6rem; }
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); margin: 0; }
.deck { margin: 0.2rem 0 0; font-size: clamp(1.15rem, 2.8vw, 1.45rem); line-height: 1.35; color: var(--muted); text-wrap: balance; }
.coming-soon { margin-top: 2.5rem; font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--muted); }
.body { display: grid; gap: 1.1rem; max-width: 40rem; }
h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.15; margin: 0.5rem 0 0; text-wrap: balance; }
.quiet { color: var(--muted); }

.link-out {
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.link-out:hover { background: var(--accent); color: var(--bg); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.list li { padding-left: 1.2rem; position: relative; }
.list li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 0.5rem; height: 1px; background: var(--hemp); }
.sub { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
/* Jumping to a section lands below the sticky breadcrumb */
[id] { scroll-margin-top: 4.5rem; }
.consent-note { font-size: 0.95rem; color: var(--muted); border-left: 2px solid var(--hemp); padding-left: 1rem; }

/* Featured essays */
.essays { list-style: none; margin: 0; padding: 0; }
.essays li + li { border-top: 1px solid var(--rule); }
.essay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1.5rem;
  padding: 0.95rem 0;
  color: var(--ink);
  text-decoration: none;
}
.essay-title { font-family: var(--display); font-size: 1.15rem; line-height: 1.25; transition: color 0.2s; }
.essay-sub { grid-column: 1; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.essay-date { grid-column: 2; grid-row: 1; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; padding-top: 0.2rem; font-variant-numeric: tabular-nums; }
.essay:hover .essay-title, .essay:focus-visible .essay-title { color: var(--accent); }

/* Placeholder marks for content still to come */
.todo {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px dashed var(--rule);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Loving Torture: four vertical videos, watched in order */
.reels-wrap { margin-top: 2rem; --reel-w: min(20rem, 72vw, 38vh); }
.reels {
  list-style: none;
  margin: 0;
  padding: 0.25rem calc((100% - var(--reel-w)) / 2) 0.75rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.reels::-webkit-scrollbar { display: none; }
.reel {
  flex: 0 0 var(--reel-w);
  scroll-snap-align: center;
  display: grid;
  gap: 0.7rem;
  opacity: 0.42;
  transform: scale(0.93);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(.2,.75,.15,1);
}
.reel.is-current { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reels { scroll-behavior: auto; } .reel { transition: none; } }
.reel-frame { position: relative; aspect-ratio: 9 / 16; max-width: 100%; background: #0e0f14; border-radius: 6px; overflow: hidden; }
.reel-player, .reel-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 1rem; color: #d3ae70; }
.reel-num { font-family: var(--display); font-size: 4.5rem; line-height: 1; }
.reel-empty .todo { color: #a9a8a2; border-color: #3a3c47; }
.reel-meta { display: flex; align-items: baseline; gap: 0.6rem; }
.reel-part { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hemp); white-space: nowrap; }
.reel-title { font-family: var(--display); font-size: 1.2rem; line-height: 1.2; min-width: 0; }
.reel-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.75rem; }
.reel-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); cursor: pointer; font-family: var(--mono); }
.reel-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.reel-btn:disabled { opacity: 0.4; cursor: default; }
.reel-count { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 6.5rem; text-align: center; }

/* Shibari: gallery */
.gallery { columns: 3 15rem; column-gap: 0.75rem; margin-top: 1.75rem; }
.shot { display: block; width: 100%; margin: 0 0 0.75rem; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; break-inside: avoid; }
.shot img { display: block; width: 100%; height: auto; transition: opacity 0.3s; }
.shot:hover img { opacity: 0.86; }

/* Photo viewer: always dark, so the photographs read the same in either theme */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(9, 10, 14, 0.95);
  color: #ecebe6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: calc(env(safe-area-inset-top, 0px) + 3.75rem) max(10px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 3.25rem) max(10px, env(safe-area-inset-left, 0px));
}
.lb-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid rgba(236, 235, 230, 0.28); background: none; color: #ecebe6; cursor: pointer; font-family: var(--mono); font-size: 1rem; }
.lb-btn:hover { border-color: #ecebe6; }
.lb-btn:focus-visible { outline-color: #ecebe6; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 0.75rem); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-count { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 0.78rem; color: #a9a8a2; font-variant-numeric: tabular-nums; }

/* Threshold before the poetry and rope pages */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gate-card {
  width: min(30rem, 100%);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.75rem 1.6rem 1.4rem;
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--ink) 35%, transparent);
  animation: gate-in 0.35s cubic-bezier(.2,.75,.15,1);
}
@keyframes gate-in { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .gate-card { animation: none; } }
.gate-card .rope { width: 9rem; height: 16px; }
.gate-name { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.gate-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem; align-items: start; padding: 1rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1.5; }
.gate-check:has(input:checked) { border-color: var(--hemp); }
.gate-check input { width: 1.3rem; height: 1.3rem; margin: 0.15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.gate-actions a, .gate-actions button { font-family: var(--mono); font-size: 0.85rem; padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; border: 1px solid var(--rule); background: none; color: var(--ink); text-decoration: none; }
.gate-actions .enter { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.gate-actions .enter:disabled { background: none; color: var(--muted); border-color: var(--rule); cursor: not-allowed; }
.is-gated .page { visibility: hidden; }

/* The space above the footer matches the space between the home intro and the first section (3rem + a door's 1.3rem padding) */
footer.inner { margin: 3rem auto 0; }
footer { padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
footer a { color: var(--ink); }

@media (max-width: 640px) {
  .home-head { padding-top: calc(env(safe-area-inset-top, 0px) + 2.75rem); }
  .door { grid-template-columns: minmax(0, 1fr); }
  .door .what { text-align: left; }
  .view-head { padding-top: 2rem; }
  .lightbox { grid-template-columns: minmax(0, 1fr); }
  .lightbox .lb-prev, .lightbox .lb-next { display: none; }
}

/* ---------- Writing: the essay list ---------- */
.why { max-width: 40rem; border-left: 2px solid var(--hemp); padding-left: 1rem; }
.why summary { cursor: pointer; font-family: var(--display); font-size: 1.35rem; list-style: none; padding-block: 0.15rem; display: flex; align-items: baseline; gap: 0.6rem; }
.why summary::-webkit-details-marker { display: none; }
.why summary::before { content: "+"; font-family: var(--mono); font-size: 1rem; color: var(--hemp); width: 0.8rem; }
.why[open] summary::before { content: "−"; }
.why summary:hover { color: var(--accent); }
.why .more { display: grid; gap: 0.9rem; padding: 0.9rem 0 0.4rem 1.4rem; }
.why .more p { margin: 0; }

.subscribe { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.7rem; margin-top: 1.6rem; max-width: 48rem; }
.subscribe .link-out { justify-self: auto; }
.subscribe p { font-family: var(--mono); font-size: 0.76rem; line-height: 1.6; color: var(--muted); max-width: 30rem; margin: 0; }
.subscribe .addr { color: var(--ink); user-select: all; overflow-wrap: anywhere; }
.subscribe.end { margin-top: 3rem; }
.essay-page + .subscribe.end { max-width: 38rem; }
.subscribe.in-essay { margin: 0.6rem 0; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); }

.filters { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--crumbs-h, 3.1rem)); z-index: 1; background: var(--bg); padding-block: 1rem 0.9rem; margin-top: 2.25rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.7rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { display: inline-flex; align-items: baseline; gap: 0.45rem; font-family: var(--mono); font-size: 0.82rem; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s; }
.tag .n { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag:hover:not(:disabled) { border-color: var(--accent); }
.tag[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.tag[aria-pressed="true"] .n { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.tag:disabled { opacity: 0.4; cursor: default; }
.status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem 1rem; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.clear { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }

.archive { max-width: 48rem; margin-top: 0.4rem; }
.year { font-family: var(--display); font-size: 1.6rem; color: var(--hemp); padding: 1.6rem 0 0.2rem; }
.archive .essays li + li { border-top: 1px solid var(--rule); }
.archive li.out { display: none; }
.essay-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.essay-tags .on { color: var(--hemp); }
.essay-date { text-align: right; }
/* A chosen essay's image sits above it as a teaser, filling the row's width */
.essay.with-pic .teaser { grid-column: 1 / -1; grid-row: 1; display: block; height: var(--teaser-h, 12rem); margin-bottom: 0.55rem; min-width: 0; }
.essay.with-pic .essay-title, .essay.with-pic .essay-date { grid-row: 2; }
.essay.with-pic .teaser { overflow: hidden; border-radius: 4px; }
.essay-pic { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--x, 50%) var(--y, 50%); transform: scale(var(--z, 1)); transform-origin: var(--x, 50%) var(--y, 50%); background: #ffffff; }
.essay.with-pic:hover .teaser { outline: 1px solid var(--accent); outline-offset: 2px; }
.more-row { display: flex; justify-content: center; padding-block: 1.8rem 0.5rem; }
.empty { padding-block: 2rem; color: var(--muted); }

/* ---------- Writing: an essay ---------- */
.essay-head { padding-top: 3rem; margin-bottom: 2.25rem; display: grid; gap: 0.75rem; max-width: 38rem; }
.essay-head h2 { font-size: clamp(2.2rem, 6.2vw, 4rem); }
.essay-tagline { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; }
.essay-tagline a { color: var(--hemp); text-decoration: none; }
.essay-tagline a:hover { text-decoration: underline; }
.essay-head .deck { text-align: justify; text-wrap: wrap; hyphens: auto; }
.essay-meta { display: flex; justify-content: space-between; gap: 0.35rem 1rem; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; margin: 0; }
.disclaimer { max-width: 38rem; margin: 0 0 2rem; padding: 0.9rem 1.1rem; border-left: 2px solid var(--hemp); background: var(--surface); border-radius: 0 6px 6px 0; font-size: 0.95rem; color: var(--muted); }
.disclaimer p { margin: 0; }
.disclaimer strong { color: var(--ink); font-weight: 500; }
.episode { display: block; width: 100%; max-width: 38rem; margin: 0 0 2rem; }

.prose { display: grid; gap: 1.15rem; max-width: 38rem; font-size: 1.125rem; line-height: 1.72; overflow-wrap: break-word; }
.prose p, .prose li, .prose blockquote, .prose .footnote { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.prose .pullquote p, .prose figcaption, .prose .poll p, .prose .subscribe p { text-align: center; hyphens: manual; }
.prose figcaption { text-align: left; }
.prose > * { min-width: 0; margin: 0; }
.prose strong { font-weight: 500; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 1.2rem 0 0; text-wrap: balance; }
.prose h2 { font-size: clamp(1.6rem, 3.6vw, 2rem); }
.prose h3 { font-size: clamp(1.35rem, 3vw, 1.6rem); }
.prose h4, .prose h5, .prose h6 { font-size: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; display: grid; gap: 0.5rem; }
.prose li > p + p { margin-top: 0.8rem; }
.prose li > p:first-child:has(> strong:only-child) { margin-bottom: 0.2rem; }
.prose blockquote { border-left: 2px solid var(--hemp); padding-left: 1.1rem; color: var(--muted); display: grid; gap: 0.8rem; }
.prose blockquote p { margin: 0; }
.prose figure { display: grid; gap: 0.5rem; margin: 0; }
.prose figure img, .prose figure video, .prose > p > img, .prose video.loop { display: block; width: 100%; height: auto; border-radius: 6px; }
.prose figcaption { font-family: var(--mono); font-size: 0.75rem; line-height: 1.55; color: var(--muted); }
.prose video { display: block; width: 100%; max-width: 100%; height: auto; }
.prose figure.media video, .prose > video, .prose p > video:not(.loop) { background: #0e0f14; max-height: 80vh; border-radius: 6px; }
.prose audio { width: 100%; }
.prose .pullquote { font-family: var(--display); font-size: clamp(1.4rem, 3.4vw, 1.75rem); line-height: 1.3; text-align: center; padding-block: 0.6rem; text-wrap: balance; }
.prose .pullquote p { margin: 0; }
.prose .callout { padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; display: grid; gap: 0.8rem; }
.prose .callout p { margin: 0; }
.prose pre.verse { font-family: var(--body); font-size: 1.05rem; line-height: 1.6; white-space: pre-wrap; padding-left: 1.1rem; border-left: 2px solid var(--rule); }
.prose .embed-video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; }
.prose .embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.prose .embedded-post, .prose .poll { padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); display: grid; gap: 0.5rem; font-size: 1rem; }
.prose .embedded-post p, .prose .poll p, .prose .poll ul { margin: 0; }
.prose .poll-note { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.prose .footnote { font-size: 0.92rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1rem; }
.prose .footnote hr { display: none; }
.prose .footnote ol { gap: 0.6rem; }
.prose .footnote-ref { text-decoration: none; font-family: var(--mono); font-size: 0.75em; }
.break { display: flex; justify-content: center; padding-block: 1rem; }
.break .rope { width: 7.5rem; height: 14px; color: var(--hemp); }
.after { margin-top: 2.5rem; max-width: 38rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.after .prev { text-align: left; }
.after .next { text-align: right; }
.after a { display: grid; gap: 0.25rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.15rem; line-height: 1.25; }
.after a span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.after a:hover { color: var(--accent); }
@media (max-width: 640px) {
  .tag { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
  .essay-head { padding-top: 2rem; }
  .prose { font-size: 1.0625rem; }
  .after a { font-size: 1rem; }
}

/* Writing page opening: title with Subscribe beside it, one line of the manifesto, a link to the rest */
.writing-head { padding-top: 3rem; display: grid; gap: 0.9rem; max-width: 48rem; }
.writing-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.writing-title h2 { margin: 0; }
.writing-title .link-out { flex: none; margin-bottom: 0.45rem; }
.writing-quote { font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.3rem); line-height: 1.45; color: var(--muted); max-width: 34rem; }
.writing-why { justify-self: start; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.writing-head + .filters { margin-top: 1.6rem; }
@media (max-width: 640px) { .writing-head { padding-top: 2rem; } }

/* In the essay list, tags stay on the left and the reading time sits at the right */

/* Writing section type: Newsreader throughout, set a little larger with a true semibold */
body.writing {
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --body: "Newsreader", "Iowan Old Style", Georgia, serif;
}
body.writing .essay-head h2 { line-height: 1.05; letter-spacing: -0.005em; }
body.writing .prose { font-size: 1.25rem; line-height: 1.6; }
body.writing .prose strong, body.writing .disclaimer strong { font-weight: 600; }
body.writing .prose h2, body.writing .prose h3, body.writing .prose h4, body.writing .prose h5, body.writing .prose h6 { font-weight: 600; }
body.writing .prose .pullquote { font-weight: 600; }
body.writing .essay-title { font-size: 1.2rem; }
/* reading time trails the title in the Writing list */
.essay-title .min { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-left: 0.5rem; white-space: nowrap; vertical-align: 0.15em; }

/* Apps: a phone home screen. On a phone it fills the whole screen; on a desktop it sits in an iPhone. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ph-page { display: flex; justify-content: center; padding-top: 2.75rem; padding-bottom: 1rem; }
.ph { position: relative; width: 426px; height: 896px; flex: none; }
.ph-btn { position: absolute; width: 4px; border-radius: 2px; background: #3a3b3e; }
.ph-btn.a { left: -3px; top: 150px; height: 30px; }
.ph-btn.b { left: -3px; top: 210px; height: 58px; }
.ph-btn.c { left: -3px; top: 282px; height: 58px; }
.ph-btn.d { right: -3px; top: 236px; height: 92px; }
.ph-frame { width: 100%; height: 100%; padding: 3px; border-radius: 66px; background: linear-gradient(145deg, #8a8b90 0%, #3a3b3f 35%, #55565b 70%, #2e2f33 100%); }
.ph-bezel { width: 100%; height: 100%; padding: 9px; border-radius: 63px; background: #000; }
.ph-screen {
  position: relative; width: 100%; height: 100%; border-radius: 54px; overflow: hidden;
  background: #13151f url(apps/wallpaper.jpg) center / cover no-repeat;
  color: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column; padding: 79px 0 12px;
}
.ph-status { position: absolute; left: 0; right: 0; top: 0; height: 54px; pointer-events: none; }
.ph-time { position: absolute; left: 30px; top: 12px; width: 66px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ph-island { position: absolute; left: 50%; top: 11px; width: 180px; height: 34px; margin-left: -90px; border-radius: 17px; background: #000; }
.ph-right { position: absolute; right: 28px; top: 12px; height: 30px; display: flex; align-items: center; gap: 6px; }
.ph-batt { position: relative; width: 29px; height: 15px; border-radius: 7px; background: rgba(255,255,255,0.35); overflow: hidden; }
.ph-batt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 64%; background: #fff; }
.ph-batt-fill.charging { background: #30d158; }
.ph-batt-fill.low { background: #ff453a; }
.ph-batt-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; color: #000; font-size: 10.5px; font-weight: 700; letter-spacing: -0.02em; }

.ph-widget { flex: none; margin: 0 28px; min-height: 162px; border-radius: 26px; background: rgba(54,61,92,0.95); box-shadow: 0 6px 20px rgba(0,0,0,0.18); padding: 13px 18px 12px; }
.ph-w-top { display: flex; justify-content: space-between; height: 68px; }
.ph-w-city { display: flex; align-items: center; gap: 5px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.ph-w-temp { font-size: 46px; font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; margin-left: -2px; }
.ph-w-right { display: flex; flex-direction: column; align-items: flex-end; font-size: 15px; font-weight: 500; line-height: 22px; }
.ph-w-right .ph-wi { width: 27px; height: 21px; margin-bottom: 4px; color: #fff; }
.ph-hours { display: flex; justify-content: space-between; margin: 12px -6px 0; }
.ph-hour { width: 50px; text-align: center; }
.ph-hour .h { font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em; color: rgba(255,255,255,0.7); line-height: 14px; }
.ph-hour .ph-wi { display: block; width: 25px; height: 20px; margin: 8px auto; color: #fff; }
.ph-hour .t { font-size: 15px; font-weight: 500; line-height: 18px; }

.ph-apps { flex: none; list-style: none; margin: 38px 0 0; padding: 0 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 24px; }
.ph-app { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-decoration: none; }
.ph-app img { width: 64px; height: 64px; border-radius: 16px; display: block; box-shadow: 0 4px 12px rgba(0,0,0,0.25); object-fit: cover; }
.ph-app span { max-width: 84px; font-size: 11.5px; font-weight: 500; line-height: 1.2; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.ph-app:hover img, .ph-app:focus-visible img { filter: brightness(1.08); }
.ph-app:focus-visible { outline-color: #fff; }

.ph-search { margin: auto auto 22px; flex: none; width: 86px; height: 30px; border-radius: 15px; background: rgba(110,110,115,0.45); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.92); }
.ph-dock { flex: none; margin: 0 13px; height: 102px; border-radius: 42px; background: rgba(170,165,175,0.5); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border: 1px solid rgba(255,255,255,0.18); box-sizing: border-box; display: flex; justify-content: space-evenly; align-items: center; }
.ph-dock-app { position: relative; top: -5px; width: 81px; height: 79px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ph-dock-app img { display: block; width: 81px; height: 79px; }
.ph-dock-app.shake { animation: ph-shake .45s ease; }
@keyframes ph-shake { 0% { transform: translateX(0); } 15% { transform: translateX(-7px); } 30% { transform: translateX(6px); } 45% { transform: translateX(-5px); } 60% { transform: translateX(4px); } 75% { transform: translateX(-2px); } 100% { transform: translateX(0); } }
.ph-bubble { position: absolute; left: 50%; bottom: 100%; margin-bottom: 3px; z-index: 5; transform: translateX(-50%) scale(0.6); transform-origin: 50% 100%; opacity: 0; transition: transform .18s cubic-bezier(.2,.9,.3,1.3), opacity .15s ease; white-space: nowrap; padding: 7px 11px; border-radius: 14px; background: rgba(252,252,254,0.97); color: #111; font-size: 12.5px; font-weight: 500; box-shadow: 0 4px 14px rgba(0,0,0,0.25); pointer-events: none; }
.ph-bubble::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); border-radius: 2px; z-index: -1; }
.ph-bubble.on { opacity: 1; transform: translateX(-50%) scale(1); }
/* The outer two bubbles hug their icon's side so they never run off the screen */
.ph-dock-app:first-child .ph-bubble { left: -6px; transform: scale(0.6); transform-origin: 40px 100%; }
.ph-dock-app:first-child .ph-bubble.on { transform: scale(1); }
.ph-dock-app:first-child .ph-bubble::after { left: 46px; margin-left: 0; }
.ph-dock-app:last-child .ph-bubble { left: auto; right: -6px; transform: scale(0.6); transform-origin: calc(100% - 40px) 100%; }
.ph-dock-app:last-child .ph-bubble.on { transform: scale(1); }
.ph-dock-app:last-child .ph-bubble::after { left: auto; right: 41px; margin-left: 0; }
.ph-home { display: none; }
@media (prefers-reduced-motion: reduce) { .ph-dock-app.shake { animation: none; } .ph-bubble { transition: none; } }

/* On a phone: no frame, no breadcrumb. The home screen is the page. */
@media (max-width: 520px) {
  body.apps-page { padding: 0; overflow: hidden; background: #13151f; }
  body.apps-page::before { display: none; }
  .apps-page .crumbs, .apps-page > footer { display: none; }
  .apps-page .ph-page { display: block; max-width: none; padding: 0; margin: 0; }
  .apps-page .ph { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; }
  .apps-page .ph-btn, .apps-page .ph-status { display: none; }
  .apps-page .ph-frame, .apps-page .ph-bezel { padding: 0; border-radius: 0; background: none; }
  .apps-page .ph-screen { border-radius: 0; padding: calc(env(safe-area-inset-top, 0px) + 20px) 0 calc(env(safe-area-inset-bottom, 0px) + 30px); }
  .apps-page .ph-widget { margin: 0 14px; }
  .apps-page .ph-apps { padding: 0 8px; margin-top: 30px; }
  .apps-page .ph-dock { margin: 0 10px; }
  .apps-page .ph-home { display: flex; position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); width: 140px; height: 24px; margin-left: -70px; align-items: center; justify-content: center; }
  .apps-page .ph-home span { display: block; width: 128px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.9); }
}
