/* The e-book landing page (ebook/index.qmd). Its identity is the cover's: book/media/cover.svg
   gives the navy, the cream and light blue of its type, and the eight line colours, which
   ebook/_source.py reads and the page's markup carries as --c. Dark in every OS setting. */

@font-face { font-family: "Newsreader"; src: url("media/fonts/newsreader.woff2") format("woff2");
  font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("media/fonts/nunito-sans.woff2") format("woff2");
  font-weight: 400 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("media/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --navy: #13202e;        /* the cover's background */
  --navy-2: #0e1823;      /* alternate bands, a step darker */
  --panel: #182a3c;       /* cards and boxes, a step lighter */
  --cream: #f4f1ea;       /* the cover's title */
  --text: #c9d6e2;        /* the cover's subtitle: body text, 11.1:1 on navy */
  --muted: #a3b4c6;       /* secondary text, 7.6:1 on navy, 6.7:1 on panel */
  --blue: #86cce8;        /* the cover's small caps: labels and links */
  --line: rgba(201, 214, 226, 0.16);
  --serif: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --sans: "Nunito Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", Menlo, "DejaVu Sans Mono", monospace;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--navy); color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; }
.cell, .cell-output-display { display: contents; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--cream); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--blue); color: var(--navy); }
code { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { color: var(--cream); font-family: var(--serif); font-weight: 600; margin: 0; }
h2 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.12; margin: 0 0 0.45em;
  letter-spacing: -0.01em; }
h2 code { font-size: 0.82em; color: var(--blue); }
h3 { font-size: 1.35rem; line-height: 1.2; }
p { margin: 0 0 1em; max-width: 66ch; }
.eyebrow { display: block; font: 800 0.75rem/1.3 var(--sans); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 0.7rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 820px; }
.band { padding: 52px 0; }
.band.alt { background: var(--navy-2); }
@media (min-width: 700px) { :root { --gutter: 32px; } .band { padding: 80px 0; } }

/* ---- buttons -------------------------------------------------------------------------- */
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  white-space: nowrap;
  min-height: 52px; padding: 0 22px; border-radius: 12px; border: 0;
  font: 700 1.0625rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--cream); color: var(--navy);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
.btn.primary:hover { background: #ffffff; color: var(--navy); }
.btn .size { font: 400 0.8125rem/1 var(--mono); color: #3c4a5a; margin-left: 0.15em; }
.btn.secondary { background: transparent; color: var(--blue);
  box-shadow: inset 0 0 0 1.5px rgba(134, 204, 232, 0.65); }
.btn.secondary:hover { color: var(--cream); box-shadow: inset 0 0 0 1.5px var(--cream); }
.btn.ghost { background: rgba(201, 214, 226, 0.08); color: var(--cream); min-height: 46px;
  font-size: 0.9375rem; }
.btn.ghost:hover { background: rgba(201, 214, 226, 0.16); color: var(--cream); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 14px; }
@media (max-width: 699px) { .ctas .btn { width: 100%; } }
.howto { font-size: 0.875rem; color: var(--muted); margin: -4px 0 12px; }

/* ---- 1. hero ----------------------------------------------------------------------------- */
.hero { padding: 22px 0 36px;
  background: radial-gradient(120% 70% at 15% 0%, rgba(134, 204, 232, 0.10), transparent 60%),
              var(--navy); }
.hero-grid { display: grid; grid-template-columns: 112px 1fr;
  grid-template-areas: "cover head" "body body"; column-gap: 20px; row-gap: 18px;
  align-items: center; }
.cover { grid-area: cover; display: block; perspective: 900px; }
.cover img { display: block; width: 100%; height: auto; border-radius: 2px 6px 6px 2px;
  transform: rotateY(16deg) rotateX(2deg); transform-origin: left center;
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.06), 18px 22px 40px rgba(0, 0, 0, 0.55),
              3px 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hero-head { grid-area: head; }
.hero-head .eyebrow { margin-bottom: 0.6rem; }
.hero h1 { font-weight: 700; font-size: clamp(2.45rem, 10.4vw, 5.4rem); line-height: 0.98;
  letter-spacing: -0.015em; }
.hero-body { grid-area: body; }
.subtitle { font: 500 clamp(1.15rem, 2.4vw, 1.55rem)/1.3 var(--serif); color: var(--text);
  margin: 0 0 0.75em; }
.promise { color: var(--cream); font-size: 1.0625rem; margin: 0 0 0.6em; }
.byline { font-weight: 700; letter-spacing: 0.04em; color: var(--blue); font-size: 0.9375rem;
  margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.badges li { font: 400 0.8125rem/1 var(--mono); color: var(--cream); padding: 7px 10px;
  border-radius: 7px; box-shadow: inset 0 0 0 1px var(--line); }
.badges li.plain { box-shadow: none; color: var(--muted); padding-left: 2px; }
@media (min-width: 700px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: minmax(220px, 340px) 1fr;
    grid-template-areas: "cover head" "cover body"; column-gap: clamp(40px, 6vw, 88px);
    row-gap: 22px; align-items: end; }
  .hero-body { align-self: start; }
  .cover img { transform: rotateY(18deg) rotateX(3deg); }
  .promise { font-size: 1.2rem; }
}
/* A QR code to this page for a projected screen; phones are already here, so wide screens only. */
.hero-qr { display: none; }
@media (min-width: 900px) {
  .hero-qr { display: flex; align-items: center; gap: 18px; margin: 28px 0 0; }
  .hero-qr svg { flex: none; width: 132px; height: 132px; border-radius: 8px; }
  .hero-qr figcaption { display: grid; gap: 4px; color: var(--muted); font: 400 0.875rem/1.35 var(--mono); }
  .hero-qr figcaption strong { color: var(--cream); font: 700 1rem/1.3 var(--sans); }
}
@media (hover: hover) and (min-width: 700px) { .cover:hover img { transform: rotateY(6deg) rotateX(1deg); } }

/* ---- 2. the loop -------------------------------------------------------------------------- */
.loop { display: grid; gap: 28px; margin-top: 30px; align-items: center; }
.loop-svg { width: 100%; max-width: 420px; height: auto; margin: 0 auto; display: block; }
.loop-svg .ring { fill: none; stroke: rgba(201, 214, 226, 0.22); stroke-width: 2.5; }
.loop-svg .comet { fill: none; stroke: var(--cream); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 18 282; opacity: 0; }
.loop-svg.drawn .comet { opacity: 1; animation: comet 6s linear 0.4s 3 both; }
@keyframes comet { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -300; } }
.loop-svg .chev { fill: none; stroke: rgba(201, 214, 226, 0.55); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round; }
.loop-svg .node circle { fill: var(--navy); stroke-width: 3.5; }
.loop-svg .node .halo { fill: none; stroke-width: 1.5; stroke-dasharray: 3 5; }
.loop-svg .lbl { font: 600 24px var(--serif); fill: var(--cream); text-anchor: middle; }
.loop-svg .who { font: 400 11px var(--mono); text-anchor: middle; }
.loop-svg .mid { font: 600 14px var(--sans); fill: var(--muted); text-anchor: middle; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.steps li { padding-left: 18px; border-left: 3px solid var(--c); }
.steps h3 { color: var(--c); margin-bottom: 0.25em; }
.steps p { margin: 0; }
@media (min-width: 860px) { .loop { grid-template-columns: 420px 1fr; gap: 56px; } }

/* ---- 3. one source, eight outputs ----------------------------------------------------------- */
.fanout { display: grid; grid-template-columns: 98px 1fr; column-gap: 14px; margin-top: 28px; }
.fan { display: block; }
.fan path { fill: none; stroke-width: 7; stroke-linecap: round; }
.fan .src { font: 400 54px var(--mono); fill: var(--cream); text-anchor: middle; }
.fan-tall { width: 98px; height: 608px; }
.fan-tall .src { font-size: 30px; }
.fan-wide { display: none; }
.fan.will-draw path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fan.will-draw circle { opacity: 0; }
.fan.will-draw.drawn path { stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.5, 0, 0.2, 1) calc(var(--i) * 90ms); }
.fan.will-draw.drawn circle { opacity: 1; transition: opacity 0.4s ease calc(0.9s + var(--i) * 90ms); }
.formats { list-style: none; margin: 0; padding: 0; }
.formats li { height: 76px; display: flex; align-items: center; }
.formats a { display: flex; flex-direction: column; gap: 1px; text-decoration: none;
  color: var(--text); padding: 4px 6px; margin-left: -6px; border-radius: 8px; }
.formats code { font-size: 0.875rem; color: var(--c); }
.formats .t { color: var(--cream); font-weight: 700; font-size: 0.98rem; line-height: 1.25; }
.formats .n { color: var(--muted); font-size: 0.8125rem; line-height: 1.3; }
.formats a:hover .t { text-decoration: underline; text-decoration-color: var(--c); }
@media (min-width: 900px) {
  .fanout { grid-template-columns: 1fr; }
  .fan-tall { display: none; }
  .fan-wide { display: block; width: 100%; height: auto; }
  .formats { display: grid; grid-template-columns: repeat(8, 1fr); }
  .formats li { height: auto; justify-content: center; align-items: flex-start; }
  .formats a { align-items: center; text-align: center; margin: 0; padding: 8px 4px; }
  .formats code { font-size: 1rem; }
}

/* ---- 4. what you'll build ----------------------------------------------------------------- */
.cards { display: grid; gap: 22px; margin: 28px 0 0; }
.card { background: var(--panel); border-radius: 16px; overflow: hidden; display: flex;
  flex-direction: column; box-shadow: inset 0 3px 0 var(--c), 0 0 0 1px var(--line); }
.clip { margin: 0; }
.frame { position: relative; aspect-ratio: 800 / 460; background: #141414; }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; }
.frame video { opacity: 0; transition: opacity 0.4s ease; }
.clip.playing video { opacity: 1; }
.pause { position: absolute; right: 10px; bottom: 10px; font: 700 0.8125rem/1 var(--sans);
  color: var(--cream); background: rgba(14, 24, 35, 0.82); border: 0; border-radius: 999px;
  padding: 9px 14px; min-height: 34px; cursor: pointer; }
.clip figcaption { font-size: 0.8125rem; line-height: 1.45; color: var(--muted);
  padding: 12px 20px 0; }
.card-body { padding: 14px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body .eyebrow { margin-bottom: 0.4rem; }
.stat { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 14px; }
.stat .num { font: 700 clamp(2.5rem, 7vw, 3.4rem)/1 var(--serif); color: var(--c);
  font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.stat .what { font-size: 0.9375rem; color: var(--cream); }
.more { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.more a, .links a, a.arrow { display: inline-flex; align-items: center; gap: 0.35em;
  font-weight: 700; text-decoration: none; min-height: 32px; }
.more a:hover, .links a:hover, a.arrow:hover { text-decoration: underline; }
@media (min-width: 860px) { .cards { grid-template-columns: 1fr 1fr; } }

.made { margin-top: 40px; padding: 24px 20px; border-radius: 16px; background: var(--navy-2);
  box-shadow: 0 0 0 1px var(--line); }
.made h3 { margin-bottom: 0.5em; }
.code { margin: 0 0 16px; padding: 16px 18px; background: #0a121b; border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; color: #d7e3ee;
  font: 400 0.8125rem/1.65 var(--mono); }
.code code { font-size: inherit; }
@media (max-width: 699px) { .code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.75rem; } }
.made p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
@media (min-width: 700px) { .made { padding: 32px; } }

/* ---- 5. who it's for -------------------------------------------------------------------------- */
.two { display: grid; gap: 44px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; gap: 64px; } }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 4px 0 18px; padding: 0; }
.pills li { color: var(--cream); padding: 7px 14px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); background: rgba(201, 214, 226, 0.05); }
#who ol { list-style: none; counter-reset: need; margin: 4px 0 20px; padding: 0; }
#who ol li { counter-increment: need; position: relative; padding: 4px 0 10px 44px; }
#who ol li::before { content: counter(need); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 700 1.05rem/1 var(--serif); color: var(--navy); background: var(--blue); }
.note { display: block; padding: 12px 16px; border-left: 3px solid #e9b86e;
  background: rgba(233, 184, 110, 0.07); border-radius: 0 10px 10px 0; color: var(--text); }

/* ---- 6. contents and 10. questions ------------------------------------------------------------ */
.toc { margin-top: 24px; }
.toc details, .toc .toc-solo, #faq details { border-top: 1px solid var(--line); }
.toc > :last-child, #faq details:last-of-type { border-bottom: 1px solid var(--line); }
.toc summary, #faq summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: 2px 14px; padding: 16px 40px 16px 4px; position: relative; }
.toc summary { display: grid; grid-template-columns: 5.6em 1fr; column-gap: 14px; }
.toc summary .pc { grid-column: 2; }
@media (min-width: 700px) {
  .toc summary { grid-template-columns: 5.6em auto 1fr; }
  .toc summary .pc { grid-column: auto; }
}
.toc summary::-webkit-details-marker, #faq summary::-webkit-details-marker { display: none; }
.toc summary::after, #faq summary::after { content: ""; position: absolute; right: 12px; top: 24px;
  width: 10px; height: 10px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  transform: rotate(45deg); transition: transform 0.2s ease; }
details[open] > summary::after { transform: translateY(4px) rotate(225deg); }
.toc .pl { font: 800 0.75rem/1.6 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue); }
.toc .pt { font: 600 1.25rem/1.3 var(--serif); color: var(--cream); }
.toc .pc { font-size: 0.8125rem; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0 0 12px; }
.toc .toc-solo { padding: 6px 0; }
.toc .toc-solo li a { grid-template-columns: 1fr; padding-left: 4px; }
.toc li a { display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline;
  padding: 8px 6px; color: var(--text); text-decoration: none; border-radius: 8px; }
.toc li a:hover { background: rgba(201, 214, 226, 0.06); color: var(--cream); }
.toc .n { font: 400 0.875rem var(--mono); color: var(--blue); }
#faq summary { font: 600 1.2rem/1.35 var(--serif); color: var(--cream); }
#faq details > :not(summary) { margin: 0 4px 18px; }
blockquote { margin: 0 0 18px; padding: 2px 0 2px 16px; border-left: 3px solid var(--blue);
  color: var(--text); }
blockquote p { margin: 0; }

/* ---- 7. inside the book ------------------------------------------------------------------------ */
.shots { display: grid; gap: 22px; margin-top: 26px; }
.shot { margin: 0; padding: 12px; background: var(--panel); border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line); }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
.shot.phone img { width: min(100%, 300px); margin: 0 auto; border-radius: 30px; }
.shot figcaption { font-size: 0.9375rem; line-height: 1.5; margin: 12px 4px 2px; color: var(--text); }
.shot .alt { display: block; margin-top: 8px; font-size: 0.8125rem; color: var(--muted); }
.shot .alt b { color: var(--text); }
@media (min-width: 860px) {
  .shots { grid-template-columns: 1.55fr 1fr; align-items: start; }
  .shot.phone { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 24px; }
  .shot:not(.phone) { grid-column: 1; }
}

/* ---- 8. workshop, 9. author ----------------------------------------------------------------- */
.links { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }

/* ---- 11. the last word, 12. footer ------------------------------------------------------------ */
.final { text-align: center;
  background: radial-gradient(90% 80% at 50% 100%, rgba(121, 212, 178, 0.10), transparent 60%),
              var(--navy); }
.final p { margin-left: auto; margin-right: auto; }
.final .ctas, .final .share { justify-content: center; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.copied { font-size: 0.875rem; color: var(--muted); min-width: 1px; }
.foot { padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 0.875rem;
  color: var(--muted); }
.foot p { max-width: none; }
.foot b { color: var(--text); }
@media (max-width: 899px) { body.has-sticky .foot { padding-bottom: 104px; } }

/* ---- the sticky bar on phones ---------------------------------------------------------------- */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 8px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(14, 24, 35, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 -1px 0 var(--line); transform: translateY(110%); visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s; }
/* Hidden bars are invisible too, so their links take no keyboard focus. */
.sticky.show { transform: none; visibility: visible; transition: transform 0.25s ease; }
.sticky .btn { min-height: 48px; padding: 0 14px; font-size: 0.9375rem; }
.sticky .btn.primary { flex: 1; }
@media (max-width: 399px) { .sticky .size { display: none; } }
@media (min-width: 900px) { .sticky { display: none !important; } }

/* ---- reduced motion: everything drawn and still --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .loop-svg .comet { display: none; }
  .btn:hover { transform: none; }
}

/* EN | ES: the page in the other language (_parts.py lang_switch). */
.lang-switch { font: 700 0.8rem/1 var(--sans); letter-spacing: 0.08em; margin: 0 0 0.9rem; }
.lang-switch a { color: var(--blue); text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus-visible { text-decoration: underline; }
.lang-switch [aria-current] { color: var(--cream); }
.lang-switch span[aria-hidden] { color: var(--muted); }
.foot .lang-switch { display: inline; margin: 0; }
