:root {
  --bg: #0a0c0d;
  --panel: #111416;
  --panel-2: #171b1d;
  --line: #2a2f32;
  --text: #e5e1d7;
  --muted: #99988f;
  --rust: #b44e2d;
  --rust-bright: #d46338;
  --sand: #c9ad78;
  --ok: #759b6d;
  --danger: #b9554f;
  --warning: #c29b55;
  --max: 1180px;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url('/assets/site-background.png') center center / cover no-repeat;
  opacity: .46;
  filter: saturate(.78) contrast(1.06);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7,9,10,.74), rgba(7,9,10,.80) 35%, rgba(7,9,10,.91) 100%),
    radial-gradient(circle at 76% 12%, rgba(180,78,45,.14), transparent 28rem),
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.01) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(10,12,13,.9);
  backdrop-filter: blur(18px);
}

.nav {
  max-width: var(--max);
  min-height: 70px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .08em; }
.brand-mark {
  display: grid; place-items: center; width: 39px; height: 39px;
  border: 1px solid #7e4a38; background: linear-gradient(135deg,#352018,#121516 60%);
  color: #e5c3a1; font-size: 13px; letter-spacing: -.03em;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.025);
}
.brand-name { white-space: nowrap; }
.nav-links { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav-links a { padding: 9px 11px; color: #bcbab2; font-size: .94rem; border-radius: 5px; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.05); }
.account-pill { border: 1px solid var(--line); }

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(10,12,13,.25) 40%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(192,122,66,.13), transparent 50%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--max); margin: 0 auto; padding: 112px 22px 96px;
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 52px; align-items: end;
}
.kicker { color: var(--rust-bright); text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; font-weight: 800; }
h1, h2, h3 { line-height: 1.08; margin-top: 0; }
h1 { font-size: clamp(3.2rem, 8vw, 7.5rem); margin: 13px 0 24px; letter-spacing: -.065em; text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.035em; }
h3 { font-size: 1.15rem; }
.hero-copy { max-width: 750px; color: #b8b5ad; font-size: 1.13rem; }
.hero-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 17px; border-radius: 5px;
  border: 1px solid var(--line); background: #171a1c; color: #efede6; font-weight: 700;
}
.button:hover { border-color: #595e60; background: #1d2123; }
.button.primary { background: var(--rust); border-color: var(--rust); color: #fff; }
.button.primary:hover { background: var(--rust-bright); }
.button.danger { border-color: #6f3a37; color: #e8b3ad; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: .84rem; }
.button[disabled] { opacity: .45; cursor: not-allowed; }

.hero-stat { border-left: 2px solid var(--rust); padding: 16px 0 16px 20px; margin-top: 16px; }
.hero-stat strong { display: block; font-size: 1.7rem; }
.hero-stat span { color: var(--muted); font-size: .9rem; }

.page { max-width: var(--max); margin: 0 auto; padding: 72px 22px 100px; }
.page-head { max-width: 790px; margin-bottom: 42px; }
.page-head p { color: var(--muted); font-size: 1.07rem; }
.section { padding: 70px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section-title { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 28px; }
.section-title p { color: var(--muted); max-width: 630px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(18,21,22,.92), rgba(11,14,15,.86));
}
.card p:last-child { margin-bottom: 0; }
.card .eyebrow { color: var(--rust-bright); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.card.muted { color: var(--muted); }

.feature-number { color: #6f6e69; font-size: .78rem; letter-spacing: .15em; margin-bottom: 40px; }
.rule { height: 1px; background: var(--line); margin: 28px 0; }

.form-shell { max-width: 560px; }
.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #c9c6bd; font-weight: 650; font-size: .92rem; }
input, textarea, select {
  width: 100%; padding: 12px 13px; color: var(--text); background: #0b0e0f;
  border: 1px solid #34393b; border-radius: 5px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: #8d5a45; box-shadow: 0 0 0 3px rgba(180,78,45,.09); }
.password-wrap { position: relative; display: flex; align-items: stretch; }
.password-wrap input { padding-right: 70px; }
.password-toggle {
  position: absolute; right: 5px; top: 5px; bottom: 5px; min-width: 56px; padding: 0 9px;
  border: 1px solid #34393b; border-radius: 4px; background: #15191b; color: #c9c6bd; font-size: .78rem; font-weight: 750;
}
.password-toggle:hover { border-color: #5a6062; color: #fff; }
.text-button { justify-self: start; padding: 0; border: 0; background: transparent; color: #c9ad78; font-size: .88rem; font-weight: 700; }
.text-button:hover { color: #f0d3a0; text-decoration: underline; }
.forgot-panel { margin-top: 4px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.password-match-ok { color: #9dbb96; }
.password-match-error { color: #d9958e; }
.help { color: var(--muted); font-size: .85rem; }
.status { padding: 11px 13px; border: 1px solid var(--line); border-radius: 5px; display: none; }
.status.show { display: block; }
.status.ok { border-color: #456247; background: rgba(65,102,70,.12); color: #b8d2b8; }
.status.error { border-color: #73403c; background: rgba(115,64,60,.12); color: #e0aaa4; }

.account-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.account-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line); font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge.ok { color: #b7d0b0; border-color: #436143; }
.badge.locked { color: #d0b090; border-color: #694b39; }

.roadmap { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.roadmap-row { background: var(--bg); padding: 25px; display: grid; grid-template-columns: 120px 1fr; gap: 28px; }
.roadmap-state { color: var(--rust-bright); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; }
.roadmap-row p { color: var(--muted); margin-bottom: 0; }

.dev-layout { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
.dev-nav { display: grid; align-content: start; gap: 6px; position: sticky; top: 92px; }
.dev-nav button { text-align: left; padding: 10px 12px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); }
.dev-nav button:hover, .dev-nav button.active { color: #fff; border-color: var(--line); background: var(--panel); }
.dev-panel { display: none; }
.dev-panel.active { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-box { border: 1px solid var(--line); padding: 18px; background: var(--panel); }
.stat-box strong { display: block; font-size: 1.8rem; }
.stat-box span { color: var(--muted); font-size: .82rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #a8a59d; background: #101315; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84em; }
.key-output { width: 100%; min-height: 220px; font-family: ui-monospace, Consolas, monospace; white-space: pre; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.toolbar > label { min-width: 150px; flex: 1; }

.site-footer { border-top: 1px solid var(--line); color: #797a75; background: rgba(8,10,11,.84); backdrop-filter: blur(12px); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 38px 22px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .86rem; }

.hidden { display: none !important; }

.testing-status {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px;
  font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.testing-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.testing-status.open { color: #78c978; }
.testing-status.closed { color: #e06a61; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.setting-row h3 { margin-bottom: 8px; }
.setting-row p { margin: 0; }
.switch-control { display: inline-flex; align-items: center; gap: 12px; grid-template-columns: none; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.switch-slider { position: relative; width: 54px; height: 30px; border-radius: 30px; background: #3c2220; border: 1px solid #754039; transition: .18s ease; flex: 0 0 auto; }
.switch-slider::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #d7d2c8; transition: .18s ease; }
.switch-control input:checked + .switch-slider { background: #274629; border-color: #527b55; }
.switch-control input:checked + .switch-slider::after { transform: translateX(24px); background: #e7eee4; }
.switch-control input:focus-visible + .switch-slider { outline: 2px solid var(--sand); outline-offset: 3px; }
.switch-control input:disabled + .switch-slider { opacity: .55; cursor: wait; }
.switch-control .testing-status { margin: 0; min-width: 245px; }

@media (max-width: 850px) {
  .nav { flex-wrap: wrap; padding-top: 13px; padding-bottom: 13px; }
  .nav-links { width: 100%; margin-left: 0; overflow-x: auto; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 76px; }
  .grid, .grid.two, .account-layout, .stat-grid { grid-template-columns: 1fr; }
  .roadmap-row { grid-template-columns: 1fr; gap: 8px; }
  .dev-layout { grid-template-columns: 1fr; }
  .dev-nav { position: static; display: flex; overflow-x: auto; }
}

/* v0.1.5 developer sign-in */
.dev-page-head { margin-bottom: 28px; }
#dev-auth { margin-bottom: 36px; }
#dev-auth h2 { margin: 7px 0 10px; }
#dev-auth .help { margin-top: 0; }

/* v0.2.0 public content + developer CMS */
.muted { color: var(--muted); }
.feature-list { margin: 0; padding-left: 1.25rem; display: grid; gap: 11px; color: #d2cfc6; }
.feature-list li::marker { color: var(--rust-bright); }
.announcement-bar { position: relative; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 9px 20px; border-bottom: 1px solid #684536; background: #201612; color: #e4d9cd; font-size: .88rem; text-align: center; }
.announcement-bar a { color: #ffc59b; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.content-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.content-card { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.content-card:hover { border-color: #555b5d; transform: translateY(-1px); }
.content-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #090b0c; }
.content-card-body { padding: 20px; }
.content-card-body h2,.content-card-body h3 { margin: 7px 0 9px; }
.content-card-body p { color: var(--muted); margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.gallery-tile { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.gallery-tile img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; cursor: zoom-in; background: #080a0b; }
.gallery-tile-copy { padding: 16px; }
.gallery-tile-copy h3 { margin: 6px 0; }
.gallery-tile-copy p { color: var(--muted); margin: 6px 0 0; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filter-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--muted); }
.filter-chip:hover,.filter-chip.active { color: #fff; border-color: #675348; background: #1b1715; }
.empty-state { padding: 30px; border: 1px dashed var(--line); color: var(--muted); text-align: center; grid-column: 1 / -1; }
.lightbox { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(2,3,3,.92); }
.lightbox-inner { max-width: min(1400px,95vw); max-height: 90vh; text-align: center; }
.lightbox-inner img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-inner p { color: #d0ccc3; }
.lightbox-close { position: fixed; right: 24px; top: 18px; border: 0; background: transparent; color: #fff; font-size: 2.6rem; line-height: 1; }
.no-scroll { overflow: hidden; }
.devlog-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.devlog-post { max-width: 900px; margin: 0 auto; }
.devlog-post h1 { font-size: clamp(2.7rem,7vw,6.2rem); }
.devlog-lead { color: #bbb7ad; font-size: 1.2rem; max-width: 760px; }
.devlog-cover { width: 100%; max-height: 590px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); margin: 24px 0 38px; }
.devlog-body { font-size: 1.03rem; line-height: 1.75; }
.devlog-body p { color: #c5c2b8; white-space: pre-line; }
.devlog-body h2,.devlog-body h3,.devlog-body h4 { margin-top: 36px; }
.post-media { margin-top: 38px; display: grid; gap: 14px; }
.post-media img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.website-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.website-tabs button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: #111416; color: var(--muted); }
.website-tabs button.active,.website-tabs button:hover { color: #fff; border-color: #5a4c43; background: #1a1715; }
.website-panel { display: none; }
.website-panel.active { display: block; }
#website-status { margin-bottom: 18px; }
.sub-card { padding: 16px; border: 1px solid var(--line); background: #0d1011; display: grid; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 9px; grid-template-columns: none; min-height: 44px; }
.check-row input { width: auto; }
.media-admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.media-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.media-admin-card > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.media-admin-copy { padding: 14px; display: grid; gap: 8px; }
.media-admin-copy span { color: var(--muted); font-size: .8rem; }
.table-thumb { width: 72px; height: 44px; object-fit: cover; border: 1px solid var(--line); }
.media-picker { border: 1px solid var(--line); padding: 14px; }
.media-picker legend { padding: 0 7px; color: #c9c6bd; font-weight: 700; }
.media-picker-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.media-choice { position: relative; display: grid; gap: 5px; padding: 7px; border: 1px solid var(--line); background: #0d1011; font-size: .76rem; }
.media-choice input { position: absolute; top: 9px; left: 9px; width: auto; z-index: 1; }
.media-choice img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.media-choice:has(input:checked) { border-color: #7e5c47; background: #1b1512; }
.devlog-admin-list { display: grid; gap: 12px; margin-top: 18px; }
.devlog-admin-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.devlog-admin-card h3 { margin: 7px 0; }

@media (max-width: 1000px) {
  .content-grid,.gallery-grid,.media-admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-picker-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .content-grid,.gallery-grid,.devlog-grid,.media-admin-grid { grid-template-columns: 1fr; }
  .media-picker-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .devlog-admin-card { align-items: flex-start; flex-direction: column; }
}

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