/*
  Korezu website — a printed collection catalogue.
  Gallery ivory and deep ink with a muted brass accent (midnight and champagne in dark mode), serif titles,
  contents with dotted leaders (like the contents page in the app), and the double rule and
  machine-readable line of the passport skin. The app's yellow stays in the logo mark only.
  No web fonts and no scripts: the site loads nothing from other servers.
*/
:root {
  --paper: #f7f6f2;
  --paper-2: #efede7;
  --sheet: #ffffff;
  --ink: #131418;
  --muted: #6c6b66;
  --rule: #e2dfd7;
  --accent: #9a7a4e;
  --accent-text: #7f6340;
  --mark: #131418;
  --brand: #e6c300;
  --shelf-top: #e3e0d9;
  --shelf-bottom: #c9c5bc;
  --shelf-shadow: rgba(19, 20, 24, 0.28);
  --button: #131418;
  --button-ink: #f7f6f2;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --page: 1140px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0f12;
    --paper-2: #15161a;
    --sheet: #16171b;
    --ink: #edebe6;
    --muted: #9c9a93;
    --rule: #2a2b30;
    --accent: #c9a76e;
    --accent-text: #c9a76e;
    --mark: #edebe6;
    --shelf-top: #303136;
    --shelf-bottom: #1d1e22;
    --shelf-shadow: rgba(0, 0, 0, 0.6);
    --button: #edebe6;
    --button-ink: #0e0f12;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.page { max-width: var(--page); margin: 0 auto; padding: 0 28px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--sheet); padding: 6px 12px; z-index: 5; }

/* The app mark drawn with CSS: four squares and the yellow bar. */
.mark { display: inline-grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 7%; width: 26px; height: 26px; flex: none; }
.mark i { border-radius: 20%; background: var(--mark); }
.mark i:nth-child(1) { grid-column: 2; grid-row: 1 / 4; background: var(--brand); }
.mark i:nth-child(2) { grid-column: 1; grid-row: 2; }
.mark i:nth-child(3) { grid-column: 1; grid-row: 3; }
.mark i:nth-child(4) { grid-column: 3; grid-row: 1; }
.mark i:nth-child(5) { grid-column: 3; grid-row: 2; }

/* Masthead with the passport double rule */
.masthead { border-bottom: 3px double var(--ink); }
.masthead .page { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font: 700 23px/1 var(--serif); letter-spacing: 0.01em; text-decoration: none; }
.masthead nav { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.masthead nav a { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: 6px 0; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }

.eyebrow { font: 600 13px/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); margin: 0; }
.serif { font-family: var(--serif); }

/* Home: title page with a shelf of covers */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: end; padding: 76px 0 0; }
.hero h1 { font: 600 clamp(46px, 6.6vw, 88px)/1.0 var(--serif); letter-spacing: -0.02em; margin: 18px 0 22px; }
.hero .lead { font-size: 20px; color: var(--muted); max-width: 32ch; margin: 0; }
/* Store buttons: the store's logo and a two-line label. Before launch they carry no link. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 6px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-width: 190px; height: 58px; padding: 0 24px 0 18px; border-radius: 14px; background: var(--button); color: var(--button-ink); text-decoration: none; box-shadow: 0 10px 24px -16px var(--shelf-shadow); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.store svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store .play { width: 21px; height: 21px; margin: 0 1px 0 2px; }
.store span { display: grid; gap: 1px; text-align: left; }
.store small { font: 500 11.5px/1.15 var(--sans); letter-spacing: 0.02em; opacity: 0.7; }
.store strong { font: 600 19px/1.15 var(--sans); letter-spacing: -0.01em; }
.store[href]:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -14px var(--shelf-shadow); }
.stores-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.shelf { position: relative; padding: 0 18px; }
.shelf .row { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.shelf img { width: calc((100% - 30px) / 4); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.22)); }
.shelf img.lean { transform: rotate(-7deg); transform-origin: bottom left; margin-left: 10px; }
.shelf .plank { height: 14px; margin: 0 -18px; background: linear-gradient(var(--shelf-top), var(--shelf-bottom)); border-radius: 2px; box-shadow: inset 0 1px rgba(255, 255, 255, 0.35), 0 16px 24px -14px var(--shelf-shadow); }
.shelf .row + .plank { margin-top: -2px; }
.shelf .row.second { margin-top: 26px; }

/* Contents with dotted leaders, as in the app */
.contents { margin: 88px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.contents li { border-bottom: 1px solid var(--rule); }
.contents a { display: flex; align-items: baseline; gap: 16px; padding: 16px 0; text-decoration: none; }
.contents .no { font: 15px var(--mono); color: var(--muted); min-width: 2.4em; }
.contents .title { font: 500 clamp(20px, 2.4vw, 26px)/1.2 var(--serif); }
.contents .lead-dots { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-6px); min-width: 24px; }
.contents .page-no { font: 15px var(--mono); color: var(--muted); white-space: nowrap; }
.contents a:hover .title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Chapters on the home page */
.chapter { padding: 96px 0 0; }
.chapter-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--ink); padding-top: 18px; margin-bottom: 30px; }
.chapter-head .no { font: 14px var(--mono); color: var(--accent-text); padding-top: 10px; }
.chapter-head h2 { font: 600 clamp(32px, 4.4vw, 50px)/1.08 var(--serif); letter-spacing: -0.015em; margin: 0 0 10px; }
.chapter-head p { margin: 0; color: var(--muted); max-width: 60ch; }

.index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.index li { break-inside: avoid; border-top: 1px solid var(--rule); padding: 14px 0 16px; }
.index strong { display: block; font: 600 20px/1.3 var(--serif); }
.index span { color: var(--muted); font-size: 15.5px; }

.skins { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 26px; margin: 0; padding: 0; list-style: none; }
.skins figure { margin: 0; }
.skins img { display: block; width: 100%; max-width: 190px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.18)); }
.skins figcaption { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; }
.skins figcaption strong { display: block; font: 600 18px/1.3 var(--serif); }
.skins figcaption span { color: var(--muted); font-size: 15px; }

.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.notes > div { padding: 18px 24px 22px 0; }
.notes > div + div { border-left: 1px solid var(--rule); padding-left: 24px; }
.notes h3 { font: 600 20px/1.3 var(--serif); margin: 0 0 6px; }
.notes p { margin: 0; color: var(--muted); font-size: 16px; }

.promise { background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--accent); padding: 26px 30px; }
.promise h3 { font: 600 24px/1.25 var(--serif); margin: 0 0 8px; }
.promise p { margin: 0 0 6px; color: var(--muted); }

/* Chapter content lines up with the chapter title (after the list styles so it wins). */
.chapter .chapter-body { margin-left: 144px; }

/* Machine-readable line from the passport skin */
.mrz { font: 13px/1.4 var(--mono); letter-spacing: 0.28em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: clip; }

.colophon { margin-top: 110px; border-top: 3px double var(--ink); padding: 26px 0 46px; }
.colophon .page { display: grid; gap: 16px; }
.colophon .line { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.colophon nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Legal documents: contents on the left page, text on the right page */
.doc-title { padding: 64px 0 36px; border-bottom: 1px solid var(--ink); }
.doc-title h1 { font: 600 clamp(42px, 6vw, 72px)/1.02 var(--serif); letter-spacing: -0.02em; margin: 14px 0 18px; }
.doc-title .summary { font-size: 19px; color: var(--muted); max-width: 62ch; margin: 0 0 22px; }
.dates { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; font: 14px var(--mono); color: var(--muted); }
.dates dt { display: inline; }
.dates dd { display: inline; margin: 0 0 0 6px; color: var(--ink); }

.spread { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 64px; padding-top: 44px; }
.spread > aside { position: relative; }
.toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding-right: 6px; }
.toc summary { list-style: none; cursor: default; font: 600 13px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; text-decoration: none; font-size: 15px; color: var(--muted); }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 12.5px var(--mono); min-width: 1.9em; }
.toc a:hover { color: var(--ink); }

.doc { max-width: 70ch; }
.doc section { padding-top: 6px; margin-bottom: 42px; scroll-margin-top: 20px; }
.doc h2 { display: flex; gap: 14px; align-items: baseline; font: 600 clamp(25px, 2.6vw, 31px)/1.2 var(--serif); letter-spacing: -0.01em; margin: 0 0 12px; padding-top: 14px; border-top: 1px solid var(--rule); }
.doc h2 .no { font: 14px var(--mono); color: var(--muted); font-weight: 400; min-width: 2em; }
.doc h3 { font: 600 19px/1.35 var(--serif); margin: 22px 0 6px; }
.doc p, .doc li { font-size: 16.5px; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--accent); }

.short { background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--accent); padding: 20px 26px; margin: 0 0 44px; }
.short h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 22px; }
.short ul { margin: 0; padding-left: 20px; }

.ledger { margin: 14px 0 18px; border-top: 1px solid var(--ink); }
.ledger > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ledger dt { font: 600 16.5px/1.4 var(--serif); }
.ledger dd { margin: 0; font-size: 16px; }
.ledger dd small { display: block; color: var(--muted); font-size: 14.5px; margin-top: 4px; }

.sign { border: 1px solid var(--ink); padding: 18px 22px; display: inline-block; min-width: 280px; }
.sign p { margin: 2px 0; }

/* 404 */
.lost { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 40px 24px; }
.lost h1 { font: 600 52px/1.05 var(--serif); margin: 14px 0 10px; }
.lost p { color: var(--muted); margin: 0 0 22px; }
.button { display: inline-block; padding: 11px 22px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; }
.button:hover { background: transparent; color: var(--ink); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 52px; }
  .chapter-head { grid-template-columns: 1fr; gap: 6px; }
  .chapter .chapter-body { margin-left: 0; }
  .skins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes { grid-template-columns: 1fr; }
  .notes > div + div { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
  .spread { grid-template-columns: 1fr; gap: 8px; padding-top: 28px; }
  .toc { position: static; max-height: none; border: 1px solid var(--rule); background: var(--sheet); padding: 14px 18px; }
  .toc summary { cursor: pointer; margin: 0; }
  .toc[open] summary { margin-bottom: 10px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { padding: 0 20px; }
  .masthead nav { gap: 14px; }
  .masthead nav a { font-size: 12px; letter-spacing: 0.1em; }
  .masthead nav a.wide-only { display: none; }
  .index { columns: 1; }
  .ledger > div { grid-template-columns: 1fr; gap: 4px; }
  .shelf img { width: calc((100% - 30px) / 4); }
  .stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 30px; }
  .store { min-width: 0; height: 54px; padding: 0 12px 0 14px; gap: 10px; border-radius: 12px; }
  .store svg { width: 22px; height: 22px; }
  .store .play { width: 19px; height: 19px; }
  .store small { font-size: 10.5px; letter-spacing: 0; white-space: nowrap; }
  .store strong { font-size: 17px; white-space: nowrap; }
}

@media (max-width: 360px) {
  .stores { grid-template-columns: 1fr; }
  .store { justify-content: center; }
}
