:root {
  color-scheme: dark;
  --ink: #f5f0e6;
  --muted: #aaa49a;
  --night: #090b12;
  --panel: rgba(20, 23, 34, .78);
  --line: rgba(236, 219, 181, .18);
  --gold: #d4b878;
  --ember: #d8734c;
  --moss: #7ea68c;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(112, 80, 146, .19), transparent 34rem),
    radial-gradient(circle at 90% 45%, rgba(43, 108, 91, .12), transparent 32rem),
    linear-gradient(150deg, #080a10, #11101a 54%, #090d11);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .12;
  background-image: repeating-linear-gradient(115deg, transparent 0 27px, rgba(255,255,255,.08) 28px, transparent 29px);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar, .workspace, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2.4rem 0 1.6rem; }
.topbar h1, .login-shell h1 { margin: .2rem 0 0; font-family: Georgia, serif; font-weight: 400; letter-spacing: -.025em; }
.topbar h1 { font-size: clamp(2rem, 5vw, 4rem); }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.privacy-state { color: var(--moss); font-size: .85rem; }
.eyebrow { margin: 0; color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 1.25rem; align-items: start; }
.deposit-panel, .seeds-panel, .detail-panel, .circulation-panel, .login-shell {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .28);
  backdrop-filter: blur(20px);
}
.deposit-panel, .seeds-panel, .detail-panel, .circulation-panel { padding: clamp(1.2rem, 3vw, 2rem); }
.section-heading { margin-bottom: 1.3rem; }
.section-heading h2 { margin: .3rem 0 0; font: 400 clamp(1.5rem, 3vw, 2.3rem)/1.1 Georgia, serif; }
.heading-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.deposit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gesture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.gesture { min-height: 6.5rem; display: grid; align-content: space-between; gap: .8rem; text-align: left; border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; color: var(--muted); background: rgba(5,7,12,.3); }
.gesture.active { color: var(--ink); border-color: rgba(212,184,120,.35); }
.gesture span { font-size: .72rem; color: var(--gold); }
.seed-form { display: flex; flex-direction: column; gap: .65rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(5, 7, 12, .3); }
.seed-form h3 { margin: 0 0 .5rem; font: 400 1.25rem Georgia, serif; }
label { color: #ddd5c8; font-size: .86rem; }
label span { color: var(--muted); }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: .7rem;
  padding: .8rem .9rem;
  color: var(--ink);
  background: rgba(0,0,0,.28);
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.file-state { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.circulation-panel { grid-column: 1 / -1; }
.circulation { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; }
.circulation article { border: 1px solid var(--line); border-radius: .8rem; padding: .8rem; background: rgba(5,7,12,.3); }
.circulation strong { display: block; font: 400 1.7rem Georgia, serif; color: var(--gold); }
.circulation span { color: var(--muted); font-size: .72rem; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.filters button { border: 1px solid var(--line); border-radius: 999px; padding: .4rem .65rem; color: var(--muted); background: transparent; }
.filters button[aria-pressed="true"] { color: #15120c; background: var(--gold); }
.seed-form button, .login-form button, .action-button {
  border: 1px solid rgba(212,184,120,.5);
  border-radius: 999px;
  padding: .8rem 1rem;
  color: #15120c;
  background: linear-gradient(110deg, #ddc88d, #b89551);
  font-weight: 700;
}
.quiet-button, .back-button { border: 1px solid var(--line); border-radius: 999px; padding: .55rem .85rem; color: var(--ink); background: transparent; }
.future-state { margin: .35rem 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.form-message { min-height: 1.5em; margin: 1rem 0 0; color: var(--moss); }
progress { width: 100%; accent-color: var(--gold); }

.seed-list { display: grid; gap: .7rem; }
.seed-card { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; color: inherit; background: rgba(8,10,16,.38); }
.seed-card:hover { border-color: rgba(212,184,120,.55); transform: translateY(-1px); }
.seed-card h3 { margin: .4rem 0; font: 400 1.15rem Georgia, serif; }
.seed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted); font-size: .78rem; }
.status { display: inline-flex; border-radius: 999px; padding: .28rem .55rem; background: rgba(212,184,120,.12); color: #e3cc92; }
.status.awaiting-transcription { color: #c8b4e6; background: rgba(139,102,190,.15); }
.status.validated, .status.processed { color: #aad2b6; background: rgba(83,148,104,.15); }
.status.rejected { color: #e9aa94; background: rgba(193,82,49,.15); }
.empty-state { padding: 2rem 1rem; border: 1px dashed var(--line); border-radius: 1rem; text-align: center; color: var(--muted); }

.detail-panel { grid-column: 1 / -1; }
.detail-panel h2 { font: 400 clamp(1.8rem, 4vw, 3rem) Georgia, serif; margin: 1rem 0 .5rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .65rem; color: var(--muted); }
.source-reader, .markdown-reader, .git-gateway { margin-top: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; padding: 1.2rem; background: rgba(0,0,0,.3); }
.source-reader pre, .markdown-reader pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-family: Georgia, serif; }
.markdown-reader pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.detail-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.danger-button { color: #f2c3b3; border-color: rgba(216,115,76,.5); background: transparent; }
.git-state { border-radius: 999px; padding: .35rem .65rem; color: var(--gold); background: rgba(212,184,120,.12); font-size: .75rem; }
.git-state.ready, .git-state.transmitted { color: #aad2b6; background: rgba(83,148,104,.15); }
.git-state.failed { color: #e9aa94; background: rgba(193,82,49,.15); }
.git-facts { display: grid; gap: .35rem; margin: 1rem 0; color: var(--muted); font: .76rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.validation-list { margin: 1rem 0; padding-left: 1.3rem; color: var(--moss); font-size: .82rem; line-height: 1.7; }
.git-diff { margin-top: 1rem; }
.git-diff summary { cursor: pointer; color: var(--gold); }
.git-diff pre { max-height: 28rem; overflow: auto; white-space: pre-wrap; color: #d9d3c9; font: .78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
audio { width: 100%; margin-top: .8rem; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem 0 3rem; color: var(--muted); font-size: .78rem; }
.login-page { display: grid; place-items: center; padding: 1rem; }
.login-shell { width: min(480px, 100%); padding: clamp(1.5rem, 6vw, 3rem); text-align: center; }
.login-shell h1 { font-size: clamp(2.3rem, 9vw, 4rem); }
.seed-mark { margin: 1.2rem auto .8rem; color: var(--gold); font-size: 2.4rem; filter: drop-shadow(0 0 18px rgba(212,184,120,.5)); }
.lede { color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: .8rem; margin-top: 1.8rem; text-align: left; }
.login-error { color: #eea68e; }
.threshold-note { margin: 1.5rem 0 0; color: var(--muted); font-size: .75rem; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .deposit-grid { grid-template-columns: 1fr; }
  .gesture-grid { grid-template-columns: 1fr; }
  .circulation { grid-template-columns: repeat(2, 1fr); }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-direction: column; align-items: flex-end; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .seed-card { transition: border-color .2s ease, transform .2s ease; }
}
