/* Ideas That Pay course site: one shared stylesheet.
   The look of lesson 1's live thumbnails (version 2): a light paper page with a dot grid,
   heavy black words over an amber marker stroke. Colours from scripts/ep6-lesson1/make-thumbnails-v2.py.
   System fonts only; nothing is loaded from another host.
   v1 (home pages, 16 Nov 2026) is kept in exports/review/site/v1-2026-11-16/. */

:root {
  --paper: #F3EFE7;
  --dot: #E1DBCF;
  --ink: #111214;
  --ink-soft: #3B3E44;
  --muted: #5B5F67;
  --amber: #FFBE40;
  --amber-deep: #CD800A;
  --card: #FFFFFF;
  --line: #D6D6DB;
  --wrap: 1060px;
  --gutter: 20px;
  --latin: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 1.8px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  color: var(--ink);
  font-family: var(--latin);
  font-size: 17px;
  line-height: 1.6;
}

:lang(zh-Hant-TW) body, body:lang(zh-Hant-TW) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
}
:lang(zh-Hant-HK) body, body:lang(zh-Hant-HK) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", "Heiti TC", sans-serif;
}
:lang(zh) body { line-height: 1.75; }
[lang="en"] { font-family: var(--latin); }

img { max-width: 100%; height: auto; display: block; }

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

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

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 2; }

/* Header: name, the three parts of the site, the other languages */
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  padding-top: 14px;
  padding-bottom: 8px;
}
.brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  width: 100%;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--amber-deep); }
.langs {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 48px;
  padding: 8px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.langs a:hover { background: var(--amber); }

/* Marker stroke: amber under the lower half of the words, like the thumbnails */
.marker {
  background-image: linear-gradient(var(--amber), var(--amber));
  background-repeat: no-repeat;
  background-size: 100% 0.46em;
  background-position: 0 88%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.12em;
  margin: 0 -0.12em;
  border-radius: 0.12em;
}

/* Keep a Chinese phrase on one line; lines break only between phrases */
.nb { white-space: nowrap; }

/* The top of a home page */
.hero { padding: 18px 0 30px; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 9.6vw, 68px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:lang(zh) .hero h1 { letter-spacing: 0; line-height: 1.25; font-size: clamp(34px, 9.2vw, 64px); }
.hero .lede {
  margin: 0 0 24px;
  max-width: 36em;
  color: var(--ink-soft);
  font-size: clamp(18px, 4.6vw, 21px);
  line-height: 1.5;
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 22px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--amber);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.button:hover { background: #FFC85E; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.button .arrow { margin-left: 8px; }
.button.quiet {
  background: var(--card);
  min-height: 48px;
  font-size: 16px;
  box-shadow: 0 3px 0 var(--ink);
}
.button.quiet:hover { background: var(--amber); }
.button.small { min-height: 46px; padding: 8px 16px; font-size: 16px; box-shadow: 0 3px 0 var(--ink); }
.cta-note {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

/* Sections */
.section { padding: 26px 0; }
.section h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
:lang(zh) .section h2 { letter-spacing: 0; }
.section p { margin: 0 0 14px; max-width: 40em; }
.section-intro { color: var(--ink-soft); }

.panel {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 6px 18px rgba(17, 18, 20, 0.06);
}

/* Course cards */
.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.course {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(17, 18, 20, 0.06);
}
.course .thumb { display: block; border-bottom: 1.5px solid var(--line); }
.course .thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.course .body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 20px; }
.tag {
  align-self: flex-start;
  display: inline-block;
  margin: 0 0 10px !important;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.course h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}
.course h3 a { text-decoration: none; }
.course h3 a:hover { text-decoration: underline; }
.course .kicker { margin: 0 0 10px; color: var(--ink-soft); font-weight: 700; line-height: 1.4; text-wrap: balance; }
:lang(zh) .kicker { text-wrap: wrap; } /* Chinese kickers break only between their phrases */
.course .does { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.badges li {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
}
.badges li.hi { background: var(--amber); border-color: var(--ink); }
.more { margin-top: auto; font-weight: 800; }
.all { margin-top: 18px !important; font-weight: 800; }

/* Free packs on a home page */
.packs { margin: 4px 0 8px; padding: 0; list-style: none; }
.packs li { padding: 16px 0; border-top: 1.5px solid var(--line); }
.packs h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; line-height: 1.35; }
.packs h3 a { text-decoration: none; }
.packs h3 a:hover { text-decoration: underline; }
.packs p { color: var(--ink-soft); }

.pack-list { margin: 0 0 16px; padding: 0; list-style: none; }
.pack-list li { position: relative; margin: 0 0 10px; padding-left: 30px; }
.pack-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 16px;
  height: 9px;
  border-radius: 3px;
  background: var(--amber);
  border: 1.5px solid var(--ink);
}
.pack-h { margin: 0 0 14px; font-size: clamp(24px, 6vw, 32px); font-weight: 900; line-height: 1.2; }
.fine { margin-top: 16px !important; color: var(--muted); font-size: 15px; }

/* Community */
.community {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.community li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 20px 20px 22px;
}
.community h3 { margin: 0 0 8px; font-size: 20px; font-weight: 900; line-height: 1.3; }
.community p { color: var(--ink-soft); }
.community .more, .community .button { margin-top: auto; }

/* Buy me a coffee: one section on a home page, one short line at the end of a course page */
.support {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #FFF8E8;
  border-color: #E8C98A;
}
.support .cup { flex: 0 0 auto; margin-top: 2px; }
.support h2 { margin: 0 0 10px; }
.support.compact { align-items: center; padding: 18px 20px; }
.support-line { margin: 0 0 12px !important; font-weight: 700; }
@media (max-width: 480px) {
  .support { flex-direction: column; gap: 8px; }
}

/* Who teaches */
.teacher { font-size: clamp(19px, 4.8vw, 22px); font-weight: 700; line-height: 1.5; }

/* A course page */
.crumbs { margin: 4px 0 0; color: var(--muted); font-size: 15px; font-weight: 600; }
.crumbs a { color: var(--ink-soft); }
.course-hero { padding: 14px 0 18px; }
.course-top { display: grid; gap: 20px; }
.course-top .thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(17, 18, 20, 0.08);
}
.course-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
:lang(zh) .course-hero h1 { letter-spacing: 0; line-height: 1.25; }
.course-hero .kicker {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: clamp(18px, 4.4vw, 22px);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}
.course-lede { margin-top: 24px; max-width: 44em; font-size: 18px; }
.course-lede p { margin: 0 0 12px; }

.steps { margin: 0 0 14px; padding-left: 1.6em; max-width: 46em; }
.steps li { margin: 0 0 10px; padding-left: 4px; }
.steps li::marker { font-weight: 900; }
.ticks { margin: 0 0 14px; padding: 0; list-style: none; max-width: 46em; }
.ticks li { position: relative; margin: 0 0 8px; padding-left: 30px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 16px;
  height: 9px;
  border-radius: 3px;
  background: var(--amber);
  border: 1.5px solid var(--ink);
}
.note { color: var(--muted); font-size: 15px; }

.chapters { margin: 0; padding: 0; list-style: none; max-width: 40em; }
.chapters li { border-top: 1px solid var(--line); }
.chapters li:last-child { border-bottom: 1px solid var(--line); }
.chapters a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 44px;
  padding: 9px 6px;
  text-decoration: none;
}
.chapters a:hover .label { text-decoration: underline; text-decoration-color: var(--amber-deep); }
.chapters .time {
  flex: 0 0 auto;
  min-width: 3.4em;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--amber);
  font-family: var(--latin);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

pre.paste {
  margin: 0 0 14px;
  max-width: 46em;
  padding: 16px 18px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--card);
  border: 2px dashed var(--ink-soft);
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.65;
}

.emails { display: grid; gap: 12px; margin: 4px 0 14px; padding: 0; list-style: none; max-width: 46em; }
.emails li { padding: 14px 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; }
.emails p { margin: 0 0 4px; }
.emails .subject { font-weight: 800; }

.sources { margin: 0; padding: 0; list-style: none; }
.sources li { margin: 0 0 8px; overflow-wrap: anywhere; }
.ask { font-size: 19px; font-weight: 700; }

/* Footer */
.site-footer {
  margin-top: 28px;
  padding: 26px 0 40px;
  border-top: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
.site-footer p { margin: 0 0 8px; max-width: 60em; }
.site-footer .foot-brand { color: var(--ink); font-weight: 800; }
.site-footer a { color: var(--ink-soft); }
.site-footer .legal { font-size: 13px; }
.dot-sep { padding: 0 6px; color: var(--line); }

/* Language chooser */
.chooser { min-height: 100vh; display: flex; align-items: center; }
.chooser .wrap { padding-top: 40px; padding-bottom: 40px; }
.chooser h1 {
  margin: 0 0 12px;
  font-size: clamp(44px, 12vw, 84px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.chooser .lede { margin: 0 0 28px; color: var(--ink-soft); font-size: 18px; }
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.choices a {
  display: block;
  padding: 18px 20px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  text-decoration: none;
}
.choices a:hover { background: var(--amber); }
.choices a:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.choices .lang { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; }
.choices .what { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.choices [lang="zh-Hant-TW"] { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.choices [lang="zh-Hant-HK"] { font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", sans-serif; }

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  body { font-size: 18px; }
  .site-header .wrap { flex-wrap: nowrap; padding-top: 20px; padding-bottom: 20px; }
  .site-nav { order: 0; width: auto; margin-left: auto; margin-right: 10px; gap: 0 22px; }
  .hero { padding: 44px 0 46px; }
  .section { padding: 36px 0; }
  .panel { padding: 30px 32px; }
  .course-hero { padding: 18px 0 26px; }
  .course-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button:active, .choices a:active { transform: none; }
}
