/* Course++ marketing site — one stylesheet, no build step, no external requests.
 *
 * WHY NO WEB FONT: every font file is a request to a third party, and school
 * networks routinely block or slow them. A visitor on a locked-down campus
 * network must see the finished page, not a fallback the design never planned
 * for. The serif stack below resolves to a real editorial face on every major
 * platform (Iowan Old Style on macOS/iOS, Palatino Linotype on Windows,
 * Georgia everywhere else), so the design is what ships, not what downloads.
 *
 * WHY EDITORIAL: the buyer is an instructor who distrusts hype. Typography and
 * white space carry this page; there are no gradients, no icon set, and no
 * illustration. Do not "modernise" it with a centred hero over a coloured blob
 * — that reads as an AI startup and loses this audience specifically.
 */

/* ---- Tokens -------------------------------------------------------------
 * Four radii and six type steps, deliberately. An audit of the extension's
 * CSS found ten ad-hoc radii and sixteen font sizes, several differing by
 * 0.01rem — invisible on screen, and the clearest signal of a design
 * assembled by accident. Add a token here rather than a one-off value below.
 *
 * Every colour pair below was measured with a WCAG contrast calculator, in
 * both themes, before it was committed. Numbers are in the comments so a
 * future edit can tell whether it broke something: AA needs 4.5:1 for body
 * text and 3:1 for the boundary of a control or a focus ring.
 */
:root {
  color-scheme: light dark;

  --paper:      #fbf9f5;  /* page ground */
  --panel:      #f4f0e8;  /* raised block on paper */
  --ink:        #1a1917;  /* body  — 16.7:1 on paper */
  --ink-2:      #55504a;  /* secondary — 7.6:1 on paper, 7.0:1 on panel */
  --ink-3:      #6b6459;  /* quiet captions — 5.6:1 on paper */
  --rule:       #ddd6c9;  /* hairline, decorative only (1.4:1) */
  --rule-ui:    #8a8072;  /* boundary of an interactive control — 3.7:1 paper, 3.4:1 panel */
  --accent:     #1c4a37;  /* links, focus ring, primary button — 9.6:1 on paper */
  --accent-ink: #fbf9f5;  /* text on the accent button — 9.6:1 */

  --f-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --f-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-label: .6875rem;
  --t-sm:    .8125rem;
  --t-base:  1.0625rem;                              /* 17px. The extension audit
                                                        flagged 11-13px body text
                                                        as an accessibility problem
                                                        for a tool sold to
                                                        institutions. Do not shrink. */
  --t-lg:    1.1875rem;
  --t-h3:    1.0625rem;
  --t-h2:    clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  --t-h1:    clamp(2rem, 1.4rem + 3.1vw, 3.125rem);

  --r-sm: 2px;
  --r-md: 5px;
  --r-lg: 9px;
  --r-pill: 99px;

  --gap: clamp(1.75rem, 4vw, 3rem);
  --measure: 34rem;      /* ~68 characters at the base size. Matches the holding
                            page this replaced; long lines are what makes a
                            text-heavy page unreadable. */
}

/* Dark theme: only the colours are redefined, so a token added above cannot be
 * accidentally light-only. Values re-measured, not eyeballed. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #141310;
    --panel:      #1d1c18;
    --ink:        #eceae7;  /* 15.5:1 */
    --ink-2:      #a9a29a;  /* 7.4:1 paper, 6.8:1 panel */
    --ink-3:      #948d84;  /* 5.7:1 */
    --rule:       #302d27;
    --rule-ui:    #7a7268;  /* 3.9:1 paper, 3.6:1 panel */
    --accent:     #86c0a2;  /* 8.9:1 */
    --accent-ink: #141310;  /* 8.9:1 on the accent button */
  }
}

/* ---- Base --------------------------------------------------------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--t-base)/1.62 var(--f-serif);
  /* overflow-x is not set to hidden here on purpose: hiding it masks a layout
   * bug at 320px instead of fixing it. If this page ever scrolls sideways,
   * something inside is too wide and should be fixed at the source. */
}

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

/* Long unbroken strings — an email address, a command — are the usual cause of
 * sideways scroll on a 320px screen. Wrap them rather than clipping them. */
pre, code, .mono { font-family: var(--f-mono); }
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--t-sm);
  line-height: 1.55;
  margin: 0;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

/* One focus style for everything, using the accent (9.6:1 light / 8.9:1 dark)
 * so the ring itself passes non-text contrast. :focus-visible rather than
 * :focus keeps it off mouse clicks without ever removing it from keyboards. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

h1, h2, h3 { font-family: var(--f-serif); font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: var(--t-h1); line-height: 1.06; margin: 0 0 .5em; letter-spacing: -.02em; }
h2 { font-size: var(--t-h2); line-height: 1.18; margin: 0 0 .6em; }
h3 { font-size: var(--t-h3); line-height: 1.35; margin: 1.9em 0 .35em; }
p, ul, ol, dl { margin: 0 0 .95em; }
li { margin-bottom: .35em; }
strong { font-weight: 600; }

/* ---- Furniture: labels, rules, notes ------------------------------------ */
/* The sans face is used only for furniture — labels, tables, buttons, form
 * controls — so prose stays in one voice and the interface stays in another.
 * That separation is what makes the page read as a document rather than a UI. */
.label {
  font: 600 var(--t-label)/1.3 var(--f-sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .9em;
}
.small { font-size: var(--t-sm); color: var(--ink-2); }
.quiet { color: var(--ink-2); }

.skip {
  position: absolute; left: -9999px; top: .5rem;
  background: var(--panel); color: var(--ink);
  padding: .6rem .9rem; border: 1px solid var(--rule-ui); border-radius: var(--r-md);
  font: var(--t-sm) var(--f-sans); z-index: 10;
}
.skip:focus { left: .75rem; }

/* WHY 58rem AND NOT WIDER: the reading column is capped at 34rem (.measure)
 * and the numbered rail takes 4rem. A 68rem shell left roughly half the screen
 * empty on the right at 1280px, which reads as an unfinished layout rather
 * than as white space. 58rem keeps a generous outer margin without the page
 * looking like it lost a column. */
.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding: 0 clamp(1.125rem, 4vw, 3rem);
}
.measure { max-width: var(--measure); }

/* ---- Masthead ----------------------------------------------------------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0 .9rem;
}
.masthead__row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .5rem clamp(1rem, 3vw, 2rem);
}
.wordmark {
  font: 600 1.25rem/1 var(--f-serif);
  letter-spacing: -.02em; color: var(--ink); text-decoration: none;
}
.wordmark span { font-size: var(--t-label); letter-spacing: .12em; text-transform: uppercase;
  font-family: var(--f-sans); color: var(--ink-3); margin-left: .55rem; }
.masthead nav { margin-left: auto; }
.masthead nav ul { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.masthead nav a { font: var(--t-sm) var(--f-sans); }
[aria-current="page"] { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--accent); }

/* ---- Sections: numbered editorial rail ---------------------------------- */
.section { border-top: 1px solid var(--rule); padding: var(--gap) 0; }
.section:first-of-type { border-top: 0; }
.section__num {
  font: 600 var(--t-label)/1 var(--f-sans);
  letter-spacing: .1em; color: var(--ink-3);
  margin: 0 0 .75rem;
}
@media (min-width: 54rem) {
  /* The number moves into the left margin only when there is a margin to move
   * it into. Below this width it sits above the heading, which is why it is
   * marked up before it. */
  .section { display: grid; grid-template-columns: 4rem minmax(0, 1fr); column-gap: 1.5rem; }
  .section__num { grid-column: 1; margin: .45rem 0 0; }
  .section__body { grid-column: 2; }
}

/* ---- Hero --------------------------------------------------------------- */
.hero { padding: clamp(2.25rem, 6vw, 4.5rem) 0 var(--gap); }
.hero__lede { font-size: var(--t-lg); line-height: 1.5; max-width: 36rem; }
.hero__sub { max-width: 34rem; }

/* A left rule instead of a box: an editorial pull-quote, not a card. */
.pull {
  border-left: 3px solid var(--accent);
  padding: .1rem 0 .1rem 1.15rem;
  margin: 0 0 1.25rem;
  max-width: 34rem;
}
.pull p { font-size: var(--t-lg); line-height: 1.45; margin-bottom: .35em; }
.pull p:last-child { margin-bottom: 0; }

/* ---- Panels, notes, figures --------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}
.note {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: .9rem 0;
  font-size: var(--t-sm);
  color: var(--ink-2);
  max-width: 38rem;
}
.note p { margin-bottom: .5em; }
.note p:last-child { margin-bottom: 0; }

/* [PLACEHOLDER] blocks are dashed and labelled so nobody mistakes one for a
 * finished element and ships it. They exist because inventing a screenshot,
 * a testimonial or a customer count for this audience is unrecoverable. */
.placeholder {
  border: 1px dashed var(--rule-ui);
  border-radius: var(--r-md);
  padding: 1.1rem;
  color: var(--ink-2);
  font: var(--t-sm)/1.5 var(--f-sans);
  max-width: 38rem;
}
.placeholder b { font-family: var(--f-mono); font-weight: 600; color: var(--ink); }
figure { margin: 0 0 1rem; }
figcaption { font: var(--t-sm)/1.5 var(--f-sans); color: var(--ink-2); margin-top: .5rem; max-width: 38rem; }

.code {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: .85rem 1rem;
  max-width: 38rem;
}
.code + .code { margin-top: .5rem; }

/* ---- Lists -------------------------------------------------------------- */
.plain { list-style: none; padding: 0; }
.plain > li { padding-left: 1.15rem; position: relative; }
.plain > li::before {
  content: ""; position: absolute; left: 0; top: .68em;
  width: .5rem; height: 1px; background: var(--rule-ui);
}
/* A definition list is the honest markup for "term, then what it means" —
 * which is what most of this page's content actually is. */
.dl { margin: 0; }
.dl dt { font-weight: 600; margin-top: 1.05em; }
.dl dd { margin: .15em 0 0; color: var(--ink-2); }

/* ---- Table -------------------------------------------------------------- */
.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font: var(--t-sm)/1.5 var(--f-sans); }
caption { text-align: left; font-size: var(--t-sm); color: var(--ink-2); margin-bottom: .6rem; }
th, td { text-align: left; padding: .55rem .8rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; }
thead th { border-bottom: 1px solid var(--rule-ui); }

/* ---- Buttons and controls ----------------------------------------------- */
.btn {
  display: inline-block;
  font: 600 var(--t-sm)/1 var(--f-sans);
  padding: .8rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
}
.btn--quiet { background: transparent; color: var(--accent); }
.btn:hover { text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.25rem 0; }

.copy {
  font: var(--t-label)/1 var(--f-sans);
  letter-spacing: .06em; text-transform: uppercase;
  background: transparent; color: var(--accent);
  border: 1px solid var(--rule-ui); border-radius: var(--r-sm);
  padding: .4rem .5rem; cursor: pointer;
}

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }

/* Plan chooser. The selected state is carried by the border AND the radio
 * itself, never by colour alone — colour-only meaning fails WCAG 1.4.1 and is
 * invisible to a good number of the people this is sold to. */
.choice {
  display: block;
  border: 1px solid var(--rule-ui);
  border-radius: var(--r-md);
  padding: .95rem 1.05rem;
  margin: 0 0 .6rem;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--accent); border-width: 2px; padding: .875rem .975rem; }
.choice__row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.choice__price { font: 600 var(--t-lg)/1.2 var(--f-sans); }
.choice__meta { font: var(--t-sm)/1.4 var(--f-sans); color: var(--ink-2); flex-basis: 100%; }
.choice input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin: 0 .55rem 0 0; }

.consent {
  display: flex; gap: .7rem; align-items: flex-start;
  font: var(--t-sm)/1.5 var(--f-sans);
  border-top: 1px solid var(--rule);
  padding: 1rem 0 0;
  margin: 0 0 .25rem;
}
.consent input { accent-color: var(--accent); width: 1.15rem; height: 1.15rem; margin: .1rem 0 0; flex: none; }

.error {
  font: var(--t-sm)/1.5 var(--f-sans);
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: .8rem;
  margin: .75rem 0 0;
}

/* ---- Footer ------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--rule);
  margin-top: var(--gap);
  padding: var(--gap) 0 3rem;
  font: var(--t-sm)/1.6 var(--f-sans);
  color: var(--ink-2);
}
.foot p { max-width: 38rem; }
.foot a { overflow-wrap: anywhere; }

/* ---- Pricing: plan chooser extras --------------------------------------- */
/* The whole card is the click target, but only the radio inside it can take
 * focus, so the focus ring has to be lifted onto the card — otherwise keyboard
 * users get a 16px ring in the corner of a 300px control and lose their place.
 * Kept as a separate rule from the :checked one above so a browser that drops
 * one selector does not lose both. */
.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* "Save $39". A word plus a hairline, not a coloured pill — a badge is the
 * genre marker this page is avoiding, and the saving is a fact, not a shout. */
.flag {
  font: 600 var(--t-label)/1 var(--f-sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule-ui);
  border-radius: var(--r-pill);
  padding: .3rem .5rem;
}

.checkout { margin: 0; }
.checkout .btn-row { margin-bottom: .5rem; }

/* The submit button names the plan it starts ("Start $19/month subscription"),
 * which California's ARL effectively requires and which is wrong the moment the
 * other plan is selected. Both labels are in the markup and CSS picks one.
 *
 * WHY THE DEFAULT HIDES MONTHLY: annual is the pre-selected plan, so a browser
 * with no :has() support shows the annual label and is still telling the truth.
 * The @supports guard is what makes that fallback deterministic — without it,
 * a non-supporting browser would render both labels at once. Do not "simplify"
 * this to a single label; the label and the selection have to agree. */
.btn-plan[data-plan="monthly"] { display: none; }
@supports selector(:has(*)) {
  .checkout:has(#plan-monthly:checked) .btn-plan[data-plan="annual"]  { display: none; }
  .checkout:has(#plan-monthly:checked) .btn-plan[data-plan="monthly"] { display: inline; }
}

/* An ordered list keeps its numbers — they are the "three claims, in this
 * order" on the homepage, so the order is content. Only the indent is tuned. */
main ol { padding-left: 1.3rem; }
main ol li { padding-left: .2rem; }
