/* Shimmle shared site chrome (references/design/BRAND.md; layout system from SITE_REDESIGN.md "Field Map").
   Loaded by index.html (library), make.html (generator shell only) and the future create.html.
   Tokens are prefixed --pp-* because the generator's styles.css already owns --ink, --line and --muted
   for the worksheets; library.css maps the short names for the library pages. Every chrome rule here
   is hidden in print, so worksheet PDFs printed from make.html are unchanged. */

/* Atkinson Hyperlegible Next only ships a slashed zero, so digits 0-9 come from Andika inside the same
   family, with Atkinson's line metrics. Two weight bands keep bold digits bold. */
@font-face { font-family: "Atkinson Next"; src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 200 549; font-display: swap; unicode-range: U+0000-002F, U+003A-FFFF; }
@font-face { font-family: "Atkinson Next"; src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 550 800; font-display: swap; unicode-range: U+0000-002F, U+003A-FFFF; }
@font-face { font-family: "Atkinson Next"; src: url("fonts/andika-latin-regular.woff2") format("woff2"); font-weight: 200 549; font-display: swap; unicode-range: U+0030-0039; ascent-override: 98.4%; descent-override: 31.6%; line-gap-override: 0%; }
@font-face { font-family: "Atkinson Next"; src: url("fonts/andika-latin-bold.woff2") format("woff2"); font-weight: 550 800; font-display: swap; unicode-range: U+0030-0039; ascent-override: 98.4%; descent-override: 31.6%; line-gap-override: 0%; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans Arabic"; src: url("fonts/noto-sans-arabic-arabic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* section 4 palette; contrast checked by scripts/check-site-contrast.cjs. The second field tone is clearly
     lighter than the first (critic R1 fix 5), so a one-subject page reads as a patchwork, not a wall. */
  --pp-ground: #F4EDDC;
  --pp-paper: #FFFFFF;
  --pp-ink: #211C15;
  --pp-muted: #5A5145;
  --pp-line: #8A7F6A;
  --pp-sky: #CFE4EE;
  --pp-canola: #F4C52E;
  --pp-canola-deep: #E0AE0F;
  /* Shimmle names (BRAND.md section 6): same values, brand roles. Highlighter is the one brand colour;
     morning is the header/hero wash; desk is the page ground. The --pp-canola/--pp-sky/--pp-ground names stay for
     the existing rules. */
  --pp-highlight: var(--pp-canola);
  --pp-morning: var(--pp-sky);
  --pp-desk: var(--pp-ground);
  --pp-math: #A63D26;   --pp-math-field: #E6A08A; --pp-math-field-2: #F5D3C2;
  --pp-eng: #3F56B5;    --pp-eng-field: #A9B9F0;  --pp-eng-field-2: #D4DCF8;
  --pp-ar: #17704F;     --pp-ar-field: #8FCBAE;   --pp-ar-field-2: #C4E6D4;
  --pp-member: #673B9B;
  --pp-rule: 1.5px solid var(--pp-ink);
  --pp-sheet-shadow: 0 1px 0 rgba(33, 28, 21, .25), 0 10px 18px -8px rgba(33, 28, 21, .45);
  --pp-wrap: 1240px;
  --pp-gut: 24px;
  --pp-sans: "Atkinson Next", system-ui, sans-serif;
  --pp-display: "Fraunces", Georgia, serif;
  --pp-arabic: "Noto Sans Arabic", "Atkinson Next", sans-serif;
  /* pen strokes used as CSS backgrounds */
  --pp-wavy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5c12-3 22 2 38-1s26-2 40 1' fill='none' stroke='%23211C15' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --pp-tick-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 12'%3E%3Cpath d='M1.5 6.5c1.5 1 2.6 2.4 3.6 4 2-4 4.8-7 8.5-9' fill='none' stroke='%23A63D26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --pp-tick-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 12'%3E%3Cpath d='M1.5 6.5c1.5 1 2.6 2.4 3.6 4 2-4 4.8-7 8.5-9' fill='none' stroke='%23211C15' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 560px) { :root { --pp-gut: 16px; } }

.pp-wrap { max-width: var(--pp-wrap); margin: 0 auto; padding: 0 var(--pp-gut); }
.pp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--pp-paper); color: var(--pp-ink); border: var(--pp-rule); padding: 12px 16px; font: 700 16px var(--pp-sans); }
.pp-skip:focus { left: 8px; }

/* ---------- buttons: square, ruled; the primary one has a hard 3px ink offset ---------- */
.pp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 18px;
  border: var(--pp-rule); border-radius: 0; background: var(--pp-paper); color: var(--pp-ink);
  font: 700 15px/1.1 var(--pp-sans); text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.pp-btn svg { width: 20px; height: 20px; flex: none; }
.pp-btn:hover { background: #FBF7EC; }
.pp-btn-go { background: var(--pp-canola); box-shadow: 3px 3px 0 var(--pp-ink); }
.pp-btn-go:hover { background: var(--pp-canola); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--pp-ink); }
.pp-btn-go:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--pp-ink); }
.pp-btn-ink { background: var(--pp-ink); color: var(--pp-ground); }
.pp-btn-ink:hover { background: #3A3228; }
.pp-btn-quiet { background: transparent; border-color: transparent; text-decoration: underline; }
.pp-btn-quiet:hover { background: transparent; border-color: var(--pp-ink); }

/* ---------- header: the sky band, ending on the horizon rule ---------- */
.pp-hdr { position: relative; z-index: 40; background: var(--pp-sky); border-bottom: var(--pp-rule); color: var(--pp-ink); font-family: var(--pp-sans); }
.pp-hdr :focus-visible, .pp-ftr :focus-visible { outline: 3px solid var(--pp-ink); outline-offset: 2px; }
.pp-ftr :focus-visible { outline-color: var(--pp-canola); }
.pp-hrow { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.pp-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; min-height: 44px; color: inherit; text-decoration: none; font: 800 23px/1 var(--pp-display); letter-spacing: -.02em; white-space: nowrap; }
.pp-logo .pp-mark { width: 30px; height: 36px; flex: none; transform: rotate(-2deg); }
/* the wordmark: the name (live text from site-config.js) and one pen wave under the flourish letters (the first
   doubled letter; scripts/brand-mark.cjs flourishSpan), so a rename moves the wave instead of breaking it */
.pp-word { display: inline-block; padding-bottom: 2px; }
.pp-flo { position: relative; display: inline-block; }
.pp-logo .pp-shim { position: absolute; left: -8%; width: 116%; bottom: -7px; height: 7px; overflow: visible; }
.pp-ftr .pp-shim { color: var(--pp-highlight); }
/* small screens: the full name stays on one line and shrinks to fit beside the menu icon */
@media (max-width: 760px) {
  .pp-hdr .pp-logo { font-size: clamp(15px, 4.6vw, 23px); gap: 6px; min-width: 0; }
  .pp-hdr .pp-logo .pp-mark { width: 24px; height: 29px; }
}
/* the menu button is the three-line icon only; the word stays for screen readers */
.pp-menu-btn .menu-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-search { display: flex; flex: 0 1 300px; min-width: 150px; height: 44px; border: var(--pp-rule); background: var(--pp-paper); }
.pp-search:focus-within { outline: 3px solid var(--pp-ink); outline-offset: 2px; }
.pp-search input { flex: 1; min-width: 0; border: 0; padding: 0 12px; background: none; color: var(--pp-ink); font: 400 16px var(--pp-sans); }
.pp-search input:focus { outline: none; }
.pp-search input::placeholder { color: var(--pp-muted); opacity: 1; }
.pp-search button { border: 0; border-left: var(--pp-rule); background: var(--pp-canola); color: var(--pp-ink); padding: 0 14px; font: 700 15px var(--pp-sans); cursor: pointer; }
.pp-search button:focus-visible { outline: 3px solid var(--pp-ink); outline-offset: -5px; }

.pp-nav { margin-left: auto; }
.pp-navlist { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 0; }
.pp-navlist > li { display: flex; }
.pp-navlink {
  position: relative; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  background: none; border: 0; color: var(--pp-ink); font: 600 15px/1.1 var(--pp-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.pp-navlink::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 8px; background: var(--pp-wavy) center / 100% 100% no-repeat; clip-path: inset(0 100% 0 0); transition: clip-path .2s ease-out; }
.pp-navlink[aria-current=page]::after, .pp-navlink[aria-expanded=true]::after, .pp-navlink:hover::after { clip-path: inset(0 0 0 0); }
.pp-navlink .pp-dot { display: inline-block; width: 11px; height: 11px; border: 1.5px solid var(--pp-ink); flex: none; }
.pp-navlink .pp-chev { width: 11px; height: 11px; flex: none; transition: transform .15s; }
.pp-navlink[aria-expanded=true] .pp-chev { transform: rotate(180deg); }
.pp-navlink [lang=ar] { font-family: var(--pp-arabic); font-size: 14px; font-weight: 500; }
.pp-navlink .pp-soon { font-size: 12px; font-weight: 600; color: var(--pp-muted); }
.pp-dot.math { background: var(--pp-math-field); } .pp-dot.english { background: var(--pp-eng-field); } .pp-dot.arabic { background: var(--pp-ar-field); }
.pp-menu-btn { display: none; margin-left: auto; }

/* ---------- footer: turned soil ---------- */
.pp-ftr {
  margin-top: 64px; padding: 48px 0 24px; color: var(--pp-ground); font: 400 15px/1.5 var(--pp-sans);
  background: var(--pp-ink) repeating-linear-gradient(176deg, transparent 0 26px, rgba(239, 230, 207, .08) 26px 27px);
}
.pp-ftr .pp-logo { color: var(--pp-ground); }
.pp-fgrid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.pp-ftr h2 { margin: 0 0 6px; color: var(--pp-canola); font: 700 12px/1.2 var(--pp-sans); letter-spacing: .11em; text-transform: uppercase; }
.pp-ftr ul { list-style: none; margin: 0; padding: 0; }
.pp-ftr li a { display: inline-flex; align-items: center; min-height: 40px; color: var(--pp-ground); text-decoration: none; }
.pp-ftr a:hover { text-decoration: underline; }
.pp-fgrid { grid-template-columns: 1.3fr 1.3fr 1fr 1fr; }
.pp-ftr .pp-fgrades { display: flex; flex-wrap: nowrap; gap: 0 2px; } /* the seven numerals stay on one row (site critic R2 fix 8) */
.pp-ftr .pp-fgrades a { justify-content: center; min-width: 36px; font: 800 22px/1 var(--pp-display); }
.pp-ftr p { margin: 10px 0 0; max-width: 34ch; color: #D9CFB6; font-size: 14px; }
.pp-fbase { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(239, 230, 207, .25); color: #D9CFB6; font-size: 13.5px; }
.pp-fbase p { margin: 0; max-width: none; }
.pp-ftr li a [lang=ar] { margin-left: .35em; }

@media (max-width: 1023px) {
  .pp-menu-btn { display: inline-flex; }
}
/* mid widths: keep "Topic or code" fully visible; tighten the nav instead of shrinking the search */
@media (min-width: 1024px) and (max-width: 1500px) {
  .pp-hrow { gap: 12px; }
  .pp-search { flex: 0 0 210px; min-width: 190px; }
  .pp-nav { flex: 1 1 0; min-width: 0; }
  .pp-navlist { flex-wrap: wrap; justify-content: flex-end; }
  .pp-navlink { padding: 0 6px; gap: 5px; font-size: 14.5px; }
}
@media (max-width: 1100px) {
  .pp-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .pp-fgrid > :first-child, .pp-fgrid > :nth-child(2) { grid-column: 1 / -1; }
}

/* ---------- foot strip: horizon A, the user-approved pen strip (as generated; CSS crop only), on the ground directly
   above the footer on every page except home. The bottom 7% is cropped so the drawn ground line lands on the
   footer's top edge: the drawing stands on the soil (site critic R2). ---------- */
.pp-fstrip { margin-top: 48px; }
.pp-fstrip + .pp-ftr { margin-top: 0; }
/* full bleed (site critic R3 fix 6): the drawn ground line runs edge to edge like the footer under it; capped at
   1920px so the strip never grows past ~210px tall */
.pp-fstrip .pp-fstrip-in { max-width: 1920px; margin: 0 auto; aspect-ratio: 2172 / 237; overflow: hidden; }
.pp-fstrip img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; } /* user-supplied beige version (F3ECDB, matches --pp-ground F4EDDC): no multiply/filter, which would darken it into a visible box */
body[data-route=""] .pp-fstrip, body[data-route=home] .pp-fstrip { display: none; }
body[data-route=home] .pp-ftr { margin-top: 64px; }
@media (max-width: 760px) {
  .pp-fstrip .pp-fstrip-in { aspect-ratio: auto; height: 84px; }
  .pp-fstrip img { height: 91px; object-position: 70% top; }
}
@media (max-width: 420px) {
  .pp-logo { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-btn, .pp-navlink::after, .pp-navlink .pp-chev { transition: none !important; }
  .pp-btn-go:hover, .pp-btn-go:active { transform: none; }
}
@media print {
  .pp-hdr, .pp-ftr, .pp-skip, .pp-fstrip { display: none !important; }
}
/* Reusable long-text page body (privacy, terms): readable measure, site fonts, solid ink text */
.pp-prose { max-width: calc(68ch + 2 * var(--pp-gut)); margin: 0 auto; padding: 40px var(--pp-gut) 24px; color: var(--pp-ink); font: 400 18px/1.65 var(--pp-sans); overflow-wrap: anywhere; }
.pp-prose h1 { margin: 0 0 12px; font: 800 clamp(2rem, 4.6vw, 3rem)/1.08 var(--pp-display); letter-spacing: -.02em; }
.pp-prose h2 { margin: 2rem 0 .5rem; font: 800 clamp(1.3rem, 2.6vw, 1.65rem)/1.2 var(--pp-display); letter-spacing: -.01em; }
.pp-prose p, .pp-prose ul, .pp-prose ol { margin: 0 0 1em; }
.pp-prose ul, .pp-prose ol { padding-left: 1.4em; }
.pp-prose li { margin: 0 0 .5em; }
.pp-prose a { color: var(--pp-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--pp-canola-deep); }
.pp-prose a:hover { background: var(--pp-canola); }
.pp-prose a:focus-visible { outline: 3px solid var(--pp-ink); outline-offset: 2px; }
@media (max-width: 560px) { .pp-prose { font-size: 17px; padding-top: 28px; } }
/* Local-only links: Drafts only in dev view; Videos only in dev view or once VIDEOS_HOSTED is true (site-config.js). */
html:not([data-dev-view]) [data-draft-only] { display: none !important; }
html:not([data-videos]) [data-videos-only] { display: none !important; }
