:root {
  --bg: #000;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #8b8b95;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #f6821f;
  --accent-soft: rgba(246, 130, 31, 0.14);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: #000; padding: .6rem 1rem; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 1rem; }

.layout { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: 100vh; }

.portrait {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: radial-gradient(60% 45% at 40% 100%, rgba(246, 130, 31, 0.18), transparent 70%), #000;
}
.portrait img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0%;
  -webkit-mask-image: linear-gradient(to right, #000 62%, transparent 100%), linear-gradient(to top, transparent 0, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 62%, transparent 100%), linear-gradient(to top, transparent 0, #000 22%);
  mask-composite: intersect;
  animation: fade 1.2s ease-out both;
}

.content {
  position: relative;
  padding: clamp(2.5rem, 8vh, 6rem) clamp(1.5rem, 5vw, 5rem) 3rem 0;
  max-width: 46rem;
}
.content::before {
  content: ""; position: absolute; inset: 0 -20% auto -10%; height: 40rem; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 30% 20%, var(--accent-soft), transparent 70%);
}

.hero { min-height: min(62vh, 36rem); display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 3rem; animation: rise .9s .1s cubic-bezier(.2, .7, .2, 1) both; }

.eyebrow {
  margin: 0 0 1.25rem; color: var(--accent);
  font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(3rem, 7.2vw, 5.75rem);
  line-height: 1; letter-spacing: -.04em; font-weight: 700;
  text-wrap: balance;
}

.sub { margin: -1rem 0 2rem; color: var(--faint); font-size: .95rem; }
.lead { margin: 0 0 2rem; max-width: 34rem; font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.5; color: #d4d4d8; text-wrap: pretty; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.btn {
  display: inline-flex; align-items: center; padding: .8rem 1.35rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; text-decoration: none; border: 1px solid var(--line);
  transition: background .2s, border-color .2s, transform .2s, color .2s;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; }
.btn-primary:hover { background: #ff9340; border-color: #ff9340; transform: translateY(-1px); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .05); }

section { padding: 3.5rem 0 0; border-top: 1px solid var(--line); margin-top: 3.5rem; }
section:first-of-type { margin-top: 0; }

h2 { margin: 0 0 1.5rem; font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h3 { margin: 0 0 .4rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }

p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.cards li {
  padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  transition: border-color .2s, transform .2s;
}
.cards li:hover { border-color: rgba(246, 130, 31, .5); transform: translateY(-2px); }
.cards p { margin: 0; color: var(--muted); font-size: 1rem; }

.posts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.posts li { display: grid; gap: .15rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.posts li:last-child { border-bottom: 0; }
.posts strong { font-weight: 600; letter-spacing: -.01em; }
.posts span:not(.tag) { color: var(--muted); font-size: .95rem; }
.tag { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--faint); font-size: .875rem; }
footer p { margin: 0 0 .5rem; }
footer a { color: var(--muted); text-underline-offset: 3px; }
footer a:hover { color: var(--fg); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 899px) {
  .layout { display: block; }
  .portrait { position: relative; height: min(78vh, 40rem); background: #000; }
  .portrait img {
    object-position: 50% 0%;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 35%);
    mask-image: linear-gradient(to top, transparent 0, #000 35%);
  }
  .content { padding: 0 1.5rem 3rem; margin-top: -5rem; max-width: 40rem; margin-inline: auto; }
  .content::before { display: none; }
  .hero { min-height: 0; padding-bottom: 2.5rem; }
}

@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- shared components ---------- */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.post-link {
  display: grid; gap: .3rem; padding: 1.25rem 1.4rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  transition: border-color .2s, transform .2s;
}
.post-link:hover { border-color: rgba(246, 130, 31, .55); transform: translateY(-2px); }
.post-link strong { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.post-link .desc { color: var(--muted); font-size: .98rem; line-height: 1.5; }
.post-link .byline { color: var(--faint); font-size: .85rem; }
.more { margin: 1.25rem 0 0; }
.more a, .muted a, .prose a, .post-head a, .crumbs a, .lead-sm a { text-underline-offset: 3px; text-decoration-color: rgba(246, 130, 31, .6); }
.more a:hover, .muted a:hover, .prose a:hover { color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.timeline li { position: relative; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -4px; top: .55rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline .when { display: block; color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.timeline h3 { margin: .25rem 0 .35rem; }
.timeline p { margin: 0; color: var(--muted); font-size: 1rem; }
.subhead { margin: 2.5rem 0 1rem; font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.plain { margin: 0; padding-left: 1.2rem; color: var(--muted); display: grid; gap: .5rem; }

.site-footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--faint); font-size: .875rem; }
.site-footer p { margin: 0 0 .5rem; }
.site-footer a { color: var(--muted); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--fg); }

/* ---------- inner pages ---------- */
body.inner { background: radial-gradient(60rem 30rem at 50% -10rem, rgba(246, 130, 31, .09), transparent 70%), #000; }
body.inner .site-footer { max-width: 46rem; margin: 4rem auto 0; padding: 2rem 1.5rem 3rem; }
.site-header {
  max-width: 64rem; margin: 0 auto; padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.site-header nav { display: flex; gap: 1.4rem; font-size: .95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--fg); }
.page { max-width: 46rem; margin: 0 auto; padding: 2.5rem 1.5rem 0; }
.page h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.lead-sm { margin: 0 0 1.5rem; font-size: 1.2rem; line-height: 1.55; color: #d4d4d8; text-wrap: pretty; }
.crumbs { margin: 0 0 1.5rem; font-size: .875rem; color: var(--faint); }
.crumbs a { color: var(--muted); }
.post-head { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.post-head .tag { margin: 0 0 .75rem; }
.post-head .byline { margin: 0; color: var(--faint); font-size: .9rem; }
.post-head .byline a { color: var(--muted); }

.toc { margin: 0 0 2.5rem; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.toc p { margin: 0 0 .6rem; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; font-size: .98rem; }
.toc a { color: #d4d4d8; text-decoration: none; }
.toc a:hover { color: var(--accent); }

.prose { font-size: 1.0625rem; line-height: 1.75; color: #e4e4e7; }
.prose h2 { margin: 3rem 0 1rem; font-size: 1.65rem; line-height: 1.25; letter-spacing: -.02em; color: var(--fg); text-transform: none; font-weight: 650; }
.prose h3 { margin: 2.25rem 0 .75rem; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.01em; color: var(--fg); }
.prose h2, .prose h3 { scroll-margin-top: 1.5rem; }
.prose .anchor { color: inherit; text-decoration: none; }
.prose .anchor:hover::after { content: " #"; color: var(--accent); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose em { color: var(--muted); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; padding: .12em .4em; border-radius: 5px; background: rgba(255, 255, 255, .08); color: #fde7d3; }
.prose pre { margin: 0 0 1.5rem; padding: 1.1rem 1.25rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #0b0b0d; line-height: 1.6; }
.prose pre code { padding: 0; background: none; font-size: .85rem; color: #e4e4e7; }

.fig { margin: 2rem -1rem; padding: .75rem; border: 1px solid var(--line); border-radius: 14px; background: #111113; }
.fig > a { display: block; }
.fig img { display: block; width: 100%; height: auto; border-radius: 8px; }
.fig figcaption { margin: .6rem .25rem .1rem; font-size: .85rem; line-height: 1.5; color: var(--muted); }

.table-wrap { margin: 1.5rem -1rem 1.75rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: .9rem; line-height: 1.55; }
.prose th, .prose td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { position: sticky; top: 0; background: #111113; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { min-width: 9rem; }

.related { margin-top: 4rem; }
.related h2 { margin-bottom: 1rem; }

@media (max-width: 899px) {
  .fig, .table-wrap { margin-inline: 0; }
  .site-header nav { gap: 1rem; font-size: .9rem; }
}

@media (min-width: 900px) {
  .table-wrap, .fig { width: min(60rem, calc(100vw - 3rem)); margin-left: 50%; margin-right: 0; transform: translateX(-50%); }
}

.fig.diagram, .fig.matrix-fig, .fig.poster-fig { overflow-x: auto; }
.fig.mini { max-width: 34rem; margin: 1rem 0 1.25rem; padding: .5rem; }
@media (min-width: 900px) {
  .fig.mini { width: auto; margin-left: 0; transform: none; }
}

@media (min-width: 900px) {
  .fig.matrix-fig, .fig.poster-fig { width: min(76rem, calc(100vw - 3rem)); }
}

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { padding: .5rem .95rem; border: 1px solid var(--line); border-radius: 999px; font-size: .95rem; color: #d4d4d8; background: rgba(255, 255, 255, .03); }
.pubs { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 1rem; counter-reset: p; }
.pubs li { display: grid; gap: .15rem; padding-left: 1.6rem; position: relative; counter-increment: p; }
.pubs li::before { content: counter(p); position: absolute; left: 0; top: .1rem; font-size: .8rem; font-weight: 600; color: var(--accent); }
.pubs a { text-underline-offset: 3px; text-decoration-color: rgba(246, 130, 31, .6); font-weight: 500; line-height: 1.4; }
.pubs a:hover { color: var(--accent); }
.pubs span { color: var(--faint); font-size: .9rem; }

.bg-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .65rem; color: var(--muted); font-size: .98rem; line-height: 1.55; }
.bg-list li { display: grid; grid-template-columns: 8.2rem 1fr; gap: 0 1rem; }
.bg-list .when { color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding-top: .28rem; }
.bg-list .what p { margin: 0; }
.bg-list strong { color: var(--fg); font-weight: 600; }
.small { font-size: .9rem; }
@media (max-width: 599px) { .bg-list li { grid-template-columns: 1fr; }  }

.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.talks li { display: grid; gap: .1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.talks li:last-child { border-bottom: 0; }
.talks strong { font-weight: 600; line-height: 1.35; }
.talks a { text-underline-offset: 3px; text-decoration-color: rgba(246, 130, 31, .6); }
.talks a:hover { color: var(--accent); }
.talks span { color: var(--muted); font-size: .92rem; line-height: 1.45; }

.series { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.series p { margin: 0 0 .6rem; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.series ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; counter-reset: s; }
.series li { counter-increment: s; }
.series a, .series span { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; text-decoration: none; color: var(--muted); }
.series a:hover { color: var(--fg); border-color: rgba(255, 255, 255, .35); }
.series span[aria-current] { color: #000; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 0; }
.pager a { display: grid; gap: .25rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-weight: 600; line-height: 1.35; transition: border-color .2s; }
.pager a:hover { border-color: rgba(246, 130, 31, .55); }
.pager a span { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }
@media (max-width: 599px) { .pager { grid-template-columns: 1fr; } .pager .next, .pager .prev { grid-column: 1; text-align: left; } }

.guide-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); }
.guide-main { display: grid; gap: .35rem; padding: 1.5rem 1.6rem 1.3rem; text-decoration: none; transition: background .2s; }
.guide-main:hover { background: rgba(246, 130, 31, .07); }
.guide-main strong { font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.25; }
.guide-main .desc { color: var(--muted); font-size: 1rem; line-height: 1.55; max-width: 36rem; }
.guide-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.guide-steps li + li { border-top: 1px solid var(--line); }
.guide-steps a { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .75rem; padding: .85rem 1.6rem; text-decoration: none; transition: background .2s; }
.guide-steps a:hover { background: rgba(255, 255, 255, .05); }
.guide-steps .n { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid rgba(246, 130, 31, .6); color: var(--accent); font-size: .72rem; font-weight: 700; }
.guide-steps .t { font-weight: 500; line-height: 1.35; }
.guide-steps .m { color: var(--faint); font-size: .85rem; white-space: nowrap; }
@media (max-width: 599px) { .guide-main, .guide-steps a { padding-inline: 1.1rem; } .guide-steps a { grid-template-columns: 2rem 1fr; } .guide-steps .m { display: none; } }
.bg-list a { text-underline-offset: 3px; text-decoration-color: rgba(246, 130, 31, .6); color: #d4d4d8; }
.bg-list a:hover { color: var(--accent); }
.legal h1 { margin-bottom: 1.5rem; }
.legal h2 { margin-top: 2.5rem; }
.legal h3 { margin-top: 1.75rem; font-size: 1.1rem; }

/* ---------- phones: nothing scrolls sideways ---------- */
@media (max-width: 899px) {
  .fig.diagram, .fig.matrix-fig, .fig.poster-fig { overflow: visible; }
}
@media (max-width: 599px) {
  .fig.diagram:not(.mini), .fig.poster-fig { margin-inline: -1.5rem; padding: .5rem .25rem; border-radius: 0; border-inline: 0; }
}
@media (max-width: 899px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; margin: 1.25rem 0 1.5rem; }
  .prose table:not(.mx), .prose table:not(.mx) tbody, .prose table:not(.mx) tr { display: block; width: 100%; min-width: 0; }
  .prose table:not(.mx) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .prose table:not(.mx) tr { margin: 0 0 .85rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0b0d; }
  .prose table:not(.mx) td { display: block; min-width: 0; padding: .6rem .95rem; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
  .prose table:not(.mx) td::before { content: attr(data-label); display: block; margin-bottom: .1rem; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .prose table:not(.mx) td:not([data-label])::before { content: none; }
  .prose table:not(.mx) td:first-child { padding: .75rem .95rem; background: rgba(255, 255, 255, .05); font-weight: 600; color: var(--fg); }
  .prose table:not(.mx) td:first-child::before { content: none; }
  .prose table:not(.mx) td:last-child { border-bottom: 0; }
  .prose table:not(.mx) td:empty { display: none; }
}
@media (max-width: 420px) {
  .site-header { flex-wrap: wrap; gap: .5rem 1rem; }
  .site-header nav { gap: .9rem; }
}
@media (min-width: 900px) {
  .fig.narrow { width: min(42rem, calc(100vw - 3rem)); }
}
