:root {
  --studio: #12110e;
  --studio-2: #1b1915;
  --studio-3: #24211c;
  --paper: #f3eee4;
  --paper-2: #e8e0d2;
  --ink: #1b1714;
  --ink-soft: #4c453d;
  --mark: #c23a1a;
  --mark-deep: #9a2c14;
  --tungsten: #e0a045;
  --rule: rgba(243, 238, 228, 0.14);
  --paper-rule: rgba(27, 23, 20, 0.14);
  --focus: #e0a045;
  --serif: "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Noto Sans SC", "Archivo", "PingFang SC", sans-serif;
  --latin: "Archivo", "Noto Sans SC", sans-serif;
  --mono: "Source Code Pro", ui-monospace, monospace;
  --measure: 42rem;
  --page: 72rem;
  --radius: 2px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.6rem;
  background: var(--studio);
}

body {
  margin: 0;
  background: var(--studio);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--tungsten);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input {
  font: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  z-index: 80;
}

.skip:focus {
  top: 1rem;
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: transparent;
  z-index: 60;
  pointer-events: none;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--mark);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  background: color-mix(in srgb, var(--studio) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-brand {
  font-family: var(--latin);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tungsten);
  text-decoration: none;
  white-space: nowrap;
}

.nav-chapters {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.nav-chapters::-webkit-scrollbar {
  display: none;
}

.nav-chapters a {
  flex: none;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  text-decoration: none;
  font-size: 0.86rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.nav-chapters a[aria-current="true"],
.nav-chapters a:hover {
  color: var(--paper);
  background: var(--studio-3);
}

.nav-cta {
  flex: none;
  background: var(--mark);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

.hero {
  padding: 1.2rem 1.2rem 0;
}

.hero-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 3168 / 1344;
  object-fit: cover;
}

.mast {
  width: min(var(--page), calc(100% - 2.4rem));
  margin: 2.4rem auto 0;
}

.mast h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.4vw, 3.15rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
  max-width: 18em;
  text-wrap: pretty;
}

.mast .lede {
  max-width: 38rem;
  color: color-mix(in srgb, var(--paper) 78%, transparent);
  font-size: 1.05rem;
  margin: 1.1rem 0 0;
}

.mast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.mast-meta a {
  color: var(--tungsten);
}

.mast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--rule);
  background: var(--studio-2);
  color: var(--paper);
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.92rem;
  cursor: pointer;
}

.btn:hover {
  background: var(--studio-3);
}

.btn-mark {
  background: var(--mark);
  border-color: var(--mark);
}

.btn-mark:hover {
  background: var(--mark-deep);
}

.layout {
  width: min(var(--page), calc(100% - 2.4rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-bottom: 4rem;
}

.paper {
  background: var(--paper);
  color: var(--ink);
  margin: 2.4rem 0 0;
  padding: clamp(1.4rem, 3vw, 2.6rem);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

section[id],
figure[id],
article[id] {
  scroll-margin-top: 4.6rem;
}

.paper h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 2.2rem 0 0.7rem;
  text-wrap: pretty;
}

.paper h2:first-child {
  margin-top: 0;
}

.paper h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 1.8rem 0 0.55rem;
}

.paper p,
.paper li {
  font-size: 1.02rem;
  line-height: 1.9;
}

.paper p {
  margin: 0 0 1em;
}

.paper ul,
.paper ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.paper li + li {
  margin-top: 0.4em;
}

.paper blockquote {
  margin: 1.2rem 0;
  padding: 0 0 0 1rem;
  border-left: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
}

.bleed {
  margin: 2.4rem calc(50% - 50vw) 0;
  width: 100vw;
  background: var(--studio-2);
  padding: 1.2rem 0 1.6rem;
}

.bleed-inner {
  width: min(var(--page), calc(100% - 2.4rem));
  margin: 0 auto;
}

.media-card figcaption,
.video-card figcaption,
.bleed-inner > figcaption {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
}

.media-card img,
.video-card video {
  width: 100%;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.video-card video {
  cursor: pointer;
  background: #000;
}

.zoom-target {
  cursor: zoom-in;
}

.compare {
  position: relative;
  --pos: 50%;
  container-type: inline-size;
  aspect-ratio: 1.707 / 1;
  min-height: 240px;
  overflow: hidden;
  border-radius: var(--radius);
  user-select: none;
  touch-action: none;
  background: #000;
}

.compare-pane {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.compare-pane img {
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}

.compare-after img {
  width: 100%;
  object-position: right center;
}

.compare-before {
  width: var(--pos);
  border-right: 2px solid var(--paper);
}

.compare-before img {
  width: 100cqi;
  object-position: left center;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--paper);
  transform: translateX(-1px);
  pointer-events: none;
}

.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  border: 2px solid var(--paper);
  background: var(--ink);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.compare-range {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

.compare-label {
  position: absolute;
  top: auto;
  bottom: 0.7rem;
  font-family: var(--latin);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background: #000;
  color: var(--paper);
  pointer-events: none;
}

.compare-label.start {
  left: 0.7rem;
}

.compare-label.end {
  right: 0.7rem;
  color: var(--tungsten);
}

.prompt {
  background: var(--ink);
  color: var(--paper);
  margin: 1.2rem 0;
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--radius);
}

.prompt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.prompt-bar strong {
  font-family: var(--serif);
  font-weight: 600;
  margin-right: auto;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
}

.seg button {
  background: transparent;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  border: 0;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.seg button[aria-pressed="true"] {
  background: var(--studio-3);
  color: var(--paper);
}

.copy {
  background: var(--mark);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.copy.done {
  background: #2f6b3a;
}

.prompt pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: color-mix(in srgb, var(--paper) 88%, transparent);
}

.tells {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 0;
}

.tell {
  background: transparent;
  border: 1px solid var(--paper-rule);
  color: inherit;
  text-align: left;
  padding: 0.85rem 1rem;
  cursor: pointer;
  border-radius: var(--radius);
  width: 100%;
}

.tell[aria-expanded="true"] {
  background: var(--paper-2);
}

.tell b {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
}

.tell span {
  display: none;
  margin-top: 0.45rem;
  color: var(--ink-soft);
}

.tell[aria-expanded="true"] span {
  display: block;
}

.laws {
  counter-reset: law;
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--paper-rule);
}

.law {
  counter-increment: law;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--paper-rule);
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.6rem;
}

.law::before {
  content: counter(law);
  font-family: var(--latin);
  font-weight: 600;
  color: var(--mark);
}

.law strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.law p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

.sheet {
  display: grid;
  gap: 0.45rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--paper-rule);
}

.step input {
  margin-top: 0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--mark);
}

.step.done .step-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.step-title {
  font-family: var(--serif);
  font-weight: 600;
}

.step small {
  display: block;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.sheet-progress {
  font-family: var(--latin);
  font-size: 0.88rem;
  color: var(--mark-deep);
  margin-bottom: 0.4rem;
}

.yt {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.callout {
  background: var(--paper-2);
  padding: 1rem 1.1rem;
  margin: 1.1rem 0;
}

.agency {
  display: grid;
  gap: 1rem;
}

.agency article {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-rule);
}

.agency h3 {
  margin-top: 0;
}

.footer {
  margin-top: 3rem;
  padding: 2.4rem 1.2rem 3.4rem;
  border-top: 1px solid var(--rule);
  background: #0c0b09;
}

.footer-inner {
  width: min(var(--page), 100%);
  margin: 0 auto;
}

.cite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.2rem;
  align-items: start;
}

.cite img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.cite h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.cite p {
  margin: 0 0 0.55rem;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  font-size: 0.95rem;
}

.cite a {
  color: var(--tungsten);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  margin-top: 1.4rem;
  font-size: 0.92rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1.5rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  cursor: zoom-out;
}

.prompt textarea[hidden] {
  display: none;
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  transform: translateY(120%);
  transition: transform 0.25s ease;
  z-index: 50;
  font-size: 0.88rem;
}

.toast.show {
  transform: none;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav-cta {
    display: none;
  }

  .paper p,
  .paper li {
    font-size: 1rem;
    line-height: 1.85;
  }

  .cite {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .toast {
    transition: none;
  }
}
