/* Shared styles for long-form pages: tutorials, the tutorials hub and video pages.
   Same tokens and header/footer as the field-notes and guide pages, so they read as
   one site. Pages link this file instead of inlining their own copy. */
:root {
  --paper: #f7f7f2;
  --ink: #121412;
  --body: #2c312b;
  --muted: #525751;
  --line: #d9ded6;
  --line-strong: #b8c1b5;
  --surface: #ffffff;
  --surface-cool: #eef3f2;
  --teal: #0f6a64;
  --teal-soft: #d7ece8;
  --clay: #ad6144;
  --charcoal: #171a18;
  --wrap: min(780px, calc(100vw - 48px));
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --text: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-underline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; top: -60px; left: 16px;
  background: var(--ink); color: var(--paper);
  padding: 8px 16px; border-radius: 6px; text-decoration: none; z-index: 100;
}
.skip-link:focus { top: 16px; outline: 3px solid var(--teal); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px max(24px, calc((100vw - 1080px) / 2));
  background: rgba(247, 247, 242, 0.84);
  border-bottom: 1px solid rgba(18, 20, 18, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 23px; letter-spacing: -0.03em;
}
.brand-arrow { width: 26px; height: 26px; display: block; flex: none; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

main { width: var(--wrap); margin: 0 auto; padding: clamp(36px, 6vw, 72px) 0 64px; }
/* Keep in-page anchor targets clear of the sticky header. */
main [id] { scroll-margin-top: 84px; }

.crumbs { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.doc-eyebrow {
  display: inline-block; margin-bottom: 16px; padding: 5px 12px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal);
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
}

h1 {
  margin: 0; font-family: var(--display); font-weight: 800;
  letter-spacing: -0.022em; line-height: 1.06; font-size: clamp(32px, 5vw, 50px);
}
.lede {
  margin: 22px 0 0; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.45;
  color: var(--body); font-weight: 500;
}
.byline { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

main h2 {
  margin: 52px 0 0; font-family: var(--display); font-weight: 800;
  letter-spacing: -0.018em; line-height: 1.15; font-size: clamp(23px, 3vw, 30px);
}
main h3 {
  margin: 32px 0 0; font-family: var(--display); font-weight: 750;
  letter-spacing: -0.012em; font-size: 20px;
}
main p, main li { color: var(--body); }
main p { margin: 14px 0 0; }
main ul, main ol { margin: 14px 0 0; padding-left: 24px; }
main li { margin-bottom: 8px; }
main li::marker { color: var(--teal); font-weight: 700; }
code, kbd {
  font-family: var(--mono); font-size: 0.88em;
  padding: 1px 6px; border-radius: 5px;
  background: var(--surface-cool); border: 1px solid var(--line);
}

/* The short answer at the top of a tutorial: what an AI answer or a skimming reader lifts. */
.answer-box {
  margin: 28px 0 0; padding: 20px 22px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-strong);
}
.answer-box strong.label {
  display: block; margin-bottom: 6px; font-family: var(--display);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal);
}
.answer-box p { margin: 0; }

.toc {
  margin: 28px 0 0; padding: 18px 22px; border-radius: 14px;
  background: var(--surface-cool); border: 1px solid var(--line);
}
.toc h2 {
  margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.toc ol { margin: 10px 0 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; font-size: 15px; }

.note {
  margin: 22px 0 0; padding: 18px 20px; border-radius: 12px;
  background: var(--surface-cool); border: 1px solid var(--line); font-size: 16px;
}
.note p:first-child { margin-top: 0; }
.note.caution { background: rgba(173, 97, 68, 0.08); border-color: rgba(173, 97, 68, 0.3); }

.example {
  margin: 18px 0 0; padding: 18px 20px; border-left: 3px solid var(--teal);
  background: var(--surface); border-radius: 0 12px 12px 0;
}
.example .ex-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.example p { margin: 0; font-family: var(--text); }

table { width: 100%; margin: 20px 0 0; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); font-weight: 700; color: var(--muted); background: var(--surface-cool); }
.table-wrap { overflow-x: auto; }

figure.shot { margin: 26px auto 0; max-width: 300px; }
figure.shot img {
  width: 100%; height: auto; display: block; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface-cool);
}
figure.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }

/* Click-to-play YouTube embed. Nothing loads from YouTube until the visitor presses
   play (see /assets/js/video-embed.js); without JavaScript the link opens YouTube. */
.video { margin: 28px 0 0; }
.video-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; background: #0e100f;
  border: 1px solid var(--line);
}
.video-frame img, .video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover;
}
.video-frame .play {
  position: absolute; right: 4.5%; bottom: 7%; width: 68px; height: 68px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #121412;
  display: grid; place-items: center; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease;
}
.video-frame .play svg { width: 28px; height: 28px; margin-left: 4px; }
.video-frame:hover .play, .video-frame:focus-visible .play { transform: scale(1.06); }
.video-frame:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.video figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

.chapters { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 2px; }
.chapters li { margin: 0; }
.chapters a {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline;
  padding: 10px 14px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--ink); border-radius: 10px;
}
.chapters a:hover { border-color: var(--line-strong); }
.chapters .t { font-family: var(--mono); font-size: 14px; color: var(--teal); }

.transcript p { margin-top: 12px; }
.transcript .ts { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-right: 8px; }

/* Cards for the tutorials hub and "keep reading" lists. */
.cards { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.cards li { margin: 0; }
.cards a {
  display: block; padding: 20px 22px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.cards a:hover { border-color: var(--line-strong); }
.cards .kind {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal);
}
.cards strong {
  display: block; margin-top: 4px; font-family: var(--display); font-size: 19px;
  letter-spacing: -0.012em; line-height: 1.25;
}
.cards span.d { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }

.cta-card {
  margin: 52px 0 0; padding: 30px; border-radius: 16px;
  background: var(--charcoal); color: #f3f7f4;
}
.cta-card h2 { margin: 0; font-size: 24px; color: #f3f7f4; }
.cta-card p { color: rgba(243, 247, 244, 0.78); }
.cta-card a:not(.button) { color: #66d5ca; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 20px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px;
}
.button.primary { color: var(--charcoal); background: #f3f7f4; border: 1px solid #f3f7f4; }
.button.secondary { color: #f3f7f4; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.24); }

footer { padding: 42px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { width: min(1080px, calc(100vw - 48px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 620px) {
  :root { --wrap: calc(100vw - 32px); }
  .site-header { padding: 14px 16px; }
  .nav-links { display: none; }
  .footer-inner { width: calc(100vw - 32px); }
  .chapters a { grid-template-columns: 54px 1fr; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1110;
    --ink: #eceee8;
    --body: #c4c9c3;
    --muted: #99a09a;
    --line: #2a2e2a;
    --line-strong: #3b413b;
    --surface: #181b19;
    --surface-cool: #1b1f1d;
    --teal: #4fc4b8;
    --teal-soft: #163331;
    --clay: #d18a6c;
    --charcoal: #1c211e;
  }
  .site-header { background: rgba(15, 17, 16, 0.82); border-bottom-color: rgba(255, 255, 255, 0.08); }
  .cta-card { border: 1px solid var(--line); }
}
