@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* The editor's own type, so the page and the clips of the editor read as one.
   Neutrals lean slightly blue, toward the accent. */
:root {
  --paper: #f6f7f9; --card: #ffffff; --ink: #16181d; --ink-2: #474c57; --muted: #767c88;
  --line: #e2e5ea; --accent: #2f6df0; --accent-ink: #1f55c9; --accent-soft: #edf2fe;
  --chip: #eef0f3; --pending: #b7bcc6;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161a; --card: #1b1e23; --ink: #e9ebef; --ink-2: #c3c7cf; --muted: #9096a2;
    --line: #2a2e35; --accent: #7aa2ff; --accent-ink: #9ab8ff; --accent-soft: #1b2438; --chip: #262a31; --pending: #4a505b;
  }
}
:root[data-theme="dark"] {
  --paper: #14161a; --card: #1b1e23; --ink: #e9ebef; --ink-2: #c3c7cf; --muted: #9096a2;
  --line: #2a2e35; --accent: #7aa2ff; --accent-ink: #9ab8ff; --accent-soft: #1b2438; --chip: #262a31; --pending: #4a505b;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }   /* a jump, not a glide: the owner found the smooth scroll slow across sections */
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code { font-family: var(--mono); font-size: .86em; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.key { font-family: var(--mono); font-size: .8em; font-weight: 500; background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; white-space: nowrap; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; }

/* ---- the sidebar: one section open at a time ---- */
.side { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 28px 0 40px; font-size: 14.5px; }
.brand { display: block; margin: 0 0 22px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.grp { margin: 0 0 4px; }
.grp-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; margin-left: -12px; border-radius: 8px; font-weight: 600; color: var(--ink); cursor: pointer; }
a.grp-h:hover { background: var(--chip); text-decoration: none; }
.grp-h::after { content: "›"; color: var(--muted); font-weight: 400; transition: transform .15s; }
.grp.open > .grp-h::after { transform: rotate(90deg); }
.grp ol { list-style: none; margin: 2px 0 10px; padding: 0 0 0 10px; border-left: 1px solid var(--line); display: none; }
.grp.open ol { display: block; }
.grp li a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink-2); line-height: 1.35; }
.grp li a:hover { background: var(--chip); text-decoration: none; }
.grp li a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.grp.coming .grp-h { color: var(--muted); cursor: default; font-weight: 500; }
.grp.coming .grp-h::after { content: none; }
.grp.coming em { font-style: normal; font-size: 12px; font-weight: 500; }

/* ---- the page ---- */
main { min-width: 0; max-width: 760px; padding: 36px 0 120px; }
.head { margin: 0 0 8px; }
h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 30px); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
.head p { margin: 0; color: var(--ink-2); font-size: 17px; }

.sec { padding-top: 40px; }
.sec + .sec { margin-top: 32px; border-top: 1px solid var(--line); }
h2 { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.sec-line { margin: 0 0 8px; color: var(--ink-2); }

.topic { padding-top: 36px; }
h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; text-wrap: balance; }
.where { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.line { margin: 0 0 12px; color: var(--ink-2); }
p { margin: 10px 0; }

figure { margin: 12px 0 14px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
figure.narrow img { width: auto; max-width: 100%; }
figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); }
figure.pending > div { display: grid; place-items: center; aspect-ratio: 760 / 500; border: 2px dashed var(--pending); border-radius: 10px; color: var(--muted); font-size: 14px; }

ol.steps { list-style: none; counter-reset: s; margin: 10px 0; padding: 0; }
ol.steps li { counter-increment: s; position: relative; padding-left: 34px; margin: 0 0 8px; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--card); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

.fields { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.fields th, .fields td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
.fields tr:last-child th, .fields tr:last-child td { border-bottom: 1px solid var(--line); }
.fields th { width: 36%; font-weight: 600; }

.know { margin: 12px 0 0; padding: 10px 14px 10px 30px; background: var(--accent-soft); border-radius: 8px; font-size: 15px; }
.know li { margin: 3px 0; }
.more { font-size: 15px; }

/* ON A PHONE: one column. The chapters sit on one row that scrolls sideways,
   and a clip opens at its recorded size on a tap, since at phone width the
   editor's text in it is half size. */
@media (max-width: 860px) {
  .wrap { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
  .side { position: sticky; top: 0; z-index: 2; max-height: none; padding: 10px 16px; margin: 0 -16px; display: flex; align-items: center; gap: 4px; overflow-x: auto; white-space: nowrap; background: var(--paper); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .brand { margin: 0 10px 0 0; }
  .grp { margin: 0; flex: none; }
  .grp-h { margin: 0; padding: 6px 10px; font-size: 14px; }
  .grp-h::after { content: none; }
  .grp.open > .grp-h { background: var(--accent-soft); color: var(--accent-ink); }
  .grp ol { display: none !important; }
  main { padding-top: 16px; }
  figure img { cursor: zoom-in; }
}
.zoom { position: fixed; inset: 0; z-index: 10; display: none; overflow: auto; background: var(--paper); cursor: zoom-out; -webkit-overflow-scrolling: touch; }
.zoom.on { display: block; }
.zoom img { display: block; width: 760px; max-width: none; margin: 16px; }

/* THE OPENING SHOT: the campus, turning, before any words. */
figure.hero { margin: 16px 0 0; }
figure.hero video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #eef0f2; }
/* The section name sits right on its first question: no gap for a line that restated the list. */
.sec > h2 + .topic { padding-top: 14px; }
figure.hero + .sec, .head + figure.hero + .sec { padding-top: 28px; }
/* Click to copy: a command or an address someone would otherwise retype. */
.copy { font-family: var(--mono); font-size: .8em; font-weight: 500; color: inherit; background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 8px; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.copy::after { content: 'Copy'; margin-left: 10px; font-family: inherit; font-size: .9em; opacity: .55; }
.copy:hover { border-color: currentColor; }
.copy.done::after { content: 'Copied'; opacity: 1; }
.copy.say { font-family: var(--sans); font-size: .95em; display: block; width: 100%; padding: 6px 10px; }
/* Previous and next: every topic leads on through the story. */
.pn { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.pn a { display: flex; flex-direction: column; max-width: 48%; color: var(--accent-ink); }
.pn a.next { text-align: right; margin-left: auto; }
.pn-sec { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
