/* Layout: a student planner page — tear-off deadline blocks down the left of each listing,
   highlighter marks for what matters, a narrow filter rail beside the results. */
:root {
  --paper: #f5f6f1;
  --card: #ffffff;
  --ink: #18203a;
  --ink-2: #4a5270;
  --rule: #dfe1d8;
  --hl: #ffe45c;          /* highlighter */
  --hl-ink: #18203a;
  --pencil: #2b4fd6;      /* blue pencil — links, focus */
  --open: #1d7a4a;
  --soon: #c2410c;
  --closed: #8a8d99;
  --chip: #eceee6;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.85rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 5vw, 3.4rem);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12162a; --card: #1a1f36; --ink: #eef0f7; --ink-2: #a7adc4; --rule: #2c3350;
    --hl: #f5d63d; --hl-ink: #12162a; --pencil: #8aa4ff; --open: #4ccb88; --soon: #ff8a4c;
    --closed: #7d8299; --chip: #252b47; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12162a; --card: #1a1f36; --ink: #eef0f7; --ink-2: #a7adc4; --rule: #2c3350;
  --hl: #f5d63d; --hl-ink: #12162a; --pencil: #8aa4ff; --open: #4ccb88; --soon: #ff8a4c;
  --closed: #7d8299; --chip: #252b47; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--pencil); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0; }

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

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: var(--step--1);
}
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--hl-ink); background: var(--hl); }
.count-badge { font-family: var(--mono); font-size: 0.75rem; margin-left: 4px; }

.sample-note {
  font-size: var(--step--1); color: var(--ink-2); background: var(--chip);
  text-align: center; padding: 6px 16px;
}

/* ---------- Hero ---------- */
.hero { padding-block: 56px 32px; display: grid; gap: 20px; }
.hero h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; max-width: 16ch; }
.mark { background: linear-gradient(transparent 55%, var(--hl) 55% 92%, transparent 92%); padding-inline: 2px; }
.hero p { font-size: var(--step-1); color: var(--ink-2); max-width: 52ch; margin: 0; }
.search {
  display: flex; gap: 8px; max-width: 640px; background: var(--card); border: 2px solid var(--ink);
  border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: 4px 4px 0 var(--ink);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: var(--step-1); color: var(--ink); outline: none; }
.search input::placeholder { color: var(--ink-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 var(--step--1)/1 var(--body); border-radius: 999px; padding: 12px 20px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hl); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn.hl { background: var(--hl); color: var(--hl-ink); border-color: var(--hl-ink); }

.stats { display: flex; gap: 28px; flex-wrap: wrap; font-size: var(--step--1); color: var(--ink-2); }
.stats b { display: block; font-family: var(--mono); font-size: var(--step-2); color: var(--ink); font-weight: 600; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding-block: 8px 72px; align-items: start; }
.filters { position: sticky; top: 84px; display: grid; gap: 22px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.filters legend, .label {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin-bottom: 6px; padding: 0;
}
.filters label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; }
.filters input[type="checkbox"], .filters input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; }
.filters select {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink);
}
.toggle-filters { display: none; }
.clear { background: none; border: 0; padding: 0; color: var(--pencil); font: inherit; font-size: var(--step--1); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-head h2 { font-size: var(--step-1); }
.results-head select { font: inherit; font-size: var(--step--1); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }

.list { display: grid; gap: 14px; }
.listing {
  display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 18px; align-items: start;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px;
  transition: border-color .15s ease, transform .15s ease;
}
.listing:hover { border-color: var(--ink); }
.listing.is-closed { opacity: .62; }

/* tear-off calendar block */
.cal {
  border: 2px solid var(--ink); border-radius: 8px; text-align: center; overflow: hidden; background: var(--card);
  font-family: var(--mono); line-height: 1;
}
.cal .m { background: var(--ink); color: var(--paper); font-size: 0.7rem; letter-spacing: 0.1em; padding: 5px 0; text-transform: uppercase; }
.cal .d { font-size: 1.7rem; font-weight: 600; padding: 8px 0 4px; }
.cal .y { font-size: 0.66rem; color: var(--ink-2); padding-bottom: 6px; }
.cal-cap { font-family: var(--mono); font-size: 0.68rem; text-align: center; margin-top: 6px; color: var(--ink-2); }
.cal-cap.soon { color: var(--soon); font-weight: 600; }
.cal-cap.closed { color: var(--closed); }

.listing h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }
.listing h3 a { color: var(--ink); text-decoration: none; }
.listing h3 a:hover { text-decoration: underline; text-decoration-color: var(--hl); text-decoration-thickness: 4px; }
.org { color: var(--ink-2); font-size: 0.95rem; margin-top: 2px; }
.listing p { margin: 10px 0 0; font-size: 0.95rem; max-width: 65ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-family: var(--mono); font-size: 0.74rem; background: var(--chip); color: var(--ink); padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.chip.pay { background: var(--hl); color: var(--hl-ink); font-weight: 600; }
.chip.unpaid { background: transparent; border: 1px dashed var(--ink-2); color: var(--ink-2); }

.save {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--card); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; transition: all .15s ease;
}
.save:hover { border-color: var(--ink); color: var(--ink); }
.save[aria-pressed="true"] { background: var(--hl); color: var(--hl-ink); border-color: var(--hl-ink); }

.empty { padding: 48px 24px; text-align: center; border: 2px dashed var(--rule); border-radius: var(--radius); color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }

/* ---------- Detail page ---------- */
.crumb { font-size: var(--step--1); padding-top: 28px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-block: 20px 72px; align-items: start; }
.detail h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.detail .org { font-size: var(--step-1); margin-top: 6px; }
.detail .lede { font-size: var(--step-1); margin: 22px 0 0; max-width: 60ch; }
.section { margin-top: 36px; }
.section h2 { font-size: var(--step-1); margin-bottom: 12px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist input { margin-top: 5px; accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
.checklist label { cursor: pointer; }
.side { position: sticky; top: 84px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; box-shadow: 5px 5px 0 var(--ink); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 0.95rem; }
.facts dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); padding-top: 3px; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.eligible { border-radius: 8px; padding: 12px 14px; font-size: 0.92rem; background: var(--chip); }
.eligible select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
.eligible .verdict { margin-top: 8px; font-weight: 700; }
.verdict.yes { color: var(--open); }
.verdict.no { color: var(--soon); }

/* ---------- Guide ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--step-2); margin: 48px 0 14px; }
.prose p, .prose li { color: var(--ink); }
.timeline { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 0; border-left: 2px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 22px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.timeline li.now::before { background: var(--hl); }
.timeline .when { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.timeline strong { display: block; font-family: var(--display); font-size: 1.1rem; margin: 2px 0 4px; }
.timeline p { margin: 0; }
.template {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin-top: 14px;
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.7; white-space: pre-wrap; overflow-x: auto;
}
.template-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.do-dont { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.do-dont > div { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.do-dont h3 { font-size: 1rem; margin-bottom: 8px; }
.do-dont ul { margin: 0; padding-left: 18px; }

/* ---------- Tracker ---------- */
.tracker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-block: 8px 72px; }
.col { background: var(--chip); border-radius: var(--radius); padding: 12px; min-height: 160px; display: grid; gap: 10px; align-content: start; }
.col h2 { font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 2px; }
.col h2 span { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.tcard { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.tcard a { color: var(--ink); font-weight: 700; text-decoration: none; line-height: 1.3; }
.tcard a:hover { text-decoration: underline; }
.tcard .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); }
.tcard .meta.soon { color: var(--soon); }
.tcard select, .tcard textarea { font: inherit; font-size: 0.85rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); padding: 6px; width: 100%; }
.tcard textarea { resize: vertical; min-height: 34px; }
.tcard .rm { background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 0.78rem; cursor: pointer; justify-self: start; padding: 0; text-decoration: underline; }
.col-empty { font-size: 0.85rem; color: var(--ink-2); padding: 4px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding-block: 28px; color: var(--ink-2); font-size: var(--step--1); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .board, .detail { grid-template-columns: minmax(0, 1fr); }
  .filters, .side { position: static; }
  .toggle-filters { display: inline-flex; }
  .filters[data-collapsed="true"] .filter-body { display: none; }
  .filter-body { display: grid; gap: 22px; }
  .tracker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 881px) { .filter-body { display: grid; gap: 22px; } }
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .hero { padding-block: 36px 24px; }
  .listing { grid-template-columns: 62px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .listing .save { grid-column: 2; justify-self: start; }
  .cal .d { font-size: 1.35rem; }
  .tracker { grid-template-columns: minmax(0, 1fr); }
  .nav { margin-left: 0; width: 100%; }
  .search { padding-left: 16px; }
  .search .btn { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
