@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #141210;
  --bg-2: #1b1815;
  --surface: #221e1a;
  --line: #342e28;
  --text: #f3ede5;
  --muted: #a99f93;
  --amber: #f2a541;
  --copper: #d9743f;
  --terracotta: #b9532f;
  --radius: 14px;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
img, video { max-width: 100%; display: block; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 17px var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: conic-gradient(from 210deg, var(--amber), var(--copper), var(--terracotta), var(--amber)); box-shadow: 0 0 18px -2px color-mix(in srgb, var(--amber) 60%, transparent); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); text-decoration: none; background: var(--surface); }
@media (max-width: 480px) { body:not(.admin) .site-nav a:first-child { display: none; } .brand { font-size: 15px; } .site-nav a { padding: 8px 7px; font-size: 14px; } .brand-mark { width: 18px; height: 18px; } }

/* hero */
.hero { padding: 64px 0 36px; background: radial-gradient(900px 380px at 12% -10%, color-mix(in srgb, var(--copper) 26%, transparent), transparent 70%), radial-gradient(700px 320px at 95% 0%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%); }
.hero-sm { padding: 44px 0 22px; }
.hero h1 { font-size: clamp(2.3rem, 7.5vw, 4.6rem); font-weight: 700; }
.hero-sm h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
.eyebrow { margin: 0 0 10px; color: var(--amber); font: 600 13px var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.lede { margin: 14px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.25rem); max-width: 60ch; }
.quote { margin: 22px 0 0; padding-left: 14px; border-left: 2px solid var(--copper); color: var(--muted); font-style: italic; font-size: 0.95rem; max-width: 56ch; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 20px 18px; margin: 0 -20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; color: var(--muted); border: 1px solid var(--line); background: var(--bg-2); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.chip span { opacity: 0.6; font-size: 12px; margin-left: 2px; }
.chip:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.chip.on { color: #1a1206; background: var(--amber); border-color: var(--amber); }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding-bottom: 56px; }
@media (max-width: 599px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.card { display: block; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s; }
.card:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--amber) 55%, transparent); }
.card[hidden] { display: none; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-empty { width: 100%; height: 100%; background: repeating-linear-gradient(135deg, var(--bg-2) 0 14px, var(--surface) 14px 28px); }
.card-body { padding: 12px 14px 15px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.card-meta .cat { color: var(--amber); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.card h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
@media (max-width: 599px) { .card-body { padding: 10px 11px 12px; } .card h3 { font-size: 0.95rem; } }
.badge { background: var(--terracotta); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.card-img .badge { position: absolute; top: 10px; left: 10px; }
.empty { color: var(--muted); padding: 30px 0 80px; }

/* project */
.project-head { padding-top: 34px; padding-bottom: 26px; }
.crumbs { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); } .crumbs span { opacity: 0.5; margin: 0 4px; }
.project-head h1 { font-size: clamp(2rem, 6.5vw, 3.6rem); font-weight: 700; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.project-meta time { color: var(--amber); font-weight: 600; }
.prose { max-width: 68ch; margin-top: 18px; color: #ddd5ca; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; } .prose h3 { margin: 1.4em 0 0.5em; font-size: 1.2rem; }
.prose li { margin-bottom: 0.3em; } .prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose-lg { font-size: 1.1rem; }
.tags { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { color: var(--muted); font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.tags a:hover { color: var(--text); text-decoration: none; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
@media (max-width: 599px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 6px; } }
.tile { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.tile a { display: block; position: relative; aspect-ratio: 1; overflow: hidden; cursor: zoom-in; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, filter 0.3s; }
.tile a:hover img { transform: scale(1.03); filter: brightness(1.08); }
.tile figcaption { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; font-size: 12px; line-height: 1.35; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.82)); pointer-events: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery .tile:first-child:not(.tile-wide) { grid-column: span 2; grid-row: span 2; }
.tile-wide { grid-column: 1 / -1; background: none; }
.tile-wide figcaption { position: static; background: none; color: var(--muted); padding: 8px 2px 0; font-size: 13.5px; display: block; }
.video { aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; max-width: 960px; }
.video iframe, .video video { width: 100%; height: 100%; border: 0; }

.updates { margin-top: 56px; }
.updates h2, .more h2 { font-size: 1.6rem; margin-bottom: 22px; }
.update { position: relative; padding: 0 0 36px 24px; border-left: 2px solid var(--line); }
.update::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--bg); }
.update-head time { color: var(--amber); font: 600 13px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.update-head h3 { font-size: 1.25rem; margin-top: 4px; }
.update .gallery { margin-top: 16px; }
.update .gallery .tile:first-child { grid-column: auto; grid-row: auto; }
.more { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }

/* about / contact */
.stats { display: flex; gap: 36px; margin: 30px 0; }
.stats strong { display: block; font: 700 2.4rem var(--display); color: var(--amber); line-height: 1; }
.stats span { color: var(--muted); font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid var(--amber); background: var(--amber); color: #1a1206; font: 600 15px var(--body); padding: 11px 18px; border-radius: 10px; min-height: 44px; transition: filter 0.15s, transform 0.1s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn:active { transform: scale(0.98); }
.form { display: grid; gap: 16px; padding-bottom: 60px; }
.form label, .admin label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; font: 16px var(--body); color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent); }
textarea { resize: vertical; line-height: 1.5; }
.hp { position: absolute; left: -9999px; }
.notice { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line)); padding: 12px 14px; border-radius: 10px; }
.notice-err { background: color-mix(in srgb, var(--terracotta) 22%, var(--surface)); border-color: var(--terracotta); }

/* footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.site-footer a { color: var(--muted); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8, 7, 6, 0.96); display: flex; flex-direction: column; touch-action: none; }
.lb[hidden] { display: none; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); font-size: 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
.lb-cap { text-align: center; color: #e6ded3; font-size: 14.5px; padding: 6px 18px calc(16px + env(safe-area-inset-bottom)); min-height: 44px; max-width: 80ch; margin: 0 auto; }
.lb button { background: rgba(255, 255, 255, 0.08); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.lb button:hover { background: rgba(255, 255, 255, 0.18); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 700px) { .lb-prev, .lb-next { display: none; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.update { scroll-margin-top: 76px; }
.tile-vid { aspect-ratio: 1; background: #000; }
.tile-vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-vid figcaption { bottom: 44px; }
.gallery .tile-vid:first-child { grid-column: auto; grid-row: auto; }
