:root {
  --paper: #efe6d4;
  --ink: #1c1914;
  --muted: #5c564c;
  --forest: #1e4a38;
  --deep: #143028;
  --card: #f7f1e6;
  --line: #d9d0be;
  --ochre: #c9842a;
  --danger: #8c2f24;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, #f6f1e4, transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}

body.is-out {
  background: var(--deep);
  color: #f3efe4;
}

header, main, footer {
  width: min(40rem, calc(100% - 2rem));
  margin-inline: auto;
}

header { padding-top: 1.75rem; }

.brand, h1, h2, .timer, legend {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
}

.brand {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.tag, .meta, footer, #model-status, #last-note {
  color: var(--muted);
}

body.is-out .tag,
body.is-out footer,
body.is-out #model-status,
body.is-out #last-note { display: none; }

body.is-out header { padding-top: 1rem; }
body.is-out .brand { color: #f3efe4; font-size: 1rem; }

#model-status, #last-note { margin: 0.35rem 0 0; font-size: 0.92rem; }
#last-note { color: var(--forest); }

main { padding: 1.25rem 0 2rem; }

fieldset {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
}

legend {
  font-size: 1.25rem;
  margin-bottom: 0.55rem;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.choices button, .ghost, .primary, .texty, input, textarea {
  font: inherit;
}

.choices button {
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}

.choices button span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.choices button[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: #f4f1e8;
}

.choices button[aria-pressed="true"] span { color: #d7e4db; }

.city, #note-form label {
  display: grid;
  gap: 0.35rem;
  margin: 0.2rem 0 1rem;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
}

textarea { resize: vertical; }

.primary, .ghost, .texty {
  width: 100%;
  border-radius: 999px;
  min-height: 3.1rem;
  cursor: pointer;
}

.primary {
  border: 0;
  background: var(--forest);
  color: #f4f1e8;
  font-size: 1.05rem;
}

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ghost, .texty {
  margin-top: 0.5rem;
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--line);
}

.texty { border-color: transparent; }

body.is-out .primary { background: #e7b15a; color: #1c1914; }
body.is-out .texty { color: #f3efe4; }

article, #outside {
  background: var(--card);
  border-radius: 18px;
  padding: 1.25rem 1.2rem 1.1rem;
  box-shadow: 0 16px 40px rgba(28, 25, 20, 0.06);
}

body.is-out #outside {
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ochre);
}

h1 { font-size: clamp(2rem, 7vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0.2rem 0 0.4rem; }
h2 { font-size: 1rem; margin: 1rem 0 0.15rem; }
#card-notice { font-size: 1.25rem; }

.timer {
  margin: 0.2rem 0 1rem;
  font-size: clamp(4.5rem, 22vw, 8rem);
  line-height: 1.1;
  color: #e7b15a;
  font-variant-numeric: tabular-nums;
}

#out-notice { font-size: clamp(1.5rem, 5vw, 2.1rem); }

.error { color: var(--danger); min-height: 1.2rem; }

footer { padding-bottom: 2rem; font-size: 0.85rem; }
footer a { color: var(--forest); }

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .choices { grid-template-columns: 1fr; }
}

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

@media print {
  body { background: white; }
  header .tag, #model-status, #setup, #go-actions, #outside, footer, #stay { display: none !important; }
  article { box-shadow: none; }
}
