/* Scryve Learn. Layout of the guide; the design tokens are in tokens.css (from the app). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/lora-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("../fonts/lora-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

/* Colours, radius and fonts come from the app: css/tokens.css is made at build time from
   client/src/index.css. Only what the app has no token for is set here. */
:root { --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--background)); }

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.65;
  overflow-wrap: break-word; min-height: 100vh; display: flex; flex-direction: column;
}
[id] { scroll-margin-top: 5rem; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -4rem; background: var(--primary); color: var(--primary-foreground); padding: 0.5rem 0.9rem; border-radius: var(--radius); z-index: 50; }
.skip:focus { top: 0.5rem; }

/* header */
/* Header, edges and logo as the app's (docs/design/README.md, section 3): 56 px then 64 px from
   640 px, max 80rem with 16, 24, 32 px edges, logo 20 px then 24 px. */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--background) 95%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top-in { max-width: 80rem; margin: 0 auto; padding: 0 1rem; min-height: 3.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.brand { font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; line-height: 1.75rem; letter-spacing: -0.01em; color: var(--foreground); text-decoration: none; white-space: nowrap; }
@media (min-width: 640px) { .top-in { min-height: 4rem; padding: 0 1.5rem; } .brand { font-size: 1.5rem; line-height: 2rem; } }
@media (min-width: 1024px) { .top-in { padding: 0 2rem; } }
.brand .dot { color: var(--primary); }
.brand-sub { font-family: var(--font-sans); font-weight: 500; font-size: 0.9rem; color: var(--muted-foreground); margin-left: 0.15rem; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.4rem; min-width: 0; }
.chip { font: inherit; font-size: 0.85rem; line-height: 1; padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--foreground); text-decoration: none; cursor: pointer; min-height: 2.25rem; display: inline-flex; align-items: center; }
.chip:hover { border-color: var(--primary); }
.chip.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
/* Header icons as the app's ghost icon buttons: lucide strokes, 20 px, 36 px round target. */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-width: 2.25rem; height: 2.25rem; padding: 0 0.5rem; border: 0; border-radius: 999px; background: transparent; color: var(--foreground); font: inherit; font-size: 0.8rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--muted); }
.icon-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ico { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
}

/* shell */
.shell { flex: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
main { min-width: 0; padding: 1.25rem 0 3rem; outline: none; }
.side { padding-top: 1rem; }
.menu > summary { list-style: none; cursor: pointer; padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-weight: 500; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { margin-bottom: 0.75rem; }
.menu-body { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 0.75rem; }
.all { display: block; font-weight: 600; margin: 0.5rem 0 0.25rem; }
.grp { margin-top: 0.4rem; }
.grp > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 0.35rem 0; }
.grp ul { list-style: none; margin: 0 0 0.4rem; padding: 0 0 0 0.6rem; border-left: 2px solid var(--border); }
.grp li a { display: block; padding: 0.3rem 0.5rem; font-size: 0.9rem; color: var(--muted-foreground); text-decoration: none; border-radius: 6px; }
.grp li a:hover { color: var(--foreground); background: var(--muted); }
.grp li a[aria-current="page"] { color: var(--primary); font-weight: 600; background: var(--primary-soft); }

/* search */
.search input { width: 100%; font: inherit; font-size: 1rem; padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground); }
.results { margin-top: 0.4rem; }
.results a { display: block; padding: 0.5rem 0.4rem; border-radius: 6px; text-decoration: none; color: var(--foreground); }
.results a:hover { background: var(--muted); }
.results strong { display: block; }
.results small { display: block; color: var(--muted-foreground); }
.results .none { color: var(--muted-foreground); padding: 0.5rem 0.4rem; }

/* article */
.doc { max-width: 54rem; }
.crumb { font-size: 0.85rem; color: var(--muted-foreground); margin: 0 0 0.5rem; }
.crumb a { color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.25; letter-spacing: -0.01em; }
/* The app's .page-title. */
h1 { font-size: clamp(2rem, 1.55rem + 1.9vw, 3rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 0.6rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }
.anchor { margin-left: 0.4rem; font-family: var(--font-sans); font-size: 0.8em; color: var(--muted-foreground); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.lede { font-size: 1.15rem; color: var(--muted-foreground); margin: 0 0 1rem; }
.note { background: var(--muted); border-left: 3px solid var(--primary); padding: 0.6rem 0.9rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; }
.prose p, .prose li { max-width: 42rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose li::marker { color: var(--muted-foreground); }
.prose blockquote { margin: 1.2rem 0; padding: 0.7rem 1rem; background: var(--primary-soft); border-left: 3px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote p { margin: 0.3rem 0; }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--muted); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: var(--muted); padding: 0.9rem 1rem; border-radius: var(--radius); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 40rem) {
  .table-wrap { border: 0; overflow: visible; margin: 1rem 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  thead tr { padding: 0; margin: 0; border: 0; }
  thead th { display: block; width: 1px; padding: 0; border: 0; }
  tr { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin: 0 0 0.7rem; padding: 0.3rem 0; }
  td { border: 0; padding: 0.3rem 0.8rem; }
  td::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); }
  td:first-child { font-weight: 600; padding-top: 0.45rem; }
  td:first-child::before { display: none; }
}
.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 1rem; margin: 1rem 0 1.5rem; font-size: 0.93rem; }
.toc ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.checked { font-size: 0.85rem; color: var(--muted-foreground); margin-top: 2.5rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.2rem; }
.pager a { display: block; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--foreground); background: var(--card); }
.pager a:hover { border-color: var(--primary); }
.pager span { display: block; font-size: 0.78rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }

/* landing */
.landing h1 { margin-top: 0.5rem; }
.small { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); margin: 1.6rem 0 0.6rem; }
.start { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.start-link { display: block; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--foreground); }
.start-link:hover { border-color: var(--primary); }
.start-link strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; }
.start-link span { display: block; font-size: 0.9rem; color: var(--muted-foreground); }
.cards { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin-top: 1.5rem; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 1rem 1.1rem; }
.card h2 { font-size: 1.2rem; margin: 0 0 0.2rem; }
.card p { margin: 0 0 0.5rem; color: var(--muted-foreground); font-size: 0.93rem; }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li a { display: block; padding: 0.25rem 0; text-decoration: none; }
.card li a:hover { text-decoration: underline; }

.foot { border-top: 1px solid var(--border); padding: 1.2rem 0 2rem; color: var(--muted-foreground); font-size: 0.85rem; }
.foot p, .foot-links { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-bottom: 0.75rem; }
.foot-links a { color: var(--muted-foreground); text-decoration: none; }
.foot-links a:hover { color: var(--foreground); }
@media (min-width: 640px) { .shell, .foot p, .foot-links { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .shell, .foot p, .foot-links { padding: 0 2rem; } }

@media (min-width: 62rem) {
  .shell { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
  .side { position: sticky; top: 4.2rem; align-self: start; max-height: calc(100vh - 5rem); overflow-y: auto; padding-top: 1.25rem; }
  .menu > summary { display: none; }
  .menu .menu-body { border: 0; background: none; padding: 0; }
  .is-landing .side { display: block; }
  .start { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 62rem) { .menu:not([open]) .menu-body { display: block; } }
@media (max-width: 24rem) { .chip { padding: 0.55rem 0.6rem; font-size: 0.8rem; } .top-actions { gap: 0.3rem; } .top-in { gap: 0.4rem; } .brand { font-size: 1.2rem; } }
@media (max-width: 30rem) { .brand-sub { display: none; } .pager { grid-template-columns: 1fr; } .pager .next, .pager .prev { grid-column: 1; text-align: left; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .top, .side, .pager, .foot, .anchor, .skip { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } }
