/* The Lesson Dino blog. Same colours, fonts and buttons as the landing page (index.html), plus a calm,
   readable article layout: a narrow text column, a "On this page" list beside it on wide screens. */
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/AtkinsonHyperlegible-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/AtkinsonHyperlegible-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --tint: #fff5ea;
  --tint-2: #ffe8d1;
  --ink: #2b2622;
  --muted: #685e55;
  --line: #eadccd;
  --brand: #f76707;
  --accent-ink: #c2410c;
  --button: #d9480f;
  --button-hover: #bf3f0c;
  --on-button: #ffffff;
  --board: #1f3d33;
  --board-ink: #f1efe6;
  --board-chalk: #ffd8a8;
  --shadow: 0 1px 2px rgb(60 35 15 / 0.08), 0 12px 32px -12px rgb(60 35 15 / 0.22);

  --display: "Nunito", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.75rem, 1.35rem + 1.4vw, 2.25rem);
  --step-4: clamp(2.1rem, 1.5rem + 2.6vw, 3.25rem);
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --tint: #201a15; --tint-2: #2c2219; --ink: #f4ede6; --muted: #bcb0a4; --line: #3a3029;
    --brand: #ff8a2a; --accent-ink: #ffa45c; --button: #ff8a2a; --button-hover: #ffa04f; --on-button: #1c120a;
    --board: #1c382f; --board-ink: #eef0e6; --board-chalk: #ffc98a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -14px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --tint: #201a15; --tint-2: #2c2219; --ink: #f4ede6; --muted: #bcb0a4; --line: #3a3029;
  --brand: #ff8a2a; --accent-ink: #ffa45c; --button: #ff8a2a; --button-hover: #ffa04f; --on-button: #1c120a;
  --board: #1c382f; --board-ink: #eef0e6; --board-chalk: #ffc98a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -14px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: var(--step-0); line-height: 1.65; }
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--step-4); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 850; letter-spacing: -0.015em; }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 38em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg); color: var(--ink); padding: 8px 14px; z-index: 20; }
.skip:focus { left: 12px; }
.chip { display: inline-block; font-family: var(--display); font-weight: 800; font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; background: var(--tint-2); color: var(--accent-ink); text-decoration: none; }
a.chip:hover { background: var(--line); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: var(--step-0); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background-color 0.15s, transform 0.15s; }
.btn-primary { background: var(--button); color: var(--on-button); }
.btn-primary:hover { background: var(--button-hover); transform: translateY(-1px); }
.btn-quiet { color: var(--ink); border-color: var(--line); background: transparent; }
.btn-quiet:hover { border-color: var(--brand); }

/* Header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin-right: auto; white-space: nowrap; }
.brand img { width: 38px; height: 38px; }
.brand b { color: var(--brand); font-weight: 800; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--step--1); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent-ink); }
.site-head .btn { min-height: 42px; padding: 0 18px; font-size: var(--step--1); white-space: nowrap; }
.btn-login { color: var(--accent-ink); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.btn-login:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); transform: translateY(-1px); }
.btn-login .login-icon { flex: none; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.head-actions .short { display: none; }
@media (max-width: 760px) { .site-nav { display: none; } }
@media (max-width: 440px) { .site-head .wrap { gap: 12px; } .brand { font-size: 1.15rem; } .brand img { width: 32px; height: 32px; } .site-head .btn { padding: 0 14px; } .head-actions { gap: 8px; } .head-actions .long { display: none; } .head-actions .short { display: inline; } }
@media (max-width: 360px) { .site-head .wrap { gap: 8px; } .brand { gap: 8px; font-size: 1.05rem; } .site-head .btn { padding: 0 12px; } .login-icon { display: none; } }

/* Breadcrumbs */
.crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: var(--step--1); color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Blog home */
.blog-hero { padding-block: 48px 40px; background: linear-gradient(to bottom, var(--tint), var(--bg)); }
.blog-hero .wrap { display: grid; gap: 16px; }
.blog-hero .crumbs ol { margin-bottom: 0; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.blog-topic { padding-block: 36px; scroll-margin-top: 80px; }
.blog-topic h2 { font-size: var(--step-2); margin-bottom: 22px; }
.blog-join { padding-block: 40px 72px; }

/* Post cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post-card { display: grid; gap: 10px; align-content: start; }
.post-card-link { display: grid; gap: 10px; text-decoration: none; color: var(--ink); }
.post-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--tint); display: block; }
.post-card .chip { justify-self: start; }
.post-card h3 { font-size: var(--step-1); }
.post-card-link:hover h3 { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.post-card p { color: var(--muted); font-size: 0.98rem; }
.post-card .post-meta { font-size: var(--step--1); }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }

/* One post */
.post { padding-block: 36px 24px; }
.post-head { display: grid; gap: 16px; max-width: 48rem; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.post-head .chip { justify-self: start; }
.post-meta { color: var(--muted); font-size: var(--step--1); }
.post-layout { display: grid; grid-template-columns: 15rem minmax(0, 46rem); gap: 56px; align-items: start; }
.post-layout:not(:has(.toc)) { grid-template-columns: minmax(0, 46rem); }
.toc { position: sticky; top: 96px; font-size: var(--step--1); border-left: 3px solid var(--tint-2); padding-left: 16px; }
.toc-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc a { color: var(--ink); text-decoration: none; line-height: 1.35; display: block; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }
@media (max-width: 960px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { position: static; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--tint); }
}

.post-body { min-width: 0; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { font-size: var(--step-2); margin-top: 2em; scroll-margin-top: 90px; }
.post-body h3 { margin-top: 1.6em; scroll-margin-top: 90px; }
.post-body h2 + *, .post-body h3 + * { margin-top: 0.6em; }
.post-body ul, .post-body ol { padding-left: 1.4em; margin-bottom: 0; }
.post-body li + li { margin-top: 0.45em; }
.post-body li::marker { color: var(--accent-ink); font-family: var(--display); font-weight: 800; }
.post-body code { font-size: 0.92em; background: var(--tint); padding: 1px 5px; border-radius: 4px; }
.tip { background: var(--tint); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); background: var(--bg); }
.box > * + * { margin-top: 0.8em; }
.box-title { font-family: var(--display); font-weight: 800; font-size: var(--step-1); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--display); font-weight: 800; background: var(--tint); }
tbody th { font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }

.post-faq { margin-top: 2.4em; border-top: 1px solid var(--line); }
.post-faq h2 { margin-top: 1.2em; margin-bottom: 0.4em; }
.post-faq details { border-bottom: 1px solid var(--line); }
.post-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: "+"; color: var(--accent-ink); font-size: 1.4rem; line-height: 1; transition: transform 0.2s; }
.post-faq details[open] summary::after { transform: rotate(45deg); }
.post-faq details p { padding: 0 0 18px; color: var(--muted); }

/* "Try Lesson Dino" box */
.cta { display: flex; gap: 20px; align-items: flex-start; background: var(--board); color: var(--board-ink); border-radius: var(--radius); padding: 24px 26px; margin-top: 2em; }
.cta img { flex: none; background: #fff; border-radius: 14px; padding: 6px; }
.cta div { display: grid; gap: 10px; }
.cta p { color: #d5d9cf; }
.cta .cta-title { font-family: var(--display); font-weight: 850; font-size: var(--step-1); color: var(--board-chalk); line-height: 1.25; }
.cta .btn { justify-self: start; background: var(--board-chalk); color: #1c2a24; margin-top: 4px; }
.cta .btn:hover { background: #ffe3c4; }
@media (max-width: 560px) { .cta { flex-direction: column; } }

/* Related posts */
.related { padding-block: 48px 64px; background: var(--tint); margin-top: 48px; }
.related h2 { font-size: var(--step-2); margin-bottom: 24px; }
.all-posts { margin-top: 28px; font-weight: 700; }

/* Footer */
.site-foot { padding-block: 44px 28px; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.foot-about { display: grid; gap: 12px; align-content: start; max-width: 24rem; }
.site-foot nav { display: grid; gap: 8px; align-content: start; }
.foot-title { font-family: var(--display); font-weight: 800; color: var(--ink); }
.site-foot a { color: var(--muted); }
.site-foot .brand { font-size: 1.1rem; margin-right: 0; }
.site-foot .brand img { width: 30px; height: 30px; }
.foot-small { margin-top: 28px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* 404 page */
.lost { padding-block: 80px; text-align: center; }
.lost .wrap { display: grid; gap: 18px; justify-items: center; }
.lost img { width: 96px; height: 96px; }
.lost-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
