:root {
  color-scheme: light;
  --ink: #252438;
  --muted: #555467;
  --paper: #faf8f4;
  --card: #fffdfa;
  --line: #ded8e3;
  --accent: #514293;
  --lavender: #eee9fa;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 2; background: var(--card); padding: 9px 14px; transform: translateY(-200%); }
.skip:focus { transform: none; }
.wrap { width: min(1120px, calc(100% - 56px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.16rem; font-weight: 800; letter-spacing: -.055em; text-decoration: none; }
.brand img { flex-shrink: 0; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
nav a { text-decoration: none; font-size: .9rem; font-weight: 680; }
nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 36px; padding-block: 52px 55px; }
.eyebrow { color: var(--accent); font: 750 .71rem/1.4 ui-monospace, "Courier New", monospace; letter-spacing: .14em; }
.hero h1, .reading h1 { margin-top: 13px; font-size: clamp(2.85rem, 6.4vw, 5.45rem); font-weight: 850; letter-spacing: -.086em; line-height: 1; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-intro { max-width: 405px; margin-top: 18px; color: var(--muted); font-size: 1.15rem; }
.hero img { width: 100%; height: auto; border: 1px solid #d4c8eb; border-radius: 20px; }
.button { display: inline-flex; align-items: center; gap: 15px; margin-top: 22px; min-height: 46px; padding: 8px 15px; color: white; background: var(--accent); border-radius: 8px; font-weight: 750; text-decoration: none; }
.button:hover { background: #372c68; }
.library { background: #f1eef6; border-top: 1px solid var(--line); padding-block: 37px 48px; }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 25px; }
.library-head h2 { margin-top: 5px; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1; letter-spacing: -.07em; }
.topics { gap: 7px; }
.topics a { padding: 6px 12px; border: 1px solid #d5cce4; border-radius: 999px; background: var(--card); }
.guide-group { scroll-margin-top: 24px; }
.guide-group + .guide-group { margin-top: 24px; }
.guide-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; color: var(--muted); font-size: .93rem; }
.tag { display: inline-block; white-space: nowrap; padding: 4px 8px; border-radius: 5px; background: var(--lavender); color: #3f326b; font: 750 .72rem/1.3 ui-monospace, "Courier New", monospace; text-transform: uppercase; letter-spacing: .055em; }
.tag.devices { background: #dcecdf; color: #27523d; }
.tag.how-to { background: #f4e7cf; color: #6c4721; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; align-items: start; gap: 8px; min-height: 142px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.card h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.2; letter-spacing: -.035em; }
.card h3 a { text-decoration: none; }
.card h3 a:hover, .read:hover { text-decoration: underline; text-underline-offset: 3px; }
.card p { color: var(--muted); font-size: .95rem; }
.read, .back { margin-top: auto; color: var(--accent); font-size: .9rem; font-weight: 750; }
.read { text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); }
.footer-row { min-height: 74px; color: var(--muted); font-weight: 650; }
.reading { width: min(718px, calc(100% - 48px)); margin: 34px auto 55px; }
.reading h1 { font-size: clamp(2.4rem, 6.8vw, 4.25rem); }
.reading > .back { display: inline-block; margin-bottom: 19px; }
.reading .lede { margin-block: 15px 21px; color: var(--muted); font-size: 1.16rem; }
.reading h2 { margin-block: 23px 6px; letter-spacing: -.035em; font-size: 1.45rem; line-height: 1.25; }
.exercise { background: var(--lavender); border: 1px solid #ddd2ef; border-radius: 10px; margin-block: 25px 18px; padding: 13px 16px; }
.exercise h2 { margin-top: 0; font-size: 1.1rem; }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 34px); }
  .header-row { min-height: 62px; }
  .hero { grid-template-columns: 1fr; padding-block: 27px 34px; gap: 22px; }
  .hero h1 { font-size: clamp(2.7rem, 11vw, 4.1rem); }
  .hero img { border-radius: 13px; }
  .library { padding-block: 27px 36px; }
  .library-head { align-items: start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
}
@media (max-width: 370px) {
  nav { gap: 12px; }
  .brand { font-size: 1rem; }
  .brand img { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
