/* Rimembra blog, legal pages and 404: the light theme of design system v2.0 (Layered Mind), tuned for reading. */
:root {
  --night: #05060a; --day: #f8f8f6; --white: #ffffff;
  --light-ink: #eeeef2; --muted-on-dark: #a3a4ad; /* for the dark closing quote */
  --ink: #121317;            /* dark-ink: 17.46:1 on day */
  --ink-muted: #585a62;      /* muted-on-light: 6.47:1 on day; also the control border */
  --control-border: #585a62;
  --hairline: #dcdce0;       /* decorative dividers only */
  --surface: var(--day); --surface-raised: var(--white);
  --action: #121317; --on-action: #f8f8f6; --focus-ring: #121317;
  --ember: #ff7a4d;          /* decorative only on day: never text */
  --sans: "Geist", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: 20px; --content-max: 1200px; --control-height: 48px; --target-min: 44px;
  --radius-input: 12px; --radius-card: 20px; --radius-pill: 999px;
  --ease: cubic-bezier(.23, 1, .32, 1); --fast: 160ms; --base: 240ms; --reveal: 600ms;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 48px; } }
@media (prefers-reduced-motion: reduce) { :root { --fast: 0ms; --base: 0ms; --reveal: 0ms; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--day); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--day); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
::selection { background: var(--ink); color: var(--day); }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
p { text-wrap: pretty; }
button, a { touch-action: manipulation; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: calc(var(--content-max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 16px; top: -100px; z-index: 40; background: var(--action); color: var(--on-action); padding: 8px 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; text-decoration: none; }
.skip:focus { top: 8px; }
:where(a, button, input, summary):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(248, 248, 246, 0.92); border-bottom: 1px solid var(--hairline); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.home { display: inline-flex; align-items: center; min-height: var(--target-min); padding: 8px 0; border-radius: 8px; }
.home img { display: block; height: auto; }
.home .lockup { width: 180px; }
.home .symbol { width: 48px; display: none; }
.header-nav { display: flex; align-items: center; gap: 24px; }
.nav-link { display: inline-flex; align-items: center; min-height: var(--target-min); font-size: 16px; color: var(--ink-muted); text-decoration: none; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-height); min-width: var(--target-min); padding: 0 24px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font: 500 16px/1.2 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--action); color: var(--on-action);
  transition: transform var(--fast) var(--ease), background-color var(--base) var(--ease);
}
.btn:hover:not(:disabled):not([aria-busy="true"]) { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[aria-busy="true"] { cursor: progress; }
.btn-sm { min-height: var(--target-min); padding: 0 16px; font-size: 15px; }
.btn .short { display: none; }
.text-link { display: inline-flex; align-items: center; min-height: var(--target-min); font-weight: 500; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Blog index ---------- */
.blog-hero { padding: 96px 0 48px; }
.blog-hero h1 { font-size: clamp(40px, 6vw, 64px); }
.blog-hero p { margin-top: 16px; max-width: 46ch; font-size: clamp(20px, 2vw, 24px); color: var(--ink-muted); }

.featured { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 48px 0 64px; border-top: 1px solid var(--hairline); }
.featured.has-cover { grid-template-columns: 1.1fr 1fr; align-items: center; }
.meta { font: 400 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.featured h2 { margin-top: 16px; font-size: clamp(30px, 4vw, 40px); }
.featured h2 a { text-decoration: none; }
.featured p { margin-top: 16px; color: var(--ink-muted); max-width: 60ch; }
.featured .text-link { display: inline-block; margin-top: 24px; }
.cover-frame { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--hairline); background: var(--white); }
.cover-frame img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

.more-head { margin: 24px 0 8px; font-size: 16px; font-weight: 500; color: var(--ink-muted); }
.post-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.post-rows a { display: grid; grid-template-columns: 11rem 1fr auto; gap: 8px 32px; align-items: baseline; padding: 24px 4px; border-bottom: 1px solid var(--hairline); text-decoration: none; }
.post-rows time { font: 400 12px/1.4 var(--mono); letter-spacing: 0.08em; color: var(--ink-muted); text-transform: uppercase; }
.post-rows .t { font-weight: 500; font-size: 22px; letter-spacing: -0.015em; line-height: 1.25; }
.post-rows .d { grid-column: 2; color: var(--ink-muted); font-size: 16px; max-width: 60ch; }
.post-rows .go { grid-row: 1; grid-column: 3; color: var(--ink-muted); }

.empty { padding: 48px 0 24px; border-top: 1px solid var(--hairline); }
.empty h2 { font-size: 28px; }
.empty p { margin-top: 12px; color: var(--ink-muted); max-width: 60ch; }

/* ---------- Follow the blog (/blog/feed/) ---------- */
.feed { padding-bottom: 32px; }
.feed-box { max-width: 720px; padding: 32px; border: 1px solid var(--hairline); border-radius: var(--radius-card); background: var(--surface-raised); border-top-width: 1px; }
.feed-box h2 { font-size: 24px; }
.feed-box > p { margin-top: 12px; color: var(--ink-muted); max-width: 60ch; }
.feed-box .field-row { margin-top: 24px; }
.feed-box .input { font-family: var(--mono); font-size: 15px; }
.feed-box .help { margin-top: 8px; min-height: 1.4em; }
.feed .more-head { margin-top: 64px; }

/* ---------- Article and legal pages ---------- */
.post-head { padding: 96px 0 32px; }
.post-head .wrap { max-width: calc(760px + 2 * var(--gutter)); }
.post-head .back { display: inline-flex; gap: 8px; align-items: center; min-height: var(--target-min); font-size: 16px; color: var(--ink-muted); margin-bottom: 32px; text-decoration: none; }
.post-head .back:hover { color: var(--ink); }
.post-head h1 { margin-top: 16px; max-width: 20em; font-size: clamp(40px, 6vw, 64px); }
.post-head .lede { margin-top: 16px; max-width: 46ch; font-size: clamp(20px, 2vw, 24px); color: var(--ink-muted); }
.post-cover { margin: 8px auto 0; max-width: 1100px; padding: 0 var(--gutter); }
.post-cover .cover-frame img { aspect-ratio: 21 / 9; }

.prose { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: 48px var(--gutter) 24px; font-size: 18px; line-height: 1.7; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { margin-top: 2em; font-size: clamp(26px, 3vw, 32px); }
.prose h3 { margin-top: 1.8em; font-size: 24px; }
.prose h4, .prose h5, .prose h6 { margin-top: 1.6em; font-weight: 500; font-size: 18px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--ink-muted); }
.prose blockquote { margin: 1.6em 0; padding: 0; font-size: 24px; line-height: 1.45; letter-spacing: -0.01em; }
.prose blockquote > * + * { margin-top: 0.8em; }
.prose hr { border: 0; height: 1px; background: var(--hairline); margin: 2.6em 0; }
.prose code { font-family: var(--mono); font-size: 0.88em; padding: 0.15em 0.4em; border-radius: 6px; background: rgba(18, 19, 23, 0.06); }
.prose pre { overflow-x: auto; padding: 20px 24px; border-radius: var(--radius-input); background: #10121b; color: #eeeef2; font-size: 15px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-input); }
.prose figure { margin: 48px 0 56px; min-width: 0; }
.prose figure + * { margin-top: 0; }
.prose figcaption { margin-top: 16px; max-width: 62ch; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.prose iframe, .prose video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius-input); }
.prose .table-wrap { overflow-x: auto; margin-top: 1.6em; margin-bottom: 1.6em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose th { font-size: 13px; font-weight: 500; color: var(--ink-muted); border-bottom-color: var(--control-border); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose .right { text-align: right; } .prose .center { text-align: center; }

/* Footnote links and the references list */
.prose sup.fn { line-height: 0; }
.prose sup.fn a { padding: 0 2px; font: 400 11px/1 var(--mono); color: var(--ink-muted); text-decoration: none; }
.prose sup.fn a:hover { color: var(--ink); }
.prose .references { list-style: none; padding: 0; counter-reset: ref; display: flex; flex-direction: column; gap: 16px; }
.prose .references li { counter-increment: ref; display: grid; grid-template-columns: 32px minmax(0, 1fr); margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-muted); scroll-margin-top: 96px; }
.prose .references li::before { content: counter(ref); font: 400 13px/1.7 var(--mono); color: var(--ink); }
.prose .references em { font-style: normal; color: var(--ink); }
.prose .references a { overflow-wrap: anywhere; }
.prose .references .back-ref { margin-left: 4px; text-decoration: none; color: var(--ink-muted); }
.prose sup.fn a:target, .prose .references li:target { color: var(--ink); }
.prose sup.fn a { scroll-margin-top: 120px; }

/* Closing statement: a dark block, like the end of the story on the home page */
.prose .closing-quote { margin: 64px 0; padding: clamp(40px, 7vw, 72px) clamp(24px, 5vw, 56px); border-radius: var(--radius-card); background: var(--night); color: var(--light-ink); }
.prose .closing-quote::before { content: ""; display: block; width: 6px; height: 6px; margin-bottom: 32px; border-radius: 999px; background: var(--ember); }
.prose .closing-quote blockquote { margin: 0; max-width: 22ch; font-size: clamp(28px, 4.4vw, 44px); font-weight: 500; line-height: 1.12; letter-spacing: -0.025em; }
.prose .closing-quote blockquote p { text-wrap: balance; }
.prose .closing-quote + hr { margin-top: 0; }

.post-nav { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: 32px var(--gutter) 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { display: block; padding: 16px 20px; border-radius: var(--radius-card); border: 1px solid var(--hairline); background: var(--surface-raised); text-decoration: none; transition: border-color var(--base) var(--ease); }
.post-nav a:hover { border-color: var(--control-border); }
.post-nav small { display: block; font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); margin-bottom: 4px; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ---------- Subscribe block ---------- */
.subscribe { padding: 96px 0; }
.subscribe .wrap { max-width: calc(760px + 2 * var(--gutter)); }
.subscribe h2 { font-size: clamp(30px, 4vw, 40px); }
.subscribe .lede { margin-top: 12px; max-width: 52ch; color: var(--ink-muted); }
.waitlist-form { margin-top: 32px; width: 100%; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 500; line-height: 1.4; }
.field-row { display: flex; gap: 12px; }
.input { flex: 1; min-width: 0; min-height: var(--control-height); padding: 0 16px; border-radius: var(--radius-input); border: 1px solid var(--control-border); background: var(--surface-raised); color: var(--ink); font: 400 16px/1.4 var(--sans); transition: border-color var(--fast) var(--ease); }
.input::placeholder { color: var(--ink-muted); }
.input:hover { border-color: var(--ink); }
.input[aria-invalid="true"] { border: 2px solid var(--ink); }
.help { font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.error { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.55; font-weight: 500; }
.error[hidden] { display: none; }
.icon { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.success { display: flex; gap: 12px; align-items: flex-start; max-width: 560px; margin-top: 32px; padding: 16px 24px; border-radius: var(--radius-card); background: var(--surface-raised); border: 1px solid var(--hairline); }
.success[hidden] { display: none; }
.success strong { display: block; font-weight: 500; font-size: 16px; line-height: 1.4; }
.success span { color: var(--ink-muted); font-size: 14px; }

/* ---------- 404 ---------- */
.lost { padding: 128px 0 96px; }
.lost h1 { font-size: clamp(40px, 6vw, 64px); }
.lost p { margin-top: 16px; color: var(--ink-muted); font-size: clamp(20px, 2vw, 24px); }
.lost .actions { margin-top: 32px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--hairline); }
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding-top: 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
footer .lockup { display: block; width: 180px; height: auto; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: var(--target-min); font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
footer small { color: var(--ink-muted); font-size: 12px; }

/* Legal pages while they are drafts: a word, not a colour, carries the status */
.draft-banner { display: inline-block; margin-bottom: 16px; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--control-border); font: 400 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }

/* ---------- Entry motion: short and optional ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(12px); animation: rise var(--reveal) var(--ease) forwards; }
  .rise.d1 { animation-delay: 80ms; } .rise.d2 { animation-delay: 160ms; } .rise.d3 { animation-delay: 240ms; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Small screens ---------- */
@media (max-width: 767px) {
  body { font-size: 17px; }
  .header-inner { min-height: 64px; gap: 16px; }
  .header-nav { gap: 16px; }
  .btn .long { display: none; } .btn .short { display: inline; }
  .blog-hero, .post-head { padding-top: 64px; }
  .featured.has-cover { grid-template-columns: 1fr; }
  .post-rows a { grid-template-columns: 1fr auto; padding: 20px 2px; }
  .post-rows time { grid-column: 1 / -1; } .post-rows .t { grid-column: 1; } .post-rows .d { grid-column: 1 / -1; } .post-rows .go { grid-row: 2; grid-column: 2; }
  .prose { font-size: 17px; padding-top: 32px; }
  .prose blockquote { font-size: 20px; }
  .prose figure { margin: 36px 0 44px; }
  .prose .closing-quote { margin: 48px 0; }
  .post-cover .cover-frame img { aspect-ratio: 16 / 10; }
  .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; }
  .field-row { flex-direction: column; } .field-row .btn { width: 100%; }
  footer .wrap { flex-direction: column; align-items: flex-start; }
}
/* Below 360px the signature would drop under its 180px minimum: use the symbol */
@media (max-width: 359px) {
  .home .lockup { display: none; } .home .symbol { display: block; }
}
@media (max-width: 479px) { .header-nav .nav-link { display: none; } }
