@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/ibm-plex-sans-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #12110e;
  --ink: #f4f0e6;
  --muted: #a39e92;
  --line: #3a362f;
  --paper: #f3efe4;
  --paper-ink: #1c1a16;
  --paper-muted: #5f594e;
  --paper-line: #d9d2c3;
  --stamp: #e4f58a;
  --danger: #8c2f12;
  --sans: "IBM Plex Sans", "Liberation Sans", "Nimbus Sans", sans-serif;
  --mono: "IBM Plex Mono", "Liberation Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(#e4f58a, #e4f58a) top / 100% 6px no-repeat,
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--stamp);
  color: var(--paper-ink);
  padding: 8px 12px;
  z-index: 5;
}

.skip:focus { top: 12px; }

.top,
.layout,
.foot,
.banner {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.top { padding: 22px 0 0; }

.kicker {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.lede {
  max-width: 40rem;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.banner {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #8a5a32;
  border-radius: 12px;
  background: #3a2416;
  color: #ffd7a8;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  padding: 16px 0 28px;
  align-items: start;
}

@media (min-width: 801px) {
  .results { position: sticky; top: 12px; }
}

.paper {
  background: var(--paper);
  color: var(--paper-ink);
  color-scheme: light;
  border-radius: 18px;
  padding: 18px;
}

.results { display: grid; gap: 10px; }

.field { margin-bottom: 16px; }

label,
legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

input[type="text"],
input:not([type]),
textarea,
select,
#name,
#who {
  width: 100%;
  border: 1px solid var(--paper-line);
  background: #fffdf8;
  color: var(--paper-ink);
  border-radius: 10px;
  padding: 12px 12px;
  min-height: 44px;
  font: inherit;
}

textarea { resize: vertical; min-height: 88px; }

.hint,
.error {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
}

.hint { color: var(--paper-muted); min-height: 0; }
.hint:empty { display: none; }
.error { color: var(--danger); }

.choices,
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }

.choice,
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  background: #fffdf8;
  font-weight: 400;
  cursor: pointer;
}

.toggle { width: 100%; border-radius: 12px; }

.choice input,
.toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice:has(input:checked),
.toggle:has(input:checked) {
  background: var(--paper-ink);
  color: var(--ink);
  border-color: var(--paper-ink);
}

.choice:focus-within,
.toggle:focus-within,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
.skip:focus {
  outline: 2px solid #1c1a16;
  outline-offset: 2px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 14px;
  background: var(--paper-ink);
  color: var(--ink);
  cursor: pointer;
}

button.ghost,
.panel button {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

button:disabled { opacity: 0.38; cursor: not-allowed; }

.drafts { margin-top: 22px; }
.drafts h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.draft {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--paper-line);
  padding: 6px 0;
}
.draft-open {
  flex: 1;
  text-align: left;
  background: transparent;
  color: inherit;
  border-color: transparent;
  border-radius: 8px;
  padding-left: 8px;
}
.text-btn {
  background: transparent;
  color: var(--paper-muted);
  border-color: transparent;
  min-height: 44px;
}

.stamp {
  border-radius: 18px;
  padding: 16px 18px 14px;
  color: var(--paper-ink);
  background: #f3efe4;
}
.stamp[data-action="build"] { background: #e4f58a; }
.stamp[data-action="adopt"] { background: #d5f5c8; }
.stamp[data-action="fork"] { background: #ffe3a3; }
.stamp[data-action="defer"] { background: #e7e1d4; }
.stamp .kicker { color: #4e4a40; }
.stamp h2 {
  margin: 0 0 8px;
  font-size: clamp(1.85rem, 3.4vw, 2.7rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.stamp p { margin: 0 0 12px; }
.path {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: #1c1a16;
  color: #e4f58a;
  padding: 10px 12px;
  border-radius: 10px;
  overflow-wrap: anywhere;
}
#rules {
  margin: 4px 0 0;
  padding-left: 1.1rem;
  color: #3c382f;
}
#rules:empty { display: none; }

.panel {
  background: #1c1b17;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px 6px;
  min-width: 0;
}
.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.panel h2 {
  margin: 0;
  font-size: 0.95rem;
}
.tabs { display: flex; gap: 6px; }
.tabs button[aria-selected="true"] {
  background: var(--stamp);
  color: var(--paper-ink);
  border-color: var(--stamp);
}
.panel button:focus-visible { outline-color: #e4f58a; }
pre {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  color: #ebe6da;
  max-height: 280px;
  overflow: auto;
}

.status {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1c1a16;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stamp);
  z-index: 4;
}
.status:empty { display: none; }

.foot {
  padding: 8px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 800px) {
  .top,
  .layout,
  .foot,
  .banner { width: min(1120px, calc(100% - 28px)); }
  .layout { grid-template-columns: 1fr; }
  .top { padding-top: 20px; }
  .paper,
  .stamp { padding: 16px; }
  .choices { display: grid; grid-template-columns: 1fr 1fr; }
  .choice { justify-content: center; }
}

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