@layer reset, base, layout, parts, utility, print;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, figure, ul { margin: 0; }
  img { display: block; max-width: 100%; height: auto; }
  button, input { font: inherit; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: light;
    --paper: #faf5e9;
    --mount: #fffdf7;
    --ink: #292e39;
    --blue: #263fa9;
    --blue-hover: #1d307f;
    --wash: #e8ecf7;
    --quiet: #50566a;
    --line: #c9c2b4;
    --book: Charter, "Bitstream Charter", Georgia, serif;
    --corner: 6px;
  }
  html { background: var(--paper); }
  body { background: var(--paper); color: var(--ink); font: 1.1875rem/1.65 var(--book); overflow-wrap: break-word; }
  h1, h2, h3 { font-family: var(--book); font-weight: 600; line-height: 1.18; text-wrap: balance; }
  h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); max-width: 19ch; }
  h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); max-width: 30ch; }
  h3 { font-size: 1.375rem; line-height: 1.35; }
  p, li { max-width: 66ch; }
  p + p { margin-top: 1rem; }
  a { color: var(--blue); text-underline-offset: .23em; text-decoration-thickness: 1px; }
  a:hover { color: var(--blue-hover); text-decoration-thickness: 2px; }
  button { cursor: pointer; }
  :focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
  ul { padding-left: 1.4rem; margin-top: 1.1rem; }
  li + li { margin-top: .8rem; }
  li::marker { color: var(--blue); }
}

@layer layout {
  .wrap { width: min(72rem, calc(100% - 4rem)); margin-inline: auto; }
  .uf, .mast, .acts, .kit-top { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
  .uf { flex-wrap: wrap; }
  .uf > div { display: flex; gap: 1.5rem; flex-wrap: wrap; }
  .mast { padding-block: 1.6rem; }
  .hg { display: grid; gap: 4rem; align-items: center; padding-block: 3rem 4rem; }
  .home .hg { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .lead { max-width: 48rem; min-width: 0; }
  .content { max-width: 56rem; padding-block: 1rem 4rem; }
  .sect { padding-block: 3rem; border-bottom: 1px solid var(--line); }
  .sect:last-child { border-bottom: 0; }
  .sect h2 { margin-bottom: 1.4rem; }
  .acts { justify-content: flex-start; flex-wrap: wrap; margin-top: 1.75rem; gap: .5rem 1.5rem; }
  .src-links { display: grid; margin-top: 1rem; justify-items: start; }
  .foot { padding-block: 2.5rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; border-top: 2px solid var(--line); }
  .foot p { max-width: 40ch; color: var(--quiet); }
  .foot nav { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
  .foot nav a { display: flex; align-items: center; min-height: 48px; }
  @media (max-width: 760px) {
    .wrap { width: calc(100% - 2.5rem); }
    .home .hg { grid-template-columns: 1fr; gap: 2.5rem; }
    .hg { padding-block: 2rem 3rem; }
    .art { max-width: 30rem; justify-self: center; }
    .foot { grid-template-columns: 1fr; gap: 1.5rem; }
    .kit-top { align-items: flex-start; flex-direction: column; }
    .sect { padding-block: 2.25rem; }
  }
}

@layer parts {
  .util { background: var(--wash); color: var(--ink); font-size: 1.0625rem; }
  .util a { display: inline-flex; min-height: 48px; align-items: center; }
  .util span { padding-block: .65rem; }
  .mast { color: var(--ink); border-bottom: 1px solid var(--line); }
  .name { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; min-height: 48px; justify-content: center; font-size: 2.25rem; line-height: 1.1; font-weight: 600; }
  .name span { font-size: 1.0625rem; line-height: 1.5; font-weight: 400; color: var(--quiet); }
  .menu { position: relative; z-index: 5; font-size: 1.125rem; }
  .menu summary { cursor: pointer; min-height: 48px; padding: .6rem 1.1rem; background: var(--mount); border: 1px solid var(--line); border-radius: var(--corner); color: var(--blue); }
  .menu summary::marker { color: var(--blue); }
  .menu nav { position: absolute; right: 0; top: calc(100% + .6rem); width: min(22rem, 85vw); padding: .75rem; background: var(--mount); color: var(--ink); border: 2px solid var(--line); border-radius: var(--corner); }
  .menu nav a { display: flex; min-height: 52px; align-items: center; padding: .6rem .8rem; border-radius: var(--corner); }
  .menu nav a:hover, .menu nav a[aria-current="page"] { background: var(--wash); }
  .menu nav a[aria-current="page"] { font-weight: 600; }
  .hero { background: var(--paper); color: var(--ink); }
  .tag { font-size: 1.125rem; line-height: 1.5; color: var(--blue); margin-bottom: 1.25rem; }
  .deck { font-size: 1.375rem; line-height: 1.5; margin-block: 1.5rem; max-width: 50ch; }
  .status { padding: 1rem 1.25rem; background: var(--wash); border-radius: var(--corner); }
  .art { width: 100%; padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--mount); border: 2px solid var(--line); border-radius: var(--corner); }
  .art img { width: 100%; height: auto; aspect-ratio: 3/2; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--quiet); font: 1rem/1.6 var(--book); }
  .art::after { content: "1"; display: block; width: 3rem; margin-top: 1.5rem; padding-top: .5rem; border-top: 2px solid var(--blue); color: var(--quiet); font-size: 1rem; line-height: 1.5; }
  .sheet { background: var(--paper); border-top: 2px solid var(--line); }
  .btn { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; padding: .8rem 1.25rem; min-height: 52px; max-width: 100%; background: var(--blue); color: var(--mount); border: 2px solid var(--blue); border-radius: var(--corner); font-weight: 600; text-decoration: none; font-size: 1.125rem; line-height: 1.5; }
  .btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--mount); }
  .plain, .go, .read { display: inline-flex; align-items: center; min-height: 48px; max-width: 100%; gap: .5rem; padding-block: .6rem; font-size: 1.1875rem; }
  .plain span, .go span, .read span, .btn span { flex: 0 0 auto; }
  .go { margin-top: 1rem; font-weight: 600; }
  .tint { padding-inline: 2.5rem; background: var(--wash); margin-block: 1.5rem; border: 0; border-radius: var(--corner); }
  .bill { padding-left: 0; list-style: none; }
  .bill li { max-width: none; display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(0, 3fr); gap: 2rem; border-top: 1px solid var(--line); padding-block: 1.5rem; margin: 0; }
  .bill p { max-width: 56ch; }
  .kit { scroll-margin-top: 1rem; background: var(--mount); border: 2px solid var(--line); border-radius: var(--corner); padding-inline: 2.5rem; margin-block: 1.5rem; }
  .kit h3 { margin-top: 1.8rem; }
  .kit-top { gap: 1rem; flex-wrap: wrap; }
  .kit-top h2 { margin: 0; }
  .kit-top + p { margin-top: 1rem; }
  .checks { padding: 0; list-style: none; margin-top: .6rem; }
  .checks li { margin: 0; max-width: 66ch; border-bottom: 1px solid var(--line); }
  .checks label { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem .25rem; min-height: 52px; cursor: pointer; border-radius: var(--corner); }
  .checks input { width: 44px; height: 44px; flex: 0 0 44px; margin: 0; accent-color: var(--blue); }
  .checks label:has(input:checked) { background: var(--wash); }
  .notes { display: none; }
  .urgent { padding-inline: 2.5rem; background: var(--wash); border: 0; border-radius: var(--corner); margin-block: 1.5rem; }
  .end { padding-top: 1.5rem; }
  @media (max-width: 760px) {
    .mast { padding-block: 1.25rem; }
    .name { font-size: 2rem; }
    .tint, .kit, .urgent { padding-inline: 1.25rem; }
    .bill li { grid-template-columns: 1fr; gap: .65rem; }
    .util .uf { gap: 0; padding-bottom: .3rem; }
    .util .uf > div { gap: 1.25rem; }
    .checks label { gap: .75rem; }
  }
}

@layer utility {
  .skip { position: absolute; top: -12rem; left: 1rem; z-index: 20; color: var(--mount); background: var(--blue); padding: .75rem 1rem; min-height: 48px; border-radius: var(--corner); }
  .skip:focus { top: .5rem; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
}

@layer print {
  @media print {
    @page { margin: 15mm; }
    html, body, .sheet { background: white; color: #111; }
    body { font-size: 12pt; line-height: 1.4; }
    header, footer, .skip, .art, button, .end { display: none; }
    .hero { background: white; color: #111; }
    .tag { color: #111; }
    .status { padding: 0; background: white; }
    .wrap, .content { width: 100%; max-width: none; padding: 0; }
    .hg { display: block; padding: 0 0 1rem; }
    h1 { font-size: 28pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 13pt; }
    p, li, .read, .go { font-size: 12pt; }
    .sect { padding-block: 1rem; }
    .tint, .kit, .urgent { margin: 0; padding-inline: 0; background: white; border: 0; }
    a { color: #111; }
    .checks label { min-height: 0; padding-block: .55rem; gap: .6rem; }
    .checks input { width: 14pt; height: 14pt; flex-basis: 14pt; }
    .checks li { break-inside: avoid; }
    .checks label:has(input:checked) { background: white; }
    .kit h3 { margin-top: .8rem; }
    .notes { display: block; margin-top: 1.4rem; }
    .notes div { height: 1.5rem; border-bottom: 1px solid #777; }
    body.kit-print .hero, body.kit-print .content > :not(.kit) { display: none; }
    body.kit-print .kit { padding-top: 0; border: 0; }
    body.kit-print .sheet { border: 0; }
  }
}
