/* Same type as the lessons (Manrope + IBM Plex Mono), with Instrument Serif italic
   marking the one key word in a heading. All fonts are bundled; no font service. */
@font-face {
  font-family: "Visualize Sans";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Visualize Mono";
  src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Visualize Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fbfbf9;
  --panel: #f2f1ec;
  --ink: #161615;
  --ink-2: #5d5c57;
  --ink-3: #8d8b85;
  --hair: #e4e2dc;
  --accent: #c85a17;
  --sans: "Visualize Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Visualize Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Visualize Serif", "Iowan Old Style", Georgia, serif;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono, code { font-family: var(--mono); font-weight: 500; }
em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.01em;
}
.skip { position: absolute; left: 1rem; top: -5rem; background: var(--ink); color: var(--bg); padding: .5rem .8rem; border-radius: 8px; }
.skip:focus { top: 1rem; z-index: 10; }

.wrap { width: min(1200px, 100% - 4rem); margin-inline: auto; }

/* ---- Top bar ---------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hair);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.bar nav { display: flex; gap: 28px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.bar nav a:hover { color: var(--ink); }
.bar .gh { color: var(--ink); }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding-top: clamp(24px, 4vw, 64px); text-align: center; }
.hero-intro { display: grid; grid-template-columns: 46% 54%; align-items: center; min-height: clamp(440px, 39vw, 580px); }
.hero-copy { min-width: 0; text-align: left; }
.hero-copy h1 { margin-left: 0; font-size: clamp(48px, 5.2vw, 78px); }
.hero-copy .lede { margin-left: 0; max-width: 43ch; font-size: clamp(16px, 1.3vw, 19px); }
.hero-copy .hero-actions { justify-content: flex-start; gap: 8px; }
.hero-actions .prompt { max-width: 100%; gap: 10px; font-size: 13px; }
.hero-diagrams {
  position: relative; isolation: isolate; width: 100%; aspect-ratio: 1.32;
  background: radial-gradient(ellipse at 54% 51%, #e9e5da55, transparent 66%);
}
.hero-diagrams a {
  position: absolute; display: block; left: var(--x); top: var(--y); width: var(--w);
  transform: translate(-50%, -50%); z-index: 1;
}
.hero-diagrams img {
  width: 100%; opacity: var(--opacity, .72);
  mask-image: linear-gradient(150deg, #000 48%, rgb(0 0 0 / .7) 100%);
  transition: opacity .45s ease, scale .6s ease;
}
.hero-diagrams :is(a:hover, a:focus-visible) { z-index: 3; }
.hero-diagrams :is(a:hover, a:focus-visible) img { opacity: 1; scale: 1.045; mask-image: none; }
.hero-diagrams a:nth-child(1) { --x: 48%; --y: 49%; --w: 52%; --opacity: 1; z-index: 2; }
.hero-diagrams a:nth-child(2) { --x: 19%; --y: 24%; --w: 30%; }
.hero-diagrams a:nth-child(3) { --x: 55%; --y: 11%; --w: 21%; --opacity: .54; }
.hero-diagrams a:nth-child(4) { --x: 80%; --y: 23%; --w: 30%; }
.hero-diagrams a:nth-child(5) { --x: 85%; --y: 69%; --w: 29%; }
.hero-diagrams a:nth-child(6) { --x: 50%; --y: 84%; --w: 36%; }
.hero-diagrams a:nth-child(7) { --x: 12%; --y: 59%; --w: 21%; --opacity: .62; }
.hero-diagrams a:nth-child(8) { --x: 20%; --y: 85%; --w: 22%; }
.hero-diagrams a:nth-child(9) { --x: 88%; --y: 45%; --w: 21%; --opacity: .6; }
@media (prefers-reduced-motion: no-preference) {
  .hero-diagrams img { animation: hero-settle 4.2s cubic-bezier(.16,.78,.25,1) both; }
  .hero-diagrams a:nth-child(even) img { animation-delay: .14s; }
  .hero-diagrams a:nth-child(3n) img { animation-delay: .28s; }
  @keyframes hero-settle {
    from { translate: -6px 10px; opacity: 0; }
    to { translate: 0 0; }
  }
}
@media (max-width: 850px) {
  .hero-intro { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { max-width: 580px; }
  .hero-diagrams { width: min(100%, 560px); margin: 1rem auto 0; aspect-ratio: 1.75; }
  .hero-diagrams a:nth-child(1) { --w: 43%; }
}
.kicker { margin: 0 0 22px; font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: .01em; }
h1 {
  margin: 0 auto;
  max-width: 15ch;
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.045em;
}
.lede { margin: 26px auto 0; max-width: 40rem; font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.prompt, .cmd {
  display: inline-flex; align-items: center; gap: 18px;
  height: 48px; padding: 0 8px 0 18px;
  background: #fff; border: 1px solid var(--hair); border-radius: 12px;
  font-size: 14.5px; text-align: left;
  transition: border-color .15s;
}
.prompt:hover, .cmd:hover { border-color: var(--ink-3); }
.copy-label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  padding: 6px 10px; border-radius: 8px; background: var(--panel);
}
.btn {
  display: inline-flex; align-items: center; height: 48px; padding: 0 22px;
  background: var(--ink); color: var(--bg); border-radius: 12px;
  font-size: 15px; font-weight: 600;
}
.btn:hover { background: #000; }

.stage {
  position: relative; margin: 64px 0 0;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hair); border-radius: var(--radius);
  overflow: hidden; background: #f6f5f1;
  box-shadow: 0 1px 2px rgba(20, 20, 18, .04), 0 24px 60px -32px rgba(20, 20, 18, .18);
}
.stage img { width: 100%; height: 100%; object-fit: cover; }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 22px 0 18px;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  transition: transform .15s;
}
.play:hover { transform: scale(1.03); }
.play-dot {
  width: 0; height: 0;
  border-left: 11px solid var(--bg);
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.stage-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-3); }
.stage-note a, .log a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair); }
.stage-note a:hover, .log a:hover { text-decoration-color: var(--ink); }

/* ---- Sections --------------------------------------------------------- */
.section { padding-top: 140px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; padding-bottom: 22px; border-bottom: 1px solid var(--hair); }
h2 { margin: 0; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -0.035em; }
h3 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
.count { margin: 0; font-size: 14px; color: var(--ink-3); }

/* ---- Lessons grid ------------------------------------------------------- */
.filters { display: flex; gap: 8px; margin-top: 24px; }
.filters button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hair); font-size: 13.5px; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 28px; margin-top: 40px; }
.card { display: block; }
.card[hidden] { display: none; }
.card-media {
  aspect-ratio: 760 / 460; border-radius: var(--radius); background: var(--panel);
  display: grid; place-items: center; padding: 6%;
  transition: background .2s;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media { background: #ecebe5; }
.card:hover .card-media img { transform: scale(1.035); }
.card h3 { margin-top: 18px; }
.card-prompt { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.tags { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ok {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: #2f6b3a;
}
.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3c8a4a; }
.ask-media { background: transparent; border: 1px dashed #d3d1ca; font: 400 64px/1 var(--serif); font-style: italic; color: var(--ink-3); }
.card-ask:hover .ask-media { background: var(--panel); }

/* ---- How it works ---------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.steps p, .checks p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.n { display: block; margin-bottom: 14px; font: 500 12.5px/1 var(--mono); color: var(--accent); }
.studios { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 64px; }
.studio {
  display: grid; grid-template-columns: 44% 1fr; gap: 28px; align-items: center;
  padding: 20px; border: 1px solid var(--hair); border-radius: var(--radius); background: #fff;
  transition: border-color .15s;
}
.studio:hover { border-color: var(--ink-3); }
.studio img { border-radius: 10px; background: var(--panel); padding: 6%; aspect-ratio: 760 / 460; object-fit: contain; width: 100%; }
.studio p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ---- Inside a lesson -------------------------------------------------- */
.inside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; margin-top: 40px; align-items: start; }
.shot { position: relative; margin: 0; border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
.pin {
  position: absolute; translate: -50% -50%;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font: 600 11.5px/1 var(--sans);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 4px 12px rgba(0, 0, 0, .18);
}
.legend { list-style: none; counter-reset: pin; padding: 0; margin: 0; display: grid; gap: 18px; }
.legend li { counter-increment: pin; position: relative; padding-left: 40px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.legend li::before {
  content: counter(pin);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent);
  font: 600 12px/1 var(--sans);
}
.legend b { display: block; color: var(--ink); font-weight: 600; }

/* ---- Checks / limits -------------------------------------------------- */
.checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 40px; }
.log { margin-top: 48px; padding: 22px 24px; border-radius: var(--radius); background: var(--panel); }
.log p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.log p + p { margin-top: 10px; }
.log .mono { font-size: 12.5px; color: var(--ink-3); margin-right: 6px; }
.log .log-label { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }

/* ---- Install ------------------------------------------------------------ */
.install { margin-top: 32px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); }
.tabs button { height: 36px; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.cmds { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 22px; max-width: 760px; }
.cmds li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; }
.cmds .n { margin: 4px 0 0; }
.cmds p { margin: 0 0 8px; font-size: 15px; font-weight: 500; }
.cmd { width: 100%; justify-content: space-between; font-size: 13.5px; }
.cmd code { overflow-x: auto; white-space: nowrap; }

/* ---- Footer ------------------------------------------------------------- */
.foot {
  display: flex; gap: 28px; margin-top: 140px; padding: 28px 0 48px;
  border-top: 1px solid var(--hair); font-size: 14px; color: var(--ink-3);
}
.foot span:first-child { color: var(--ink); font-weight: 600; margin-right: auto; }
.foot .mono { font-weight: 500; color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.foot a:hover { color: var(--ink); }

/* ---- Smaller screens (desktop first; phone polish comes later) -------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps, .checks { grid-template-columns: repeat(2, 1fr); }
  .studios, .inside { grid-template-columns: 1fr; }
  .bar nav a:not(.gh):not([href="#install"]) { display: none; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 2.5rem); }
  .hero { padding-top: 36px; }
  .hero-copy { display: contents; }
  .hero-copy > * { text-align: left; }
  .hero-copy .kicker, .hero-copy h1 { order: -2; }
  .hero-diagrams { order: -1; }
  .hero-copy .lede { margin-top: 1rem; }
  .filters, .tabs { flex-wrap: wrap; }
  .grid, .steps, .checks { grid-template-columns: 1fr; }
  .studio { grid-template-columns: 1fr; }
  .section { padding-top: 96px; }
  .head { flex-direction: column; gap: 6px; }
  .prompt { max-width: 100%; }
  .prompt code { overflow-x: auto; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
