/* Sampled base swatches from assets/references/ui-storyboard.png, palette row.
   Sky (80,201,252), grass (23,200,108), yellow (252,195,26),
   red (251,66,69), blue (50,130,251), purple (159,80,251),
   ink (14,25,38), panel (229,236,238). Lighter/darker values below are
   same-hue contrast variants; no new base hue is introduced. */
:root {
  --sky: #50c9fc;
  --grass: #17c86c;
  --yellow: #fcc31a;
  --red: #fb4245;
  --blue: #3282fb;
  --purple: #9f50fb;
  --ink: #0e1926;
  --panel: #e5ecee;
  --paper: #fff;
  --sky-soft: #c9f1ff;
  --grass-soft: #b7f7d1;
  --ink-soft: #33475c;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--sky-soft) 0 44%, var(--sky) 60%, var(--grass-soft) 60%, var(--grass) 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }

.shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px) env(safe-area-inset-bottom, 16px);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 64px;
  padding: 12px 22px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 0 0 12px 12px;
}
.brand, .topbar-tag, h1, h2, .eyebrow, .action {
  font-weight: 900;
  letter-spacing: .02em;
}
.brand { font-size: clamp(1.15rem, 2.5vw, 1.6rem); line-height: 1; }
.topbar-tag { font-size: .8rem; }
.preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 10px 18px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.preview-banner a { margin-left: auto; font-weight: 800; }

.hero { padding: clamp(28px, 5vw, 64px) 0 22px; }
.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px;
  font-size: .75rem;
}
h1 {
  margin: 12px 0 6px;
  font-size: clamp(2.2rem, 7vw, 4.7rem);
  line-height: 1.03;
  text-wrap: balance;
}
.lede {
  max-width: 56ch;
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 650;
}
.content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  align-content: start;
  gap: 18px;
}
.card {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 7px 0 var(--ink);
}
.card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.1;
}
.card p { margin: 0 0 18px; line-height: 1.48; }
.card p:last-child { margin-bottom: 0; }
.danger-card { border-color: var(--red); box-shadow: 0 7px 0 var(--red); }
.warning { color: #a52226; font-weight: 700; }
.muted { color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 130px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--ink);
  text-align: center;
  text-decoration: none;
  line-height: 1.15;
}
.action:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.action:active:not(:disabled) { box-shadow: 0 1px 0 var(--ink); transform: translateY(3px); }
.action:disabled { opacity: .65; cursor: wait; }
.action.secondary { background: var(--panel); }
.action.ghost { background: var(--paper); }
.action.danger { color: var(--paper); background: var(--red); }
.text-link { display: inline-block; margin-top: 8px; font-weight: 800; text-underline-offset: 4px; }
.code-form { display: grid; gap: 8px; max-width: 24rem; }
.code-form label { font-weight: 800; }
.code-input {
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.status {
  min-height: 48px;
  margin: 22px 0;
  padding: 10px 14px;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 700;
}
.status:empty { display: none; }
.status[data-kind="error"] { background: var(--red); color: var(--paper); }
.footer { margin-top: auto; padding: 30px 0 18px; font-size: .8rem; font-weight: 900; }

@media (max-width: 620px) {
  .shell { padding-inline: 14px; }
  .topbar { padding: 12px 14px; }
  .topbar-tag { font-size: .7rem; }
  .content { grid-template-columns: 1fr; }
  .actions { align-items: stretch; }
  .actions .action { flex: 1 1 100%; }
  .card > .action { width: 100%; }
  .preview-banner a { margin-left: 0; }
}

@media (max-height: 500px) and (min-width: 650px) {
  .topbar { min-height: 48px; padding-block: 8px; }
  .hero { padding: 12px 0 12px; }
  h1 { font-size: clamp(2rem, 5vw, 3rem); margin-top: 7px; }
  .card { padding: 16px 20px; }
  .card p { margin-bottom: 10px; }
  .footer { padding: 12px 0; }
}

@media (min-width: 1800px) and (min-height: 900px) {
  :root { font-size: 20px; }
  .shell { width: min(86vw, 1540px); }
  .topbar { min-height: 76px; }
  .card { padding: 32px; }
  .action { min-height: 60px; padding: 14px 20px; }
}

@media (min-width: 3000px) {
  :root { font-size: 28px; }
  .shell { width: min(80vw, 2400px); }
  .topbar { min-height: 100px; }
  .card { padding: 48px; }
  .action { min-height: 80px; padding: 18px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .action:hover:not(:disabled), .action:active:not(:disabled) { transform: none; }
}
