/*
  VOICE: patient and plainspoken, like a smart neighbor who never makes you feel slow (brand tone guide v1).
  IDEA: a well-made library how-to guide. Warm paper, dark ink, a marker circle around the exact thing to press.
  PICTURE: a phone drawn like a manual diagram, with the brand's orange marker circle around the Wi-Fi symbol.
  COLOUR and TYPE: brand palette (paper, ink, link blue, marker orange, highlighter). Source Serif 4 headlines, Atkinson Hyperlegible Next body.
  LAYOUT: one calm reading column, large targets, nothing that moves on its own.

  Brand values live in the variables below so the brand guide can change them in one place.
*/

@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); }

:root {
  --paper: #fbf7f0;
  --paper-2: #f2ebdd;
  --ink: #1f2430;
  --muted: #4a4f5c;
  --line: #d9d0bf;
  --blue: #1a4499;
  --marker: #c2410c;
  --hl: #ffe08a;
  --sage: #2f6b3a;
  --on-hl: #1f2430;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 36rem;
  --wide: 66rem;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17191e; --paper-2: #20232a; --ink: #f2eee6; --muted: #cdc8bd; --line: #3a3d45; --blue: #a7c0ff; --marker: #f08a4b;
  }
}
:root[data-theme="dark"] {
  --paper: #17191e; --paper-2: #20232a; --ink: #f2eee6; --muted: #cdc8bd; --line: #3a3d45; --blue: #a7c0ff; --marker: #f08a4b; color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Base size is 20px. The text size buttons scale everything, because every size is in rem. */
html { font-size: 125%; scroll-padding-top: 1rem; -webkit-text-size-adjust: 100%; }
html[data-size="115"] { font-size: 143.75%; }
html[data-size="130"] { font-size: 162.5%; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 1rem; line-height: 1.6; overflow-x: clip; }
img, svg { max-width: 100%; height: auto; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; font-weight: 600; text-wrap: balance; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 2.9rem); }
h2 { font-size: 1.55rem; margin-top: 1.6em; }
h3 { font-size: 1.2rem; }
p, ul, ol, dl { margin: 0 0 1em; }
strong { font-weight: 800; }

a { color: var(--blue); text-decoration-thickness: .1em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .18em; }
:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 8px var(--hl); border-radius: 4px; }
mark, .hl { background: linear-gradient(transparent 12%, var(--hl) 12%, var(--hl) 88%, transparent 88%); color: var(--on-hl); padding: 0 .12em; }

.skip { position: absolute; left: 1rem; top: -10rem; background: var(--hl); color: var(--on-hl);
  padding: .6rem 1rem; font-weight: 800; z-index: 10; }
.skip:focus { top: 1rem; }

.band { padding: clamp(2rem, 5vw, 4rem) max(5vw, 1rem); }
.band-tight { padding: 2rem 0; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 max(4vw, 1rem); }
.wrap-wide { max-width: var(--wide); margin: 0 auto; }
.band .wrap { padding: 0; }
.lede { font-size: 1.2rem; max-width: 34rem; }

/* Header */
.top { border-bottom: 2px solid var(--ink); background: var(--paper); }
.top-in { max-width: var(--wide); margin: 0 auto; padding: .9rem max(5vw, 1rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.6rem; }
.logo { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo img { width: 2.7rem; height: 2.7rem; }
.logo-words { display: flex; flex-direction: column; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.05; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.nav a { display: inline-block; padding: .55rem .1rem; font-weight: 700; color: var(--ink); text-decoration: none;
  border-bottom: 4px solid transparent; }
.nav a:hover { border-bottom-color: var(--hl); }
.nav a[aria-current="page"] { border-bottom-color: var(--marker); }
.size { display: flex; align-items: center; gap: .3rem; }
.size-label { font-size: .85rem; color: var(--muted); margin-right: .2rem; }
.size button { font: inherit; font-weight: 800; min-width: 2.4rem; min-height: 2.4rem; padding: 0 .4rem; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; line-height: 1; }
.size button.s2 { font-size: 1.15rem; }
.size button.s3 { font-size: 1.3rem; }
.size button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .6rem 1.3rem;
  font: inherit; font-weight: 800; border-radius: 999px; text-decoration: none; cursor: pointer; border: 3px solid var(--ink);
  background: var(--ink); color: var(--paper); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-line { background: transparent; color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* Hero */
.hero { border-bottom: 2px solid var(--ink); }
.hero-in { max-width: var(--wide); margin: 0 auto; display: grid; gap: 2rem 3rem; align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 3.7rem); line-height: 1.04; }
.hero .lede { max-width: 30rem; }
.hero-pic { justify-self: center; width: 100%; max-width: 32rem; }

/* The diagram keeps fixed colors so it reads the same in light and dark */
.diagram { display: block; width: 100%; }
.diagram .page { fill: #fffaf0; stroke: #1f2430; stroke-width: 2.5; }
.diagram .body { fill: #1f2430; }
.diagram .shade { fill: #1f2430; opacity: .14; }
.diagram .screen { fill: #fbf7f0; }
.diagram .edge { fill: none; stroke: #fff; stroke-opacity: .25; stroke-width: 2; }
.diagram .clock { font: 800 15px var(--font); fill: #1f2430; }
.diagram .wifi path { fill: none; stroke: #1f2430; stroke-width: 2.6; stroke-linecap: round; }
.diagram .fillink { fill: #1f2430; }
.diagram .batt { fill: none; stroke: #1f2430; stroke-width: 2; }
.diagram .ta { fill: #1a4499; }
.diagram .tb { fill: #ffe08a; stroke: #1f2430; stroke-width: 1.5; }
.diagram .tc { fill: #e6dfd0; }
.diagram .dock { fill: #eee6d6; }
.diagram .marker { fill: none; stroke: #c2410c; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.diagram .call circle { fill: #fffaf0; stroke: #1f2430; stroke-width: 3; }
.diagram .call path { stroke: #1f2430; stroke-width: 2.5; fill: none; }
.diagram .d-strong { font: 800 23px var(--font); fill: #1f2430; }
.diagram .d-sub { font: 400 21px var(--font); fill: #1f2430; }
.diagram .d-hl { fill: #ffe08a; }

/* Lists of questions */
.qlist { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); column-gap: 3rem; }
.qlist li { border-top: 2px solid var(--ink); padding: 1.2rem 0 1.4rem; }
.q-link { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.25; display: inline-block; margin-bottom: .5rem; }
.q-meta { color: var(--muted); font-size: .9rem; margin: 0; }
.soon { margin-top: 2rem; background: var(--paper-2); border-radius: var(--radius); padding: 1.3rem 1.5rem .4rem; }
.soon h3 { margin-bottom: .6rem; }
.soon ul { padding-left: 1.2rem; }

.rules { background: var(--paper-2); }
.rule-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 1.4rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.rule-list li { padding-left: 2.8rem; position: relative; }
.rule-list li::before { content: ""; position: absolute; left: 0; top: .1rem; width: 2rem; height: 1.7rem;
  background: url("../img/marker-check.svg") center / contain no-repeat; }
.rule-list strong { display: block; font-size: 1.15rem; margin-bottom: .2rem; }

.family { border-top: 2px solid var(--ink); }
.family-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.family-in > div { flex: 1 1 26rem; }
.family h2 { margin-top: 0; }

/* Signup */
.signup { background: #1f2430; color: #fbf7f0; padding: clamp(2.2rem, 5vw, 4rem) max(5vw, 1rem); }
.signup-in { max-width: 40rem; margin: 0 auto; }
.signup h2 { margin-top: 0; }
.signup label { display: block; font-weight: 800; margin: 1rem 0 .4rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.signup input { flex: 1 1 16rem; font: inherit; font-size: 1.1rem; min-height: 3.2rem; padding: .5rem 1rem;
  border: 3px solid #fbf7f0; border-radius: 10px; background: #fff; color: #1f2430; }
.signup .btn { background: var(--hl); color: var(--on-hl); border-color: var(--hl); }
.signup :focus-visible { outline-color: var(--hl); box-shadow: none; }
.signup-note { margin: .9rem 0 0; font-weight: 700; min-height: 1.6em; }

/* Page and article heads */
.page-head { border-bottom: 2px solid var(--ink); padding-bottom: 2rem; }
.page-head.family { background: var(--paper-2); border-top: 0; }
.page-body { padding-top: 2rem; padding-bottom: 3rem; }
.crumbs { font-size: .95rem; margin-bottom: 1rem; }
.meta { color: var(--muted); font-size: .95rem; margin: 0; }
.tag { background: var(--paper-2); color: var(--ink); padding: .1rem .5rem; border-radius: 6px; font-weight: 700; }
.article-head { border-bottom: 2px solid var(--ink); }
.article-body { padding-top: 2rem; padding-bottom: 3rem; }

/* The short answer opens every article */
.short { background: var(--hl); color: var(--on-hl); border-radius: var(--radius); padding: 1.2rem 1.4rem .2rem; margin-bottom: 2.2rem; }
.short h2 { margin: 0 0 .4rem; font-family: var(--font); font-weight: 800; font-size: 1.05rem; }
.short p { font-size: 1.15rem; }

/* The box for adult children and other helpers */
.helpers { border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.1rem 1.4rem .2rem; margin: 2rem 0; background: var(--paper-2); }
.helpers h2 { margin: 0 0 .5rem; font-size: 1.3rem; }

.prose { max-width: var(--measure); }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: .5em; }
.prose ol { padding-left: 1.6rem; }
.prose ol li::marker { font-weight: 800; }

.words, .sources { border-top: 2px solid var(--ink); margin-top: 2.5rem; padding-top: 1rem; }
.words h2, .sources h2 { margin-top: .4rem; font-size: 1.3rem; }
.words dl > div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.words dt { font-weight: 800; }
.words dd { margin: 0; }
.sources { font-size: .95rem; }

/* Articles index */
.topics { padding: 1rem max(5vw, 1rem) 3rem; }
.topic { border-top: 2px solid var(--ink); padding: 1.4rem 0 .6rem; }
.topic h2 { margin-top: 0; }
.topic-blurb { color: var(--muted); }
.alist { padding-left: 1.2rem; }
.alist li { margin-bottom: .6rem; }
.alist a { font-weight: 700; font-size: 1.1rem; margin-right: .5rem; }
.empty { color: var(--muted); font-style: italic; }
.tips h2 { margin-top: .5rem; }

/* Footer */
.foot { border-top: 2px solid var(--ink); padding: 2rem max(5vw, 1rem) 2.5rem; font-size: .95rem; }
.foot-in { max-width: var(--wide); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; }
.foot-in > div { flex: 1 1 20rem; max-width: 34rem; }
.foot-name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin-bottom: .3rem; }
.foot-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-pic { max-width: 26rem; }
}
@media (max-width: 600px) {
  .size-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }
@media print {
  .top .nav, .size, .signup, .skip { display: none; }
  a::after { content: " (" attr(href) ")"; font-size: .8em; }
}
