/* Ruled Notes: cozy pastel notebook theme.
   Change the colours and fonts in :root to re-skin the whole site. */
:root {
  --paper: #FFF8F2;
  --grid: #F1E9FB;
  --grid-strong: #DDD0F3;
  --ink: #3B2A5E;
  --ink-soft: #5B4C7A;
  --pen: #6C4BB8;
  --pen-ink: #FFFFFF;
  --hl: #FFE98A;
  --margin: #E8789B;
  --sheet: #FFFFFF;
  --tint-lilac: #E9DFFB;
  --tint-pink: #FDE3EE;
  --tint-mint: #D9F1E5;
  --shadow: rgba(59, 42, 94, .35);
  --mx: clamp(10px, 3.2vw, 44px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Bitstream Charter", Charter, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1530;
    --grid: #2A2147;
    --grid-strong: #43386B;
    --ink: #F1EAFE;
    --ink-soft: #C9BCE6;
    --pen: #B7A0F5;
    --pen-ink: #1B1530;
    --hl: #6F6118;
    --margin: #F08BB0;
    --sheet: #251D40;
    --tint-lilac: #2F2556;
    --tint-pink: #3A2146;
    --tint-mint: #1F3A33;
    --shadow: rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 0, var(--tint-lilac) 0, transparent 36%),
    radial-gradient(circle at 96% 12%, var(--tint-pink) 0, transparent 32%),
    radial-gradient(var(--grid-strong) 1.4px, transparent 1.4px);
  background-size: auto, auto, 30px 30px;
  background-attachment: fixed, fixed, scroll;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--pen); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

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

code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--grid);
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .92em;
}

/* Highlighter marker for the phrases worth remembering. */
mark {
  background: linear-gradient(transparent 10%, var(--hl) 10% 90%, transparent 90%);
  color: inherit;
  padding: 0 .2em;
  margin: 0 -.05em;
  border-radius: .4em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
mark.todo { background: #FFD2D6; color: #5A0F17; }
@media (prefers-color-scheme: dark) { mark.todo { background: #6E1C25; color: #FFE3E6; } }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { left: calc(var(--mx) + 12px); }

/* Header */
.site-header { position: relative; z-index: 1; padding: 16px 0 8px; }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 700 1.5rem var(--font-head);
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand svg { color: var(--pen); flex: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .9rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.site-header nav a:hover { background: var(--tint-lilac); }
.site-header nav a[aria-current="page"] {
  background: var(--tint-lilac);
}

main { position: relative; z-index: 1; display: block; }

/* Type */
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); }
h1 { font-weight: 700; letter-spacing: -.02em; line-height: 1.08; }
h2 { font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h3 { font-weight: 700; line-height: 1.25; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.fine { font-size: .875rem; color: var(--ink-soft); }
.meta { color: var(--ink-soft); font-size: .95rem; margin: 0 0 1.5em; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .6rem 1.5rem;
  border: 2px solid var(--pen);
  border-radius: 999px;
  background: var(--pen);
  color: var(--pen-ink);
  font: 700 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(59, 42, 94, .22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 rgba(59, 42, 94, .22); text-decoration: none; }
.btn-ghost { background: var(--sheet); color: var(--ink); border-color: var(--grid-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6rem 0 0; }

/* Hero */
.hero { display: grid; gap: 36px; padding: 28px 0 44px; }
.hero h1 { font-size: clamp(2.3rem, 8vw, 4rem); margin: 0 0 .35em; max-width: 14ch; }
.hero h1::after { content: " \2728" / ""; }
.hero .lead { max-width: 34ch; margin: 0; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 56px; padding: 56px 0 68px; }
}

/* The ruled sheet with the tick-off list */
.sheet {
  position: relative;
  padding: 26px 26px 20px;
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(transparent 0 33px, var(--grid-strong) 33px 34px);
  background-position: 0 60px;
  border: 2px solid var(--grid-strong);
  border-radius: 26px;
  box-shadow: 0 10px 0 var(--tint-lilac);
  transform: rotate(-1deg);
}
.sheet::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 120px;
  height: 32px;
  margin-left: -60px;
  background: repeating-linear-gradient(135deg, #F9C9DC 0 10px, #FDE3EE 10px 20px);
  transform: rotate(-3deg);
  box-shadow: 0 2px 4px rgba(59, 42, 94, .15);
}
.sheet h2 { margin: 0 0 18px; font-size: 1.35rem; line-height: 34px; }
.sheet ul { list-style: none; margin: 0; padding: 0; }
.sheet li { line-height: 34px; }
.sheet label { display: flex; align-items: center; gap: 12px; min-height: 34px; cursor: pointer; }
.sheet input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--pen);
  border-radius: 8px;
  background: var(--sheet) center / 16px no-repeat;
  cursor: pointer;
}
.sheet input[type="checkbox"]:checked {
  background-color: var(--pen);
  border-color: var(--pen);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.sheet input[type="checkbox"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sheet input:checked + span {
  background: linear-gradient(transparent 14%, var(--hl) 14% 86%, transparent 86%);
  border-radius: .4em;
  padding: 0 .3em;
  margin-left: -.3em;
}
.sheet .fine { margin: 16px 0 0; line-height: 1.4; }

/* Sections */
.section { padding: 44px 0 4px; }
.section > h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.section > .sub { margin: 0 0 24px; max-width: 58ch; color: var(--ink-soft); }

/* Guides as soft cards */
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.guide-list li { background: var(--sheet); border: 2px solid var(--grid-strong); border-radius: 24px; box-shadow: 0 6px 0 var(--tint-lilac); }
.guide-list li:nth-child(3n+2) { box-shadow: 0 6px 0 var(--tint-pink); }
.guide-list li:nth-child(3n) { box-shadow: 0 6px 0 var(--tint-mint); }
.guide-list a { display: grid; gap: 4px; padding: 22px 26px; color: var(--ink); text-decoration: none; }
.guide-list h3 { margin: 0; font-size: 1.35rem; }
.guide-list h3 span {
  background: linear-gradient(var(--hl), var(--hl)) 0 92% / 0 38% no-repeat;
  transition: background-size .25s ease;
}
.guide-list a:hover h3 span, .guide-list a:focus-visible h3 span { background-size: 100% 38%; }
.guide-list p { margin: 0; color: var(--ink-soft); }
.guide-list .time { color: var(--ink-soft); font-size: .95rem; }
@media (min-width: 720px) {
  .guide-list a { grid-template-columns: 1fr auto; column-gap: 32px; align-items: baseline; }
  .guide-list .time { grid-column: 2; grid-row: 1; }
}

/* Template previews drawn in CSS */
.templates { display: grid; gap: 32px; }
@media (min-width: 760px) { .templates { grid-template-columns: 1fr 1fr; gap: 40px; } }
.tpl { display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: start; color: var(--ink); text-decoration: none; }
.tpl h3 { margin: 0 0 6px; font-size: 1.25rem; }
.tpl p { margin: 0 0 10px; color: var(--ink-soft); }
.tpl .go { font-weight: 700; color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }
.mini {
  position: relative;
  aspect-ratio: 8.5 / 11;
  background: var(--sheet);
  border: 2px solid var(--grid-strong);
  border-radius: 8px;
  box-shadow: 0 6px 0 var(--tint-lilac);
}
.mini.planner {
  background-image:
    linear-gradient(var(--pen), var(--pen)),
    repeating-linear-gradient(transparent 0 10.4%, var(--grid-strong) 10.4% calc(10.4% + 1px));
  background-size: 100% 7%, 100% 100%;
  background-position: 0 0, 0 14%;
  background-repeat: no-repeat;
}
.mini.cnotes::before {
  content: "";
  position: absolute;
  left: 30%;
  top: 14%;
  bottom: 22%;
  width: 1px;
  background: var(--ink-soft);
}
.mini.cnotes::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 1px;
  background: var(--ink-soft);
}
.mini.cnotes { background-image: linear-gradient(var(--pen), var(--pen)); background-size: 100% 7%; background-repeat: no-repeat; }

/* The sticky note that holds a product link */
.pick {
  position: relative;
  margin: 2.4rem 0;
  padding: 26px 28px 24px;
  max-width: 520px;
  background: var(--hl);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: 0 8px 0 rgba(59, 42, 94, .12);
  transform: rotate(-.8deg);
}
.pick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 110px;
  height: 28px;
  margin-left: -55px;
  background: repeating-linear-gradient(135deg, #F9C9DC 0 10px, #FDE3EE 10px 20px);
  transform: rotate(2deg);
  box-shadow: 0 2px 4px rgba(59, 42, 94, .15);
}
.pick h3 { margin: 0 0 6px; font-size: 1.25rem; color: inherit; }
.pick p { margin: 0 0 12px; }
.pick .btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick .fine { color: inherit; opacity: .8; margin: 0; }
.pick a:not(.btn) { color: inherit; }
.slot-hint { display: none; }
.pick.is-empty { outline: 2px dashed var(--margin); outline-offset: 6px; }
.pick.is-empty .slot-hint { display: block; margin: 12px 0 0; padding: .4rem .6rem; border: 1px dashed var(--ink); font-size: .85rem; font-weight: 600; }

/* Articles */
.article { max-width: 68ch; padding: 28px 0 8px; }
.article h1 { font-size: clamp(2rem, 6vw, 3rem); margin: .1em 0 .4em; }
.article h2 { font-size: 1.5rem; margin: 1.9em 0 .5em; }
.article p { margin: 0 0 1em; }
.article ul, .article ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.article li { margin-bottom: .5em; }

.steps { counter-reset: s; list-style: none; padding: 0 !important; margin: 1.8rem 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 3.4rem; margin: 0 0 1.5rem; }
.steps > li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: .05rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--pen);
  color: var(--pen-ink);
  font: 700 1.05rem var(--font-head);
}
.steps h2, .steps h3 { margin: 0 0 .25em; font-size: 1.25rem; }
.steps p { margin: 0; }

.tbl-wrap { overflow-x: auto; margin: 1.4rem 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .98rem; }
.tbl th, .tbl td { padding: .65rem .8rem .65rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--grid-strong); }
.tbl th { border-bottom: 2px solid var(--pen); font-family: var(--font-head); }
.tbl caption { caption-side: bottom; text-align: left; padding-top: .6rem; color: var(--ink-soft); font-size: .9rem; }

.callout { margin: 1.6rem 0; padding: 16px 20px; border: 2px solid var(--grid-strong); border-left: 6px solid var(--pen); border-radius: 18px; background: var(--sheet); }
.callout p:last-child { margin-bottom: 0; }

.end-cta { margin: 2.4rem 0 1rem; padding-top: 1.4rem; border-top: 3px dotted var(--grid-strong); }
.end-cta h2 { margin-top: 0; font-size: 1.3rem; }
.related { padding-left: 0 !important; list-style: none; }

/* Footer */
.site-footer { position: relative; z-index: 1; margin-top: 72px; padding: 24px 0 56px; border-top: 3px dotted var(--grid-strong); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 8px 0; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; }
.site-footer .fine { margin: 6px 0; max-width: 70ch; }

/* Printable sheets */
.tool-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 8px; }
.how { max-width: 68ch; margin: 8px 0 28px; }
.how h2 { font-size: 1.3rem; margin: 0 0 .4em; }
.how ol { padding-left: 1.3rem; margin: 0; }
.how li { margin-bottom: .4em; }

.paper {
  max-width: 8.5in;
  margin: 0 0 36px;
  padding: 28px;
  background: var(--sheet);
  border: 2px solid var(--grid-strong);
  border-radius: 14px;
  box-shadow: 0 8px 0 var(--tint-lilac);
}
.paper h1 { margin: 0; font-size: 1.8rem; }
.paper h2 { margin: 18px 0 8px; font-size: 1.1rem; }
.paper-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.fields { display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 600; }
.blank { display: inline-block; min-width: 9rem; height: 1.2em; vertical-align: bottom; border-bottom: 1.5px solid var(--ink); }
.box { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 3px; vertical-align: middle; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { height: 34px; margin: 0; border-bottom: 1.5px solid var(--ink); }
.lines.numbered { counter-reset: n; }
.lines.numbered li { counter-increment: n; }
.lines.numbered li::before { content: counter(n) "."; font-weight: 700; margin-right: 8px; }
.week { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.week th, .week td { padding: 7px 8px; border: 1.5px solid var(--ink); text-align: left; vertical-align: top; }
.week th { font-family: var(--font-head); font-size: .95rem; }
.week td { height: 46px; }
.week td.day { width: 5.2rem; font-weight: 700; }
.week td.tick { width: 3.2rem; text-align: center; vertical-align: middle; }

.cornell-top { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0 0 12px; font-weight: 600; }
.cornell { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr auto; min-height: 8in; border: 2px solid var(--ink); }
.cornell .cue, .cornell .notes {
  padding: 10px 12px;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--grid-strong) 31px 32px);
  background-position: 0 38px;
}
.cornell .cue { border-right: 2px solid var(--ink); }
.cornell .summary { grid-column: 1 / -1; min-height: 1.8in; padding: 10px 12px; border-top: 2px solid var(--ink); }
.cornell .label { display: block; font: 800 .95rem var(--font-head); }
.cornell .label small { font-weight: 500; color: var(--ink-soft); }

/* 404 */
.lost { padding: 56px 0 24px; max-width: 40rem; }
.lost h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin: 0 0 .4em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-list h3 span { transition: none; }
}

@media (max-width: 600px) {
  .paper { padding: 14px; }
  .week th, .week td { padding: 6px 5px; }
  .week td.day { width: 3rem; }
  .week td.tick { width: 2.6rem; }
}

@page { size: letter; margin: .5in; }
@media print {
  :root {
    --paper: #fff; --sheet: #fff; --ink: #000; --ink-soft: #000;
    --grid: #ddd; --grid-strong: #888; --pen: #000; --hl: #fff;
  }
  html { scroll-behavior: auto; }
  body { background: #fff !important; font-size: 11pt; }
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .section { padding: 0 !important; }
  .paper { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .sheet, .sheet::before, .pick::before, .hero h1::after { box-shadow: none; }
  .paper-head { margin-bottom: 8px; padding-bottom: 8px; }
  .paper h2 { margin: 12px 0 6px; }
  .lines li { height: 30px; }
  .week td { height: 38px; padding-top: 4px; padding-bottom: 4px; }
  .cornell { min-height: 8.2in; }
  .cornell .summary { min-height: 1.6in; }
}
