/* Same paper/terracotta palette and IBM Plex type as the project pages it links to. Light only. */
:root {
  --bg: #f4f2ed; --surface: #fbfaf7; --surface2: #efece6; --ink: #1f1e1c; --muted: #66625b; --faint: #8f8a82;
  --rule: #dcd7cd; --accent: #b04a22; --accent-ink: #8f3a18; --accent-soft: rgba(176, 74, 34, .09);
  --shadow: 0 1px 2px rgba(31, 30, 28, .05), 0 6px 24px -12px rgba(31, 30, 28, .18);
  --sheet: #fbfaf7;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.crumb { font: 500 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--accent-ink); }

/* header */
.masthead { padding: 28px 0 24px; }
.masthead h1 { margin: 10px 0 6px; font: 600 clamp(28px, 5vw, 44px)/1.1 var(--sans); letter-spacing: -.02em; text-wrap: balance; }
.masthead p { margin: 0; color: var(--muted); max-width: 62ch; }

/* project list */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; padding-bottom: 64px; }
.project { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.project:hover { transform: translateY(-2px); border-color: var(--accent); }
.project img { aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface2); }
.project .body { padding: 16px 18px 18px; }
.project h2 { margin: 0 0 2px; font: 600 20px/1.25 var(--sans); }
.project .place { font: 500 12px/1.4 var(--mono); color: var(--faint); }
.project p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.project .meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip { font: 500 12px/1 var(--mono); padding: 6px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.tabs a { position: relative; padding: 10px 16px 12px; font: 500 15px/1 var(--sans); color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); }
.tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tabs .count { font: 500 11px/1 var(--mono); color: var(--faint); margin-left: 6px; }
[role="tabpanel"] { padding-bottom: 64px; }
[role="tabpanel"][hidden] { display: none; }

/* 3D tab */
.stage { position: relative; background: #1b1c1f; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
@media (max-width: 720px) { .stage { aspect-ratio: auto; height: 72svh; } }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 28px; flex-wrap: wrap; }
.stage-bar h2 { margin: 0; font: 600 18px/1.3 var(--sans); }
.stage-bar p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: 500 14px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn svg { width: 16px; height: 16px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font: 600 20px/1.3 var(--sans); }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 15px; max-width: 64ch; }
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.model { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.model:hover { border-color: var(--accent); }
.model[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.model strong { font-weight: 600; }
.model span { color: var(--muted); font-size: 14px; }
.model .num { font: 500 11px/1 var(--mono); color: var(--faint); letter-spacing: .06em; }

/* plans tab */
.plan-group + .plan-group { margin-top: 44px; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.sheet { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; text-decoration: none; transition: border-color .15s; }
.sheet:hover { border-color: var(--accent); }
.sheet .pic { aspect-ratio: 4 / 3; background: var(--sheet); padding: 10px; display: grid; place-items: center; }
.sheet .pic img { width: 100%; height: 100%; object-fit: contain; }
.sheet.render .pic { padding: 0; }
.sheet.render .pic img { object-fit: cover; }
.sheet .cap { padding: 10px 12px 12px; border-top: 1px solid var(--rule); }
.sheet .cap strong { display: block; font-weight: 600; font-size: 15px; }
.sheet .cap span { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.sheet .cap .num { display: inline; font: 500 11px/1 var(--mono); color: var(--accent-ink); margin-right: 6px; }

/* full-window viewer */
body.viewer { height: 100svh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; background: #1b1c1f; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--rule); min-width: 0; }
.viewer-bar .title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-bar .title strong { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .title span { font: 500 11px/1.3 var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .btn { padding: 8px 10px; }
.viewer-bar .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.viewer-bar .hide-sm { display: inline; }
@media (max-width: 560px) { .viewer-bar .hide-sm { display: none; } }
body.viewer iframe { width: 100%; height: 100%; border: 0; display: block; }

.foot { padding: 24px 0 40px; border-top: 1px solid var(--rule); color: var(--faint); font: 500 12px/1.4 var(--mono); }
