/* ==========================================================================
   LoWisa guide pages (/learn/*, /about/, /roadmap/, /changelog/).

   Palette: the same Apple tokens the marketing site already uses, and nothing
   else. White and #f5f5f7 grounds, #1d1d1f ink, #6e6e73 and #86868b for
   secondary text, one blue (#0071e3) for every action, #e5e5ea hairlines.
   No second accent, no gradient, no colour that is not in this list.

   Self-contained on purpose: these pages do not load styles.css, so nothing
   here can collide with the home page's cascade.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-muted: #fbfbfd;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e8f2ff;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --shadow-sm: 0 8px 30px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 16px 50px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --measure: 72ch;
}

html { box-sizing: border-box; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(14px);
}
.nav {
  width: min(100% - 40px, 1120px);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; overflow: hidden; border-radius: 11px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav-links a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.nav-links .nav-download {
  background: var(--blue);
  color: #ffffff;
  padding: 9px 18px;
}
.nav-links .nav-download:hover { background: var(--blue-hover); }

/* The menu button (narrow screens only). A checkbox drives it so these pages stay script-free. */
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.nav-burger span { width: 18px; height: 2px; background: var(--ink); border-radius: 999px; }
.nav-toggle:focus-visible ~ .nav-burger { outline: 2px solid var(--blue); outline-offset: 3px; }
.nav { position: relative; }

/* The About menu: hover for a mouse, focus for a keyboard, always open inside the phone nav. */
.nav-menu { position: relative; display: inline-flex; }
.nav-menu-trigger { display: inline-flex; align-items: center; gap: 6px; }
.nav-caret {
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.55;
}
.nav-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 288px;
  margin-top: 10px;
  padding: 14px 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 40;
}
.nav-panel::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.nav-menu:hover .nav-panel,
.nav-menu:focus-within .nav-panel { opacity: 1; visibility: visible; pointer-events: auto; }
.nav-panel-title {
  margin: 6px 12px 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.nav-panel a:hover { background: var(--bg-soft); color: var(--blue); text-decoration: none; }

/* ---------------------------------------------------------------- page shell */
.page { width: min(100% - 40px, 760px); margin: 0 auto; padding: 28px 0 64px; }

.crumbs { font-size: 14px; color: var(--ink-3); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); margin-right: 8px; }
.crumbs a { color: var(--ink-2); }

.page-head { padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}
.lede { margin: 0 0 16px; font-size: 19px; line-height: 1.62; color: var(--ink-2); max-width: var(--measure); }
.stamp { margin: 18px 0 0; font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- contents */
.toc {
  margin: 26px 0 0;
  padding: 18px 22px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.toc-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { margin: 0; padding-left: 20px; color: var(--ink-2); }
.toc li { margin: 5px 0; }
.toc a { color: var(--ink); }

/* ---------------------------------------------------------------- prose */
.prose { max-width: var(--measure); }
.prose-section { padding-top: 36px; scroll-margin-top: 90px; }
.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance;
}
.prose h3 { margin: 26px 0 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.prose p { margin: 0 0 16px; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
.prose li { margin: 8px 0; }
.prose ol.steps { list-style: decimal; }
.prose ol.steps li { margin: 12px 0; }

.prose code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--ink);
}
pre.code {
  margin: 0 0 20px;
  padding: 18px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.62;
}
pre.code code { background: none; border: 0; padding: 0; }

.note {
  margin: 0 0 20px;
  padding: 16px 20px;
  background: var(--blue-soft);
  border-radius: 14px;
}
.note p { margin: 0; color: var(--ink); }

blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
}
blockquote p { margin: 0; }

.table-wrap { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; color: var(--ink); white-space: nowrap; }
td { color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- questions */
.qa {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg);
}
.qa summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
.qa[open] summary::after { content: "\2013"; }
.qa p { margin: 12px 0 2px; color: var(--ink-2); }

/* ---------------------------------------------------------------- call to action */
.cta-panel {
  margin: 46px 0 0;
  padding: 34px;
  background: var(--bg-soft);
  border-radius: 26px;
  text-align: center;
}
.cta-panel h2 { margin: 0 0 10px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.cta-panel p { margin: 0 auto 20px; max-width: 52ch; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.btn:hover { text-decoration: none; background: var(--bg-muted); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.btn.primary:hover { background: var(--blue-hover); }

/* ---------------------------------------------------------------- related */
.related { margin: 46px 0 0; }
.related h2 { margin: 0 0 16px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.related-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.related-card:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.related-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.related-title { font-weight: 700; letter-spacing: -0.01em; }
.related-line { font-size: 14px; color: var(--ink-3); }

/* ---------------------------------------------------------------- footer */
.site-footer {
  margin-top: 70px;
  padding: 46px 0 34px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.foot-cols {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.foot-cols p { color: var(--ink-2); font-size: 14px; max-width: 40ch; }
.foot-title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.foot-cols nav { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.foot-cols nav a { color: var(--ink-2); }
.foot-cols nav a:hover { color: var(--blue); }
.copyright { width: min(100% - 40px, 1120px); margin: 30px auto 0; font-size: 13px; color: var(--ink-3); }

@media (max-width: 700px) {
  body { font-size: 16px; }
  /* Folded away until the reader asks for it: the header stays one row high, and the article
     starts where it should. Opened, the list scrolls instead of pushing the page down. */
  .nav-burger { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { text-align: center; min-height: 42px; display: flex; align-items: center; justify-content: center; }
  .nav-menu { display: block; width: 100%; }
  .nav-caret { display: none; }
  .nav-panel {
    position: static;
    transform: none;
    min-width: 0;
    margin: 0;
    padding: 2px 0 6px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-panel::before { display: none; }
  .nav-panel a { padding: 7px 10px; font-size: 14px; }
  .nav { min-height: 64px; padding: 10px 0; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 7px 10px; font-size: 14px; }
  .cta-panel { padding: 26px 20px; }
}

@media print {
  .site-header, .toc, .cta-panel, .related, .site-footer { display: none; }
  body { font-size: 12pt; }
  .page { width: auto; }
}
