/* Overdue. Plain CSS, no build step. */

:root {
  --paper: #f3ead5;
  --paper-2: #ebdfc3;
  --pocket: #e4d1a6;
  --card: #fffcf3;
  --ink: #1d1a14;
  --ink-2: #463f31;
  --ink-3: #62594a;
  --red: #b3261e;
  --red-soft: rgba(179, 38, 30, 0.1);
  --blue: #1d4d97;
  --blue-soft: rgba(29, 77, 151, 0.1);
  --rule: rgba(29, 77, 151, 0.13);
  --margin: rgba(179, 38, 30, 0.42);
  --edge: rgba(29, 26, 20, 0.16);
  --edge-strong: rgba(29, 26, 20, 0.55);
  --shadow: 0 1px 0 rgba(60, 40, 10, 0.06), 0 14px 28px -18px rgba(60, 40, 10, 0.45);
  --focus: #1d4d97;
  --foot: #1d1a14;
  --foot-ink: #f3ead5;
  --foot-ink-2: #cfc4aa;
  --grain-opacity: 0.35;
  --f-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Courier Prime', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --wrap: 1180px;
  --gut: 24px;
  --grunge: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.09' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -6 0 0 0 4.1'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  --grunge-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -10 0 0 0 7.1'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  --grunge-soft: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.09' numOctaves='4' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -6 0 0 0 4.6'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.09 0'/></filter><rect width='180' height='180' filter='url(%23g)'/></svg>");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #14120e;
    --paper-2: #1b1812;
    --pocket: #2e281d;
    --card: #221e17;
    --ink: #f2e9d3;
    --ink-2: #d3c8ae;
    --ink-3: #aea38b;
    --red: #ff7a67;
    --red-soft: rgba(255, 122, 103, 0.12);
    --blue: #93b5f2;
    --blue-soft: rgba(147, 181, 242, 0.12);
    --rule: rgba(147, 181, 242, 0.09);
    --margin: rgba(255, 122, 103, 0.4);
    --edge: rgba(242, 233, 211, 0.14);
    --edge-strong: rgba(242, 233, 211, 0.5);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 30px -18px rgba(0, 0, 0, 0.9);
    --focus: #93b5f2;
    --foot: #0c0b08;
    --foot-ink: #f2e9d3;
    --foot-ink-2: #bdb298;
    --grain-opacity: 0.5;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --paper: #14120e;
  --paper-2: #1b1812;
  --pocket: #2e281d;
  --card: #221e17;
  --ink: #f2e9d3;
  --ink-2: #d3c8ae;
  --ink-3: #aea38b;
  --red: #ff7a67;
  --red-soft: rgba(255, 122, 103, 0.12);
  --blue: #93b5f2;
  --blue-soft: rgba(147, 181, 242, 0.12);
  --rule: rgba(147, 181, 242, 0.09);
  --margin: rgba(255, 122, 103, 0.4);
  --edge: rgba(242, 233, 211, 0.14);
  --edge-strong: rgba(242, 233, 211, 0.5);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 30px -18px rgba(0, 0, 0, 0.9);
  --focus: #93b5f2;
  --foot: #0c0b08;
  --foot-ink: #f2e9d3;
  --foot-ink-2: #bdb298;
  --grain-opacity: 0.5;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: var(--grain-opacity);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

img,
canvas,
svg {
  max-width: 100%;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.mono {
  font-family: var(--f-mono);
}

/* ---------- stamps ---------- */

.stamp {
  display: inline-block;
  color: var(--red);
  border: 3px solid currentColor;
  border-radius: 6px;
  padding: 0.12em 0.4em 0.06em;
  font-family: var(--f-sans);
  font-variation-settings: 'wdth' 70;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  -webkit-mask-image: var(--grunge);
  mask-image: var(--grunge);
  -webkit-mask-size: 240px 240px;
  mask-size: 240px 240px;
}

.stamp-blue {
  color: var(--blue);
}

.stamp-soft {
  -webkit-mask-image: var(--grunge-soft);
  mask-image: var(--grunge-soft);
}

.brand .stamp,
.hook .stamp,
.student-tip .stamp {
  -webkit-mask-image: var(--grunge-light);
  mask-image: var(--grunge-light);
}

/* ---------- header ---------- */

.top {
  padding: 18px 0 8px;
}

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

.brand {
  text-decoration: none;
  color: var(--red);
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.brand .stamp {
  font-size: 26px;
  transform: rotate(-4deg);
  padding: 0.14em 0.36em 0.06em;
}

.top nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.top nav a {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 10px;
  border-radius: 4px;
}

.top nav a:hover {
  background: var(--red-soft);
  color: var(--red);
}

.theme-toggle {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--edge-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun {
    display: none;
  }
  :root:not([data-theme='light']) .theme-toggle .moon {
    display: block;
  }
}

/* ---------- hero ---------- */

.hero {
  padding: 40px 0 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(52px, 8.4vw, 112px);
  font-weight: 900;
  font-variation-settings: 'wdth' 64;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.005em;
}

.hero h1 .stamp {
  -webkit-mask-image: var(--grunge-soft);
  mask-image: var(--grunge-soft);
  -webkit-mask-size: 520px 520px;
  mask-size: 520px 520px;
  font-size: 1em;
  border-width: 0.07em;
  border-radius: 0.09em;
  padding: 0.06em 0.12em 0;
  margin-top: 0.06em;
  transform: rotate(-3deg);
  transform-origin: left center;
}

.lede {
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.5;
  max-width: 34em;
  color: var(--ink-2);
}

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

.cta-row {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--f-sans);
  font-variation-settings: 'wdth' 80;
  font-weight: 800;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: #fffaf0;
  box-shadow: 4px 4px 0 var(--ink);
}

:root[data-theme='dark'] .btn-red {
  color: #1b0d0a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-red {
    color: #1b0d0a;
  }
}

.btn-small {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 15px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* the date-due card, tucked in its pocket */

.duecard {
  position: relative;
  max-width: 440px;
  width: 100%;
  justify-self: center;
}

.dc-card {
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 3px;
  padding: 22px 22px 120px;
  transform: rotate(2.4deg);
}

.dc-pocket {
  position: relative;
  z-index: 1;
  margin: -168px -10px 0;
  background: var(--pocket);
  border: 1px solid var(--edge);
  border-radius: 3px 3px 10px 10px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25) inset, var(--shadow);
  padding: 98px 26px 22px;
  transform: rotate(-1.2deg);
}

.dc-pocket-label {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.duecard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
  text-transform: uppercase;
  border-bottom: 2px solid var(--margin);
  padding-bottom: 8px;
}

.duecard-head b {
  font-family: var(--f-sans);
  font-variation-settings: 'wdth' 70;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.duecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

.duecard-grid li {
  height: 38px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--blue);
}

.duecard-grid li:nth-child(odd) {
  border-right: 1px solid var(--rule);
}

.duecard-grid li span {
  display: inline-block;
  transform: rotate(-2deg);
  opacity: 0.85;
}

.worth-stamp {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%) rotate(-9deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px 8px;
  border-width: 5px;
  border-radius: 10px;
  text-decoration: none;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  white-space: nowrap;
  -webkit-mask-image: var(--grunge-light);
  mask-image: var(--grunge-light);
  -webkit-mask-size: 300px 300px;
  mask-size: 300px 300px;
}

.worth-stamp:hover {
  text-decoration: none;
}

.worth-stamp .ws-top,
.worth-stamp .ws-bot {
  font-size: 22px;
  letter-spacing: 0.12em;
}

.worth-stamp .ws-num {
  font-size: clamp(56px, 7.4vw, 88px);
  letter-spacing: 0;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
}

.duecard-foot {
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
}

/* ---------- sections ---------- */

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--paper-2);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}

.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 22px;
  align-items: end;
  margin-bottom: 36px;
}

.callno {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 6px 10px 5px;
  line-height: 1.1;
  text-align: center;
  align-self: start;
  margin-top: 6px;
}

.callno small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2 {
  font-size: clamp(40px, 5.6vw, 72px);
  font-weight: 900;
  font-variation-settings: 'wdth' 66;
  text-transform: uppercase;
  line-height: 0.92;
}

.section-sub {
  grid-column: 2;
  max-width: 44em;
  font-size: 18px;
  color: var(--ink-2);
  margin-top: 10px;
}

.checked-note {
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink-3);
}

/* ---------- hooks ("wait, that's free?") ---------- */

.hooks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hook {
  position: relative;
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 3px;
  padding: 18px 20px 20px;
  background-image:
    linear-gradient(to bottom, transparent 58px, var(--margin) 58px, var(--margin) 60px, transparent 60px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--rule) 29px, var(--rule) 30px);
  background-position: 0 0, 0 60px;
  display: flex;
  flex-direction: column;
}

.hook:nth-child(3n + 1) {
  transform: rotate(-1deg);
}

.hook:nth-child(3n + 2) {
  transform: rotate(0.6deg);
}

.hook:nth-child(3n) {
  transform: rotate(-0.4deg);
}

.hook-kicker {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  height: 36px;
}

.hook h3 {
  font-size: 30px;
  font-weight: 900;
  font-variation-settings: 'wdth' 72;
  line-height: 1;
  margin-top: 8px;
}

.hook p:not(.hook-kicker) {
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink-2);
  flex: 1;
}

.hook-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.hook .stamp {
  font-size: 19px;
  transform: rotate(-4deg);
}

.hook a.more {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- catalog ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.chip {
  min-height: 40px;
  padding: 7px 14px;
  border: 2px solid var(--edge-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip .n {
  font-family: var(--f-mono);
  font-size: 13px;
  opacity: 0.75;
  margin-left: 4px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: center;
  margin-bottom: 28px;
  font-size: 16px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 40px;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
  margin: 0;
}

.count-note {
  font-family: var(--f-mono);
  font-size: 15px;
  color: var(--ink-3);
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(to bottom, transparent 48px, var(--margin) 48px, var(--margin) 50px, transparent 50px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 27px, var(--rule) 27px, var(--rule) 28px);
  background-position: 0 0, 0 50px;
}

.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  height: 30px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.where-tag {
  white-space: nowrap;
}

.common {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--blue);
}

.dots {
  display: inline-flex;
  gap: 3px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.dots i.on {
  background: currentColor;
}

.entry h3 {
  margin-top: 16px;
  font-size: 25px;
  font-weight: 900;
  font-variation-settings: 'wdth' 76;
  line-height: 1.05;
}

.entry .what {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink-2);
  flex: 1;
}

.entry .instead {
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink);
  border-top: 1px dashed var(--edge-strong);
  padding-top: 10px;
}

.entry .instead b {
  color: var(--red);
  font-weight: 700;
}

.entry .instead .lbl {
  color: var(--ink-3);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  display: block;
}

.entry-links {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
}

.entry-links a {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.entry-links .srcs {
  display: inline-flex;
  gap: 12px;
}

.entry-links a.src {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-3);
}

.entry-links .ask {
  font-weight: 700;
  color: var(--ink-2);
  font-size: 15px;
}

.empty {
  padding: 30px;
  text-align: center;
  font-family: var(--f-mono);
  color: var(--ink-3);
  border: 2px dashed var(--edge-strong);
  border-radius: 4px;
}

.more-row {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.more-row.more-left {
  justify-content: flex-start;
  margin-top: 22px;
}

.more-row [hidden] {
  display: none;
}

.line[hidden],
.calc-group[hidden] {
  display: none;
}

/* ---------- calculator ---------- */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 36px;
  align-items: start;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

.presets .lbl {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.calc-group + .calc-group {
  margin-top: 26px;
}

.calc-group h3 {
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--margin);
  margin-bottom: 4px;
}

.line {
  border: 0;
  min-inline-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'name status'
    'usage value'
    'math math';
  gap: 6px 18px;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--edge);
  margin: 0;
  min-width: 0;
}

.calc-group .line:last-child {
  border-bottom: 0;
}

.line-name {
  grid-area: name;
}

.line-name strong {
  font-size: 19px;
  font-weight: 800;
  font-variation-settings: 'wdth' 85;
}

.line-name .via {
  display: block;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.35;
}

.seg {
  grid-area: status;
  display: inline-flex;
  border: 2px solid var(--edge-strong);
  border-radius: 999px;
  overflow: hidden;
  align-self: start;
  background: var(--card);
}

.seg label {
  position: relative;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.seg span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 11px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}

.seg label + label span {
  border-left: 1px solid var(--edge);
}

.seg input:checked + span {
  background: var(--ink);
  color: var(--paper);
}

.seg input[value='later']:checked + span {
  background: var(--blue);
  color: var(--card);
}

.seg input[value='nope']:checked + span {
  background: var(--ink-3);
  color: var(--card);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.usage {
  grid-area: usage;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.usage input[type='range'] {
  flex: 0 1 300px;
  min-width: 0;
  accent-color: var(--red);
  height: 32px;
  margin: 0;
  cursor: pointer;
}

.usage output {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.line-value {
  grid-area: value;
  font-weight: 900;
  font-variation-settings: 'wdth' 75;
  font-size: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.line-math {
  grid-area: math;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.45;
}

.line-math a {
  color: var(--ink-3);
}

.line.is-nope .line-value,
.line.is-nope .usage,
.line.is-nope .line-math .eq {
  opacity: 0.4;
}

.line.is-nope .line-value {
  text-decoration: line-through;
}

.line.is-later .line-value {
  color: var(--blue);
}

/* the total card */

.total-card {
  position: sticky;
  top: 20px;
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  border-radius: 3px;
  padding: 22px 22px 24px;
  background-image: linear-gradient(to bottom, transparent 50px, var(--margin) 50px, var(--margin) 52px, transparent 52px);
}

.total-card .tc-head {
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  height: 36px;
}

.total-card .tc-lead {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 800;
  font-variation-settings: 'wdth' 85;
}

.total-card .tc-num {
  display: block;
  margin: 6px 0 2px;
  font-size: clamp(60px, 6vw, 84px);
  font-weight: 900;
  font-variation-settings: 'wdth' 64;
  color: var(--red);
  line-height: 0.95;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.total-card .tc-per {
  font-size: 19px;
  font-weight: 800;
  font-variation-settings: 'wdth' 85;
}

.total-card .tc-later {
  margin-top: 12px;
  font-size: 15px;
  color: var(--ink-2);
}

.total-card .tc-later b {
  color: var(--blue);
}

.share {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--edge-strong);
}

.share-preview {
  font-variation-settings: normal;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: var(--paper-2);
}

.share-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-status {
  margin-top: 10px;
  min-height: 1.4em;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink-2);
}

.fine {
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.45;
}

.mini-total {
  display: none;
}

/* ---------- bigger libraries ---------- */

.lib-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: end;
  margin-bottom: 26px;
}

.field label {
  display: block;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.field select {
  min-height: 48px;
  min-width: 260px;
  padding: 8px 40px 8px 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.lib-summary {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 40em;
}

.lib-summary b {
  color: var(--ink);
}

.libs {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  font-size: 16px;
}

.libs caption {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--ink-3);
  padding: 0 0 10px;
}

.libs th,
.libs td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--edge);
}

.libs thead th {
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 2px solid var(--margin);
  font-weight: 700;
}

.libs tbody th {
  font-weight: 800;
  font-variation-settings: 'wdth' 85;
  font-size: 18px;
  min-width: 170px;
}

.libs tbody th .city {
  display: block;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.libs .youth {
  display: block;
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--blue);
}

.libs .ctype {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-3);
}

.fee {
  display: inline-block;
  font-weight: 900;
  font-variation-settings: 'wdth' 75;
  font-size: 18px;
  white-space: nowrap;
}

.fee-free {
  color: var(--red);
}

.fee-paid {
  margin-top: 10px;
}

.libs a.rules {
  display: block;
  white-space: nowrap;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 2px;
}

.libs .youth a {
  color: var(--blue);
}

.fee-note {
  display: block;
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 4px;
  max-width: 16em;
}

.libs tr.match {
  background: var(--red-soft);
}

.tag-you {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  border: 1.5px solid currentColor;
  border-radius: 3px;
  padding: 2px 6px 1px;
}

.libs a.apply {
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.aside-note {
  margin-top: 22px;
  font-size: 16px;
  color: var(--ink-2);
  max-width: 48em;
}

/* ---------- how to ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 18px 20px 22px;
}

.step::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-weight: 900;
  font-variation-settings: 'wdth' 70;
  font-size: 24px;
  -webkit-mask-image: var(--grunge);
  mask-image: var(--grunge);
  -webkit-mask-size: 200px 200px;
  mask-size: 200px 200px;
}

.step h3 {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 900;
  font-variation-settings: 'wdth' 78;
  line-height: 1.1;
}

.step p,
.step ul {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink-2);
}

.step ul {
  padding-left: 18px;
}

.step li + li {
  margin-top: 4px;
}

.student-tip {
  margin-top: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: 4px;
  padding: 18px 22px;
}

.student-tip .stamp {
  font-size: 22px;
  transform: rotate(-5deg);
}

.student-tip p {
  font-size: 17px;
  color: var(--ink-2);
}

.student-tip p b {
  color: var(--ink);
}

/* ---------- footer ---------- */

.foot {
  background: var(--foot);
  color: var(--foot-ink);
  padding: 56px 0 44px;
  margin-top: 0;
}

.foot a {
  color: var(--foot-ink);
  font-weight: 700;
}

.foot .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 30px;
}

.foot .big {
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 900;
  font-variation-settings: 'wdth' 66;
  text-transform: uppercase;
  line-height: 0.95;
}

.foot .big {
  color: var(--foot-ink);
}

.foot .big .stamp {
  -webkit-mask-image: var(--grunge-soft);
  mask-image: var(--grunge-soft);
  -webkit-mask-size: 420px 420px;
  mask-size: 420px 420px;
  color: #ff7a67;
  font-size: 1em;
  border-width: 0.07em;
  transform: rotate(-3deg);
}

.foot p {
  color: var(--foot-ink-2);
  font-size: 16px;
}

.foot p + p {
  margin-top: 10px;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--f-mono);
  font-size: 16px;
}

.foot li + li {
  margin-top: 6px;
}

.foot li a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.foot .foot-meta {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(242, 233, 211, 0.18);
  padding-top: 18px;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--foot-ink-2);
}

.foot :focus-visible {
  outline-color: #93b5f2;
}

/* ---------- responsive ---------- */

@media (max-width: 1060px) {
  .calc {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hooks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
  }
  .duecard {
    max-width: 400px;
  }
  .calc {
    grid-template-columns: minmax(0, 1fr);
  }
  .total-card {
    position: static;
  }
  .mini-total {
    display: flex;
    position: sticky;
    bottom: 0;
    z-index: 5;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px calc(-1 * var(--gut)) 0;
    padding: 10px var(--gut);
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
    font-variation-settings: 'wdth' 85;
    font-size: 17px;
  }
  .mini-total b {
    font-size: 30px;
    font-weight: 900;
    font-variation-settings: 'wdth' 66;
    color: var(--paper);
    font-variant-numeric: tabular-nums;
  }
  .mini-total a {
    color: var(--paper);
    font-family: var(--f-mono);
    font-size: 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .foot .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --gut: 16px;
  }
  body {
    font-size: 16px;
  }
  .top .wrap {
    flex-wrap: wrap;
    gap: 10px;
  }
  .top nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 0;
    justify-content: space-between;
  }
  .top nav a {
    font-size: 13px;
    padding: 12px 4px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .top nav a:first-child {
    padding-left: 0;
  }
  .theme-toggle {
    margin-left: auto;
  }
  .hero {
    padding: 20px 0 56px;
  }
  .hero .wrap {
    gap: 0;
  }
  .hero-copy {
    display: contents;
  }
  .hero .eyebrow {
    order: 1;
  }
  .hero h1 {
    order: 2;
  }
  .hero .duecard {
    order: 3;
    margin: 40px auto 36px;
  }
  .hero .lede {
    order: 4;
    margin-top: 0;
  }
  .hero .cta-row {
    order: 5;
  }
  .hero h1 {
    font-size: clamp(46px, 15vw, 64px);
  }
  .lede {
    font-size: 18px;
  }
  .cta-row .btn {
    flex: 1 1 100%;
  }
  .dc-card {
    padding: 16px 14px 110px;
  }
  .dc-pocket {
    padding: 92px 18px 18px;
  }
  .duecard-grid li {
    font-size: 13px;
    padding-left: 6px;
    letter-spacing: 0.03em;
  }
  .worth-stamp .ws-num {
    font-size: 60px;
  }
  .worth-stamp .ws-top,
  .worth-stamp .ws-bot {
    font-size: 18px;
  }
  .section {
    padding: 56px 0;
  }
  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .callno {
    justify-self: start;
  }
  .section-sub {
    grid-column: 1;
    font-size: 17px;
  }
  .hooks {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .hook,
  .hook:nth-child(n) {
    transform: none;
  }
  .catalog {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .entry h3 {
    font-size: 23px;
    margin-top: 14px;
  }
  .entry .what {
    font-size: 15.5px;
  }
  .chip {
    min-height: 44px;
  }
  .toggle {
    min-height: 44px;
  }
  .entry-links a {
    min-height: 44px;
  }
  .line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'name name'
      'status status'
      'usage value'
      'math math';
  }
  .seg {
    justify-self: start;
  }
  .seg span {
    min-height: 44px;
    padding: 4px 13px;
    font-size: 15px;
  }
  .usage input[type='range'] {
    height: 44px;
  }
  .usage {
    flex-wrap: wrap;
    gap: 2px 12px;
  }
  .usage input[type='range'] {
    flex-basis: 100%;
    max-width: none;
  }
  .field,
  .field select {
    width: 100%;
    min-width: 0;
  }
  .field select {
    font-size: 16px;
  }
  .libs {
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .libs thead {
    display: none;
  }
  .libs,
  .libs tbody,
  .libs tr,
  .libs th,
  .libs td {
    display: block;
    width: 100%;
  }
  .libs tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    background: var(--card);
    border: 1px solid var(--edge);
    box-shadow: var(--shadow);
    border-radius: 3px;
    margin-bottom: 16px;
  }
  .libs tbody th,
  .libs td:nth-of-type(1) {
    grid-column: 1 / -1;
  }
  .libs td:last-child {
    text-align: right;
    padding-top: 6px;
  }
  .libs td:last-child::before {
    visibility: hidden;
  }
  .libs tr.match {
    background: var(--card);
    border: 2px solid var(--red);
  }
  .libs th,
  .libs td {
    border-bottom: 0;
    padding: 6px 16px;
  }
  .libs tbody th {
    padding-top: 16px;
  }
  .libs td:last-child {
    padding-bottom: 16px;
  }
  .libs td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--f-mono);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
  }
  .libs a.apply,
  .libs a.rules {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .hook a.more {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .student-tip {
    grid-template-columns: minmax(0, 1fr);
  }
  .student-tip .stamp {
    justify-self: start;
  }
  .foot li a {
    min-height: 44px;
  }
}
