:root {
  --ink: #100e0c;
  --paper: #d8d2c6;
  --mute: #8c8578;
  --line: #2a241c;
  --amber: #f0a41a;
  --amber-dim: #9a6410;
  --seal: #d83a28;
  --panel: #181410;
  --focus: #f3c56a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 88% -10%, rgba(240, 164, 26, 0.16), transparent 55%),
    linear-gradient(180deg, #16130f 0%, var(--ink) 40%, #0b0908 100%);
  color: var(--paper);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 380;
  letter-spacing: 0.01em;
}

.safelight {
  position: fixed;
  top: -80px;
  right: 8vw;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 164, 26, 0.28), transparent 68%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.is-busy .safelight {
  opacity: 1;
  transform: scale(1.25);
  filter: blur(2px);
}

.top,
main,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 6vw;
  border-bottom: 1px solid var(--line);
}

.mark {
  color: var(--paper);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.mark span {
  display: block;
  color: var(--mute);
  font-weight: 380;
  letter-spacing: 0.16em;
  font-size: 0.62rem;
  margin-top: 0.15rem;
}

nav {
  display: flex;
  gap: 1.4rem;
}

nav a {
  color: var(--mute);
  text-decoration: none;
  font-size: 0.86rem;
}

nav a:hover,
nav a:focus-visible {
  color: var(--amber);
}

.hero {
  padding: 12vh 6vw 10vh;
  max-width: 58rem;
}

.eyebrow {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  margin: 0 0 1.2rem;
}

h1,
h2,
h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 620;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.95;
  margin: 0 0 1.4rem;
}

h1 em {
  font-style: italic;
  font-weight: 400;
  color: #f2e6cf;
}

.lead {
  max-width: 34rem;
  color: var(--mute);
  font-size: 1.12rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 2rem 0 1.8rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
}

.btn.primary {
  background: var(--amber);
  color: #1a1204;
  font-weight: 650;
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn.ghost {
  border-color: var(--line);
  color: var(--paper);
  background: transparent;
}

.btn.small {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.pills li {
  border: 1px solid var(--line);
  color: var(--mute);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.lab,
.history {
  padding: 4rem 6vw 5rem;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-head h2 {
  margin: 0;
  font-size: 2rem;
}

.quota,
.hint,
.empty,
.status {
  color: var(--mute);
  font-size: 0.9rem;
}

.board {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.3rem;
  display: grid;
  gap: 1.1rem;
}

.prompt-wrap,
.aspect {
  display: grid;
  gap: 0.4rem;
}

.prompt-wrap span,
.aspect span,
legend {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

textarea,
select {
  width: 100%;
  background: #100e0c;
  color: var(--paper);
  border: 1px solid var(--line);
  font: inherit;
  padding: 0.85rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

textarea:focus,
select:focus,
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: end;
}

.count {
  border: 0;
  padding: 0;
  margin: 0;
}

.seg {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.seg label {
  border: 1px solid var(--line);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.seg input {
  accent-color: var(--amber);
}

.drop {
  border: 1px dashed #3a3328;
  padding: 1rem;
  text-align: center;
}

.drop p {
  margin: 0 0 0.7rem;
  color: var(--mute);
}

.drop strong {
  display: block;
  color: var(--paper);
  font-weight: 500;
  margin-top: 0.25rem;
}

.thumbs {
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.thumbs img,
.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbs li {
  width: 72px;
  height: 72px;
  position: relative;
}

.thumbs button.remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--seal);
  color: white;
  cursor: pointer;
  font-size: 0.7rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stage h3 {
  font-size: 1.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.card {
  background: #100e0c;
  border: 1px solid var(--line);
}

.card figcaption {
  padding: 0.5rem 0.65rem 0.7rem;
  color: var(--mute);
  font-size: 0.75rem;
}

.card .row-mini {
  display: flex;
  gap: 0.4rem;
  padding: 0 0.65rem 0.7rem;
}

.empty[hidden],
.stage[hidden] {
  display: none;
}

.foot {
  padding: 2rem 6vw 3rem;
  color: var(--mute);
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .hero {
    padding-top: 8vh;
  }
}
