/* Shared styles for the static tutorial pages. Colors match the app (indigo #4F46E5 on #E0E7FF). */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-tint: #e0e7ff;
  --brand-soft: #eef2ff;
  --ink: #1a1a1a;
  --body: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --page: #f5f7ff;
  --tip-bg: #ecfdf5;
  --tip-line: #a7f3d0;
  --tip-ink: #065f46;
  --note-bg: #fffbeb;
  --note-line: #fde68a;
  --note-ink: #92400e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* --- Top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brand-tint);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
}
.brand-sub { color: var(--muted); font-weight: 600; }
.topbar-links { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.topbar-links a {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
}
.topbar-links a.ghost:hover { background: var(--brand-soft); }
.topbar-links a.solid { background: var(--brand); color: #fff; }
.topbar-links a.solid:hover { background: var(--brand-dark); color: #fff; }

@media (max-width: 560px) {
  .brand-sub, .topbar-links a.ghost { display: none; }
}

/* --- Layout --- */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.hero {
  background: linear-gradient(180deg, var(--brand-tint), var(--page));
  padding: 48px 0 32px;
}
.crumbs { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
h1 {
  color: var(--ink);
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 900;
  margin: 0 0 14px;
}
.lede { font-size: 19px; color: var(--body); margin: 0 0 18px; max-width: 720px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
/* Labels (who a tutorial is for, which plan): flat, so they don't look clickable */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  color: #4b5563;
}
/* Links styled as buttons */
.pill-link {
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--brand-tint);
  color: var(--brand-dark);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.pill-link:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* --- Contents --- */
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 8px 0 32px;
}
.toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin: 2px 0; }
.toc a { text-decoration: none; font-weight: 600; }

/* --- Steps --- */
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 26px 22px;
  margin-bottom: 24px;
  scroll-margin-top: 80px;
}
.step h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  transform: translateY(-2px);
}
.step p { margin: 0 0 12px; }
.step ul, .step ol { margin: 0 0 12px; padding-left: 22px; }
.step li { margin: 4px 0; }
.step strong { color: var(--ink); }
.step h3 { color: var(--ink); font-size: 17px; margin: 18px 0 6px; }

.ui {
  font-weight: 700;
  color: var(--ink);
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: 6px;
  padding: 0 6px;
  white-space: nowrap;
}

figure { margin: 18px 0 8px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px -12px rgba(67, 56, 202, 0.25);
  background: #fff;
}
figure.narrow img { max-width: 440px; margin: 0 auto; }
.shot-missing {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 16px;
  border: 2px dashed var(--brand-tint);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.card .shot-missing { min-height: 0; aspect-ratio: 16 / 9; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 10px; }

.callout {
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 16px;
  border: 1px solid;
}
.callout p:last-child { margin-bottom: 0; }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-line); color: var(--tip-ink); }
.callout.note { background: var(--note-bg); border-color: var(--note-line); color: var(--note-ink); }
.callout strong { color: inherit; }

/* --- Prev / next --- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0 16px;
}
.pager a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}

/* --- Index grid --- */
.group { margin: 36px 0 12px; }
.group h2 { color: var(--ink); font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
.group p { margin: 0 0 16px; color: var(--muted); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--body);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--brand);
  color: var(--body);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(67, 56, 202, 0.35);
}
.card img {
  display: block;
  width: 100%;
  /* Overrides the height attribute so aspect-ratio can shape the thumbnail */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid var(--line);
  background: var(--brand-soft);
}
.card-body { padding: 16px 18px 18px; }
.card h3 { color: var(--ink); font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 15px; line-height: 1.55; }

/* --- Footer --- */
.footer {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--brand-tint);
  background: #fff;
  font-size: 14px;
  color: var(--muted);
}
.footer .wrap-wide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer a { text-decoration: none; margin-left: 16px; color: var(--muted); }
.footer a:first-child { margin-left: 0; }
.footer a:hover { color: var(--brand); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 32px 0 24px; }
  .step { padding: 20px 16px 16px; border-radius: 16px; }
  .step h2 { font-size: 20px; }
}
