/* REBORRN palette (BRAND.md v1.6). Blue is a fill or text on light only, never text on black. */
:root {
  --black: #121212;
  --offwhite: #FBFAF7;
  --white: #FFFFFF;
  --blue: #2A1AFC;
  --ivory: #F6F2E7;
  --warmgrey: #E8E7E2;
  --yellow: #FFF9E2;
  --pink: #FFEEE6;

  /* Tints of the palette: muted ink keeps 4.5:1, field borders keep 3:1, the line is decoration. */
  --ink-muted: rgb(18 18 18 / 0.7);
  --field-border: rgb(18 18 18 / 0.55);
  --line: rgb(18 18 18 / 0.14);
  --on-dark-muted: rgb(251 250 247 / 0.74);
  --on-dark-border: rgb(251 250 247 / 0.5);

  --serif: "Roboto Serif", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ivory); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--black);
  font: 16px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.wrap { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: 20px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

/* Header: the one black band, with the logo small in the corner. */
.band { background: var(--black); color: var(--offwhite); }
.band .wrap { padding-block: 16px 44px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 16px; min-height: 44px;
}
.logo { display: block; height: 16px; width: auto; color: var(--offwhite); }

.who { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--on-dark-muted); font-size: 14px; }
.who form { margin: 0; }
.who-email { overflow-wrap: anywhere; }

h1 {
  margin: 48px 0 12px;
  font: 500 2.25rem/1.05 var(--serif);
  letter-spacing: -0.02em;
}
.lead { max-width: 34rem; margin: 0; color: var(--on-dark-muted); font-size: 17px; line-height: 1.5; }

h2 { margin: 0 0 8px; font: 500 1.5rem/1.15 var(--serif); letter-spacing: -0.01em; }

main.wrap { padding-block: 32px 64px; }

/* Cards sit on ivory in off-white, with a hairline. */
.card {
  background: var(--offwhite);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 20px;
}
.card.narrow { max-width: 30rem; }
.card > p { color: var(--ink-muted); }

form { margin: 0; }
.card form { margin-top: 20px; }

.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 4px; font-weight: 700; }
.hint { margin: 0 0 8px; color: var(--ink-muted); font-size: 14px; }
.error { margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; background: var(--pink); color: var(--black); font-size: 14px; font-weight: 700; }

input[type="email"], input[type="text"], textarea {
  display: block; width: 100%;
  min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--field-border); border-radius: 8px;
  background: var(--white); color: var(--black);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
[aria-invalid="true"] { border-color: var(--black); border-width: 2px; padding: 10px 13px; }

.code-input { max-width: 12rem; font-family: var(--mono); font-size: 20px; letter-spacing: 0.3em; }

.mono { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.address { color: var(--black); }

/* Buttons: one solid blue button per view, everything else quieter. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  border: 1px solid transparent; border-radius: 8px;
  font: 700 16px/1.2 var(--sans);
  cursor: pointer;
}
.button.primary { background: var(--blue); color: var(--offwhite); }
.button.primary:hover { background: color-mix(in srgb, var(--blue) 82%, var(--black)); }
.button.ghost { min-height: 44px; padding: 8px 16px; background: transparent; color: var(--offwhite); border-color: var(--on-dark-border); font-size: 14px; }
.button.ghost:hover { border-color: var(--offwhite); }

.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--black);
  font: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  cursor: pointer;
}
.link:hover { color: var(--blue); text-decoration-thickness: 2px; }

.aside { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.aside form { margin: 0; }

/* Focus is always visible: blue on light surfaces, off-white on the black band. */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.band :focus-visible { outline-color: var(--offwhite); }

/* The board. */
.post-form .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.posted { margin: 0; color: var(--black); font-weight: 700; }

.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 48px 0 12px; }
.board-head h2 { margin: 0; }
.board-head p { margin: 0; color: var(--ink-muted); font-size: 14px; }

.ideas { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.idea {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: 16px;
}
.idea h3 { margin: 2px 0 6px; font: 500 1.25rem/1.25 var(--serif); overflow-wrap: anywhere; }
.idea .details { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.idea .meta { margin: 0; color: var(--ink-muted); font-size: 14px; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--warmgrey); color: var(--black); font-size: 13px; font-weight: 700; }

/* Freshly posted idea: a soft yellow block, the secondary palette's quiet background. */
.idea.is-new { margin-inline: -12px; padding-inline: 12px; border-radius: 8px; background: var(--yellow); }

.vote form { margin: 0; }
.vote-button, .vote-count {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 64px; min-height: 64px;
  border: 1px solid var(--field-border); border-radius: 10px;
  background: var(--white); color: var(--black);
  font: 700 18px/1 var(--sans);
}
.vote-button { cursor: pointer; }
.vote-button svg { width: 18px; height: 18px; }
.vote-button:hover { border-color: var(--blue); color: var(--blue); }
.vote-button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--offwhite); }
.vote-button[aria-busy="true"] { cursor: progress; opacity: 0.7; }
.vote-count { border-style: dashed; background: transparent; }
.vote-count small { font-size: 12px; font-weight: 400; color: var(--ink-muted); }

/* Shown only when a vote fails. */
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 12px 16px;
  border-radius: 8px; background: var(--black); color: var(--offwhite); font-weight: 700;
}
.toast:empty { display: none; }

.empty { padding: 32px 0; border-bottom: 1px solid var(--line); color: var(--ink-muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (min-width: 40rem) {
  .band .wrap { padding-block: 20px 56px; }
  h1 { margin-top: 64px; font-size: 3.25rem; }
  .lead { font-size: 18px; }
  h2 { font-size: 1.75rem; }
  .card { padding: 28px; }
  .idea h3 { font-size: 1.375rem; }
}

@media (max-width: 30rem) {
  .logo { height: 14px; }
  .idea { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; }
  .vote-button, .vote-count { width: 56px; min-height: 60px; }
}

@media (prefers-reduced-motion: no-preference) {
  .vote-button { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
}
