:root {
  --night: #0c1410;
  --canopy: #163024;
  --stone: #3e4944;
  --oak: #7a4a28;
  --brass: #d4b06a;
  --parchment: #efe2c6;
  --ink: #1c1610;
  --moss: #1f4a34;
  --ember: #e07a3d;
  --focus: #f3e2b0;
  --wood-0: var(--night);
  --gold: var(--brass);
  --gold-dim: #8d7040;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--parchment);
  font-family: Literata, "Palatino Linotype", Palatino, serif;
  font-size: 1.05rem;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 176, 106, 0.16), transparent 55%),
    radial-gradient(circle at 12% 80%, rgba(31, 74, 52, 0.45), transparent 42%),
    linear-gradient(180deg, #14241c 0%, var(--night) 38%, #080c0a 100%);
  line-height: 1.5;
}

a { color: var(--brass); }
a:hover { color: #f4e4bc; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.beta-banner {
  background: #3a2218;
  color: #f6e4c8;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  border-bottom: 3px solid var(--oak);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  padding: 0.65rem 0.8rem;
  background: linear-gradient(#2c3833, #1a2420);
  border-bottom: 1px solid #5c5344;
  box-shadow: inset 0 1px 0 rgba(212, 176, 106, 0.25);
}

.topbar a {
  text-decoration: none;
  color: var(--parchment);
  background: #24302b;
  border: 1px solid #6d624c;
  padding: 0.4rem 0.7rem;
  font-family: Fraunces, "Palatino Linotype", serif;
  font-size: 0.92rem;
  font-weight: 560;
  letter-spacing: 0.01em;
}

.topbar a[aria-current="page"] {
  background: var(--oak);
  border-color: var(--brass);
  color: #fff6e4;
}

.frame {
  max-width: 1080px;
  margin: 1.2rem auto 2rem;
  padding: 0 0.9rem;
}

.stone {
  background:
    linear-gradient(165deg, rgba(255,255,255,0.05), transparent 32%),
    linear-gradient(180deg, #4a5650, #2a3330 55%, #1c2421);
  border: 1px solid #1a1612;
  box-shadow:
    inset 0 0 0 1px rgba(212, 176, 106, 0.45),
    inset 0 0 0 5px #24302b,
    0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 1.15rem 1.2rem 1.3rem;
}

.lockup { text-align: center; padding: 1.5rem 1rem 0.4rem; position: relative; }

.wordmark {
  font-family: Fraunces, "Palatino Linotype", serif;
  font-weight: 680;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 9vw, 5.6rem);
  margin: 0;
  letter-spacing: -0.03em;
  color: #f3e6c4;
  text-shadow: 0 2px 0 #2a1c10;
}

.tagline, .thesis {
  margin: 0.35rem auto 0;
  max-width: 38rem;
  color: #e7d7b4;
  font-size: 1.15rem;
}

.seal {
  width: 92px;
  height: 92px;
  margin: 0.9rem auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8d4a28, #4a2414 64%, #24140c);
  color: #f8e6c4;
  display: grid;
  place-items: center;
  font-family: Fraunces, serif;
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.15;
  box-shadow: inset 0 0 0 3px rgba(212, 176, 106, 0.55);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1rem;
}

.btn, button.btn {
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  font-family: Fraunces, "Palatino Linotype", serif;
  font-size: 1.05rem;
  font-weight: 560;
  letter-spacing: 0;
  padding: 0.72rem 1.15rem;
  border: 1px solid #f0ddb0;
  color: #2a1c0c;
  background: linear-gradient(#f0d7a2, #c4923e);
  box-shadow: inset 0 1px 0 #fff4d4, 0 3px 0 #5c3e16;
}

.btn.alt, button.btn.alt {
  color: #f6ead2;
  background: linear-gradient(#3d4a44, #24302b);
  border-color: #b8924e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 3px 0 #121816;
}

button.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.parchment {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), transparent 28%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(90, 60, 20, 0.07) 28px),
    var(--parchment);
  color: var(--ink);
  border: 1px solid #8a6840;
  box-shadow: inset 0 0 0 6px #ead7b0, 0 8px 16px rgba(0,0,0,0.35);
  padding: 1.2rem 1.3rem 1.4rem;
}

.parchment h2, .parchment h1 {
  font-family: Fraunces, serif;
  margin: 0 0 0.4rem;
}

.parchment a { color: #6a3b12; }

.side h2, .stone h2, .camp h2, .hall h2 {
  font-family: Fraunces, serif;
  font-weight: 560;
  font-size: 1.55rem;
  margin: 0 0 0.35rem;
  color: #f6e6c4;
}

.side p, .prose p { margin: 0.4rem 0 0.75rem; }

.side ul, .guide-list { margin: 0.3rem 0 0.8rem; padding-left: 1.1rem; }

form label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-family: Fraunces, serif;
  font-size: 1rem;
}

input {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: #fff8ea;
  border: 2px solid #8a6840;
}

.name-note {
  margin: 0.35rem 0 0;
  color: #e7d3a4;
  font-family: Fraunces, "Palatino Linotype", serif;
  font-size: 0.98rem;
}

.note, .warn {
  background: rgba(0,0,0,0.28);
  border-left: 4px solid var(--brass);
  padding: 0.65rem 0.8rem;
}

.warn { border-left-color: var(--ember); }

.message {
  margin-top: 0.8rem;
  padding: 0.65rem 0.75rem;
  background: #141c18;
  border: 1px solid var(--gold-dim);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.2);
}

th, td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(212, 176, 106, 0.35);
}

footer {
  text-align: center;
  color: #cbbfa6;
  font-size: 0.9rem;
  padding: 0 1rem 2rem;
}

footer a { color: var(--brass); }

.members-page .frame { max-width: 880px; }

.members-page .stone h1 { margin-bottom: 0.35rem; }

.members-page form label { margin-top: 0.45rem; }

.price .per {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #cbb892;
}

.threshold {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 1rem;
  border: 1px solid #1a140e;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
  position: relative;
}

.threshold::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 1px;
  background: linear-gradient(transparent, #d4b06a 18%, #d4b06a 82%, transparent);
  pointer-events: none;
  z-index: 1;
}

.camp, .hall {
  padding: 1.25rem 1.2rem 1.4rem;
  min-height: 100%;
}

.camp {
  background:
    radial-gradient(circle at 70% 88%, rgba(224, 122, 61, 0.35), transparent 36%),
    linear-gradient(180deg, #2a4034, #1a2a22 70%);
  border-right: 1px solid rgba(212, 176, 106, 0.25);
}

.hall {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 176, 106, 0.28), transparent 42%),
    linear-gradient(180deg, #2c261c, #14110e 72%);
  box-shadow: inset 0 0 0 1px rgba(212, 176, 106, 0.35);
}

.hall::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(212, 176, 106, 0.28);
  pointer-events: none;
  animation: hall-light 1.4s ease both;
}

.kicker {
  font-family: Fraunces, serif;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cbb892;
  margin: 0 0 0.2rem;
}

.price {
  font-family: Fraunces, serif;
  font-size: 2.4rem;
  margin: 0.1rem 0 0.4rem;
  color: var(--brass);
}

.camp .price { color: #f0d2b0; font-size: 2rem; }

.fine { font-size: 0.95rem; color: #d9ccb4; }

@keyframes hall-light {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .columns, .threshold { grid-template-columns: 1fr; }
  .threshold::before { display: none; }
  .camp { border-right: 0; border-bottom: 1px solid rgba(212, 176, 106, 0.25); }
  .topbar a { flex: 1 1 auto; text-align: center; }
}

.ledger {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), transparent 22%),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(90, 60, 20, 0.07) 28px),
    var(--parchment);
  color: var(--ink);
  border: 1px solid #8a6840;
  box-shadow: inset 0 0 0 7px #ead7b0, 0 14px 28px rgba(0,0,0,0.4);
  position: relative;
}

.ledger::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--oak), var(--brass), var(--oak), transparent);
  transform-origin: left center;
  animation: ledger-rule 0.7s ease both;
}

.ledger-main, .ledger-side {
  padding: 1.15rem 1.2rem 1.3rem;
}

.ledger-side {
  border-left: 1px solid rgba(122, 74, 40, 0.45);
}

.ledger h2, .ledger h1 {
  font-family: Fraunces, serif;
  margin: 0 0 0.35rem;
}

.ledger a { color: #6a3b12; }

.ledger .fine { color: #5c4630; }

.desk-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.6rem 0 0.8rem;
}

.roll { overflow-x: auto; }
.roll td, .roll th { white-space: nowrap; font-size: 0.92rem; }

tr.on td { background: rgba(212, 176, 106, 0.28); }

.parchment .hint, .ledger .hint { color: #5a4632; font-size: 0.92rem; }

.parchment select, .ledger select {
  font: inherit;
  color: var(--ink);
  background: #fff8ea;
  border: 2px solid #8a6840;
  padding: 0.4rem 0.5rem;
}

.row-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.6rem 0; }

button.primary {
  font-family: Fraunces, "Palatino Linotype", serif;
  cursor: pointer;
  border: 1px solid #f0ddb0;
  color: #2a1c0c;
  background: linear-gradient(#f0d7a2, #c4923e);
  padding: 0.45rem 0.75rem;
}

button.ghost {
  font-family: Fraunces, "Palatino Linotype", serif;
  cursor: pointer;
  color: #f6ead2;
  background: #24302b;
  border: 1px solid #b8924e;
  padding: 0.45rem 0.75rem;
}

.parchment button.ghost, .ledger button.ghost {
  color: #2a1c0c;
  background: transparent;
}

.admin-facts { display: grid; grid-template-columns: 9rem 1fr; gap: 0.2rem 0.6rem; }
.admin-facts dt { color: #6a3b12; }
.admin-facts dd { margin: 0; }
.admin-items, .admin-log { margin: 0.3rem 0 0.8rem; padding-left: 1.1rem; }

@keyframes ledger-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .columns, .threshold, .ledger { grid-template-columns: 1fr; }
  .threshold::before { display: none; }
  .ledger-side { border-left: 0; border-top: 1px solid rgba(122, 74, 40, 0.45); }
  .camp { border-right: 0; border-bottom: 1px solid rgba(212, 176, 106, 0.25); }
  .topbar a { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
