@import url("/vendor/fonts/fraunces/opsz.css");
@import url("/vendor/fonts/inter/index.css");

:root {
  --bg: #f4f1ea;
  --paper: #faf8f3;
  --plate: #f2f1ee;
  --ink: #24211d;
  --ink-2: #4a453e;
  --muted: #8a8276;
  --line: #e2dccf;
  --accent: #a45a36;
  --accent-soft: #efe2d6;
  --serif: "Fraunces Variable", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 0 0;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--ink); }
.brand { font-family: var(--serif); font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 500; }
.brand span { color: var(--accent); }

/* ---------- index ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(36px, 5vw, 64px); max-width: 860px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.hero h1 {
  font-family: var(--serif); font-weight: 380; font-variation-settings: "opsz" 144;
  font-size: clamp(44px, 7vw, 92px); line-height: .98; letter-spacing: -.025em; margin: 0 0 26px;
}
.hero h1 em { font-style: italic; color: var(--ink-2); font-weight: 300; }
.hero p { font-size: 19px; color: var(--ink-2); max-width: 620px; margin: 0; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 0; margin-bottom: 48px;
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
}
.search svg { color: var(--muted); flex: none; }
.search input {
  width: 100%; border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink);
  padding: 6px 0; outline: none;
}
.search input::placeholder { color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 13px; border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 5px 14px; cursor: pointer;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 56px 32px; padding-bottom: 120px;
}
.card { text-decoration: none; display: flex; flex-direction: column; }
.card .plate {
  aspect-ratio: 1 / 1; background: var(--plate); border-radius: var(--radius); overflow: hidden;
  position: relative; box-shadow: 0 0 0 1px rgba(36, 33, 29, .04);
  transition: box-shadow .35s ease, transform .35s ease;
}
.card .plate img {
  width: 100%; height: 100%; object-fit: contain; padding: 4%;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .plate { box-shadow: 0 18px 40px -22px rgba(60, 45, 25, .35), 0 0 0 1px rgba(36, 33, 29, .06); transform: translateY(-2px); }
.card:hover .plate img { transform: scale(1.035); }
.plate .empty {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted);
  font-family: var(--serif); font-style: italic; font-size: 15px;
}
.card .no {
  margin: 18px 0 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.badge {
  font-size: 10.5px; letter-spacing: .1em; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); text-transform: uppercase; text-decoration: none;
}
.badge.quiet { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.card h2 {
  font-family: var(--serif); font-weight: 450; font-size: 23px; line-height: 1.18; letter-spacing: -.01em;
  margin: 0 0 8px;
}
.card p {
  margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: auto; }
.meta b { color: var(--ink-2); font-weight: 550; }
.none { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; padding: 40px 0 160px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 13px; }

/* ---------- project ---------- */
.p-head { padding: clamp(36px, 6vw, 72px) 0 30px; display: grid; gap: 14px; max-width: 980px; }
.p-head h1 {
  font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 144;
  font-size: clamp(36px, 5.2vw, 68px); line-height: 1.02; letter-spacing: -.022em; margin: 0;
}
.p-head .lede { font-size: 19px; color: var(--ink-2); max-width: 760px; margin: 0; }
.relation { font-size: 14px; color: var(--ink-2); }
.relation a { color: var(--accent); }

.viewer {
  position: relative; height: min(68vh, 760px); min-height: 380px;
  background: var(--plate); border-radius: calc(var(--radius) + 4px); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(36, 33, 29, .05);
}
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.v-tabs {
  position: absolute; left: 16px; top: 16px; right: 120px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2;
}
.v-tab {
  font: inherit; font-size: 13px; border: 0; cursor: pointer; border-radius: 999px; padding: 6px 13px;
  background: rgba(250, 248, 243, .82); color: var(--ink-2); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(36, 33, 29, .07);
}
.v-tab:hover { color: var(--ink); }
.v-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.v-tools { position: absolute; right: 16px; top: 16px; z-index: 2; display: flex; gap: 6px; }
.v-btn {
  font: inherit; font-size: 13px; border: 0; cursor: pointer; border-radius: 999px; padding: 6px 13px;
  background: rgba(250, 248, 243, .82); color: var(--ink-2); box-shadow: 0 0 0 1px rgba(36, 33, 29, .07);
}
.v-btn:hover { color: var(--ink); }
.v-dims {
  position: absolute; left: 16px; bottom: 14px; z-index: 2; font-size: 13px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; background: rgba(250, 248, 243, .82); padding: 6px 12px; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(36, 33, 29, .07);
}
.v-dims b { font-weight: 550; color: var(--ink); }
.v-dims .sep { color: var(--muted); margin: 0 4px; }
.v-hint { position: absolute; right: 16px; bottom: 14px; z-index: 2; font-size: 12px; color: var(--muted); }
.v-loading {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none;
  transition: opacity .4s ease;
}
.v-loading[hidden] { display: grid; opacity: 0; }
.v-loading .box { width: min(320px, 70%); text-align: center; }
.v-loading .label { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.v-loading .bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.v-loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.v-error { color: var(--accent); font-size: 14px; }

.p-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 6vw, 96px);
  padding: 64px 0 40px; align-items: start;
}
.p-side { position: sticky; top: 24px; display: grid; gap: 28px; }
.p-side h3 {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 550;
  margin: 0 0 10px;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.dl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dl li { border-bottom: 1px solid var(--line); }
.dl a {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; text-decoration: none; font-size: 14px;
}
.dl a span:first-child { overflow-wrap: anywhere; }
.dl a:hover { color: var(--accent); }
.dl .sz { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* README prose */
.prose { max-width: 74ch; color: var(--ink-2); font-size: 16.5px; }
.prose h2 {
  font-family: var(--serif); font-weight: 450; font-size: 28px; color: var(--ink); letter-spacing: -.01em;
  margin: 2.2em 0 .6em; line-height: 1.2;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; color: var(--ink); margin: 1.8em 0 .5em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em;
  background: var(--paper); border: 1px solid var(--line); padding: .08em .38em; border-radius: 5px; color: var(--ink);
}
.prose pre { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose img { border-radius: var(--radius); background: var(--plate); margin: 1.4em 0; }
.prose blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--ink-2); font-size: 13px; }

.gallery { padding: 24px 0 40px; }
.gallery h2 { font-family: var(--serif); font-weight: 450; font-size: 28px; margin: 0 0 20px; }
.gallery .shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.gallery a { display: block; background: var(--plate); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: auto; }
.gallery figcaption { font-size: 13px; color: var(--muted); padding: 8px 2px 0; }

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 1px solid var(--line);
  padding: 36px 0 72px; margin-top: 40px;
}
.pager a { text-decoration: none; display: grid; gap: 4px; }
.pager a.next { text-align: right; }
.pager small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pager span { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.pager a:hover span { color: var(--accent); }

@media (max-width: 900px) {
  .p-body { grid-template-columns: 1fr; }
  .p-side { position: static; }
  .viewer { height: 60vh; }
}
