@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-full-normal.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* ─ Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --paper:        #FAF7F0;
  --card:         #EFE8DC;
  --ink:          #2E2B26;
  --ink-body:     #4A443C;
  --stone:        #6B6154;
  --slate:        #3F565E;
  --slate-press:  #334750;
  --plaster:      #DFC2AF;
  --oxblood:      #8E3B33;
  --oxblood-tint: #F2E1D9;
  --hairline:     #E0D7C7;
  --on-dark:      #FFFFFF;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ─ Page ────────────────────────────────────────────────────────────────── */
.page {
  max-width: 680px;
  margin: 0 auto;
}

header, main, footer {
  padding-inline: 20px;
}

/* ─ Typography ──────────────────────────────────────────────────────────── */

/* Child's name — Fraunces only, nowhere else */
.child-name {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 48, 'wght' 400, 'SOFT' 30, 'WONK' 0;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
}

h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 8px;
}

h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 4px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--stone);
}

.lede {
  color: var(--ink-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--stone);
}

/* ─ Header ──────────────────────────────────────────────────────────────── */
header {
  padding-block: 48px 32px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 32px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-text { flex: 1; }

.hero-intro {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--stone);
  margin: 0 0 4px;
}

.avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--slate);
  color: var(--on-dark);
  font-size: 1.5rem;
  font-weight: 600;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.trust strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

.trust span {
  font-size: 0.8125rem;
  color: var(--stone);
  line-height: 1.4;
}

/* ─ Scoreboard ──────────────────────────────────────────────────────────── */
.scoreboard {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.scoreboard > div { flex: 1; }

.scoreboard p {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--stone);
}

.scoreboard strong {
  display: block;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.scoreboard small {
  font-size: 0.8125rem;
  color: var(--stone);
  line-height: 1.4;
}

/* ─ Section titles ──────────────────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

/* ─ Severity: Must know ─────────────────────────────────────────────────── */
.must-know {
  background: var(--oxblood-tint);
  border-left: 3px solid var(--oxblood);
  border-radius: 0;
  padding: 20px 20px 20px 17px;
  margin-bottom: 32px;
}

.must-know .tier-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--oxblood);
  margin: 0 0 12px;
}

.must-know h2 { margin-bottom: 16px; }

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.safety-grid h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.safety-grid p {
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.boundary {
  font-size: 0.8125rem;
  color: var(--stone);
  line-height: 1.5;
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.boundary strong { color: var(--ink); }

/* ─ Note cards (dimensions) ─────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 32px;
}

.note-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.note-card.is-na { opacity: 0.55; }

.provenance {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--stone);
  margin: 0 0 4px;
}

.note-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 6px;
}

.note-card p {
  font-size: 0.9375rem;
  color: var(--ink-body);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--hairline);
}

/* ─ Day pass ────────────────────────────────────────────────────────────── */
.day-pass {
  background: var(--card);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 32px;
}

.day-pass > div:first-child { margin-bottom: 24px; }

#pass-form { display: grid; gap: 16px; }

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

input[type="text"],
input[type="datetime-local"],
input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--stone);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

fieldset legend {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  margin-bottom: 8px;
  float: left;
  width: 100%;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.disclosure {
  background: var(--paper);
  border-radius: 8px;
  padding: 12px 14px;
}

.disclosure strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.disclosure p {
  font-size: 0.8125rem;
  color: var(--stone);
  margin: 0;
  line-height: 1.5;
}

/* ─ Pass result ─────────────────────────────────────────────────────────── */
.pass-ticket {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 20px;
}

.pass-ticket h3 { margin-bottom: 8px; }

.pass-ticket .window {
  font-size: 0.9375rem;
  color: var(--stone);
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.pass-ticket .shared {
  font-size: 0.9375rem;
  color: var(--ink-body);
  margin: 8px 0 0;
}

.revoked {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
}

.revoked h3 { margin-bottom: 8px; }

.revoked p {
  font-size: 0.9375rem;
  color: var(--ink-body);
  margin: 0;
}

/* ─ Buttons ─────────────────────────────────────────────────────────────── */
button { font: inherit; cursor: pointer; }

.primary {
  background: var(--slate);
  color: var(--on-dark);
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1.0625rem;
  font-weight: 600;
  width: 100%;
  text-align: center;
}

.primary:hover  { background: var(--slate-press); }
.primary:active { background: var(--slate-press); }

.ghost {
  background: transparent;
  border: 1px solid var(--stone);
  color: var(--stone);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.danger {
  background: transparent;
  border: 1px solid var(--oxblood);
  color: var(--oxblood);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1.0625rem;
  font-weight: 600;
  width: 100%;
  margin-top: 16px;
}

.text-button {
  border: 0;
  background: none;
  color: var(--slate);
  font-weight: 600;
  padding: 4px 0;
  font-size: 0.9375rem;
}

/* ─ Footer ──────────────────────────────────────────────────────────────── */
footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--stone);
}

footer strong { color: var(--ink); }

/* ─ Focus ───────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
}

/* ─ Screen reader only ──────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ─ Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .safety-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .date-row {
    grid-template-columns: 1fr;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .scoreboard button {
    grid-column: 1 / -1;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* ─ Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
