/* Dune Scholars site styles. Plain CSS, no build step.
   Layout: single 1100px column; header and footer shared by every page.
   Logical properties (inline/block) are used throughout so an Arabic, right-to-left
   version only needs <html lang="ar" dir="rtl">. */
/* Colour tokens: "scholar + tech". Roles, not colour names; values and contrast are in DESIGN.md.
   Light mode = parchment canvas, midnight header/footer, burnished gold for buttons and highlights.
   Dark mode  = midnight canvas, slate panels, gold highlights. */
:root {
  --bg: #FBF7EE;            /* parchment canvas */
  --surface: #FFFDF8;       /* cards, form panels */
  --ink: #0B1B3D;           /* body text, outline buttons */
  --heading: #0B1B3D;
  --muted: #5A5446;         /* secondary text (7.0:1 on parchment) */
  --line: #E6DCC6;          /* borders, dividers (decorative) */
  --field-line: #8A7F67;    /* form field borders (3.9:1) */
  --logo-tile: #16324F;     /* logo tile in the header, so it stands out from --chrome */
  --accent: #C9A24A;        /* burnished gold: buttons, highlights, markers (never small text on parchment) */
  --accent-soft: #F3E7C8;   /* tag and icon backgrounds, hovers */
  --on-accent: #0B1B3D;     /* text on --accent (7.1:1) */
  --link: #7A5A1E;          /* bronze: links and status tags (5.9:1) */
  --eyebrow: #7A5A1E;       /* small uppercase labels */
  --focus: #0B1B3D;         /* focus ring on light backgrounds */
  --chrome: #0B1B3D;        /* header and footer */
  --chrome-ink: #F4ECDA;
  --chrome-muted: #D8CDB4;
  --chrome-line: #22314F;
  --panel: #0B1B3D;         /* call-to-action box */
  --panel-ink: #F4ECDA;
  --badge: #0B1B3D;
  --on-badge: #F4ECDA;
  --sky: #F3ECDD;           /* hero background */
  --grid: rgba(122, 90, 30, 0.09);   /* hero grid lines */
  --card-line: #E2CF9E;              /* thin gold-tinted card borders (decorative) */
  --contour-1: #E6DCC6; --contour-2: #D9C69B; --contour-3: #C9A24A; --contour-4: #8C6A2E; /* hero contour lines, stars */
  --glow: rgba(212, 175, 90, 0.28);
  --f-display: 'Cinzel', 'Readex Pro', 'IBM Plex Sans Arabic', Georgia, serif; /* h1, h2, wordmark; Readex Pro covers Arabic */
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;  /* labels, tags, badges */
  --f-body: 'IBM Plex Sans', 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A192F;
    --surface: #112240;
    --ink: #E9E2D0;
    --heading: #F4ECDA;
    --muted: #B5AC97;
    --line: #2D3748;
    --field-line: #8A9A9A;
    --logo-tile: #0B1B3D;
    --accent: #D4AF5A;
    --accent-soft: #2A2F3E;
    --on-accent: #0A192F;
    --link: #D4AF5A;
    --eyebrow: #D4AF5A;
    --focus: #D4AF5A;
    --chrome: #112240;
    --chrome-ink: #F4ECDA;
    --chrome-muted: #B5AC97;
    --chrome-line: #2D3748;
    --panel: #112240;
    --panel-ink: #F4ECDA;
    --badge: #F4ECDA;
    --on-badge: #0A192F;
    --sky: #0D1F3A;
    --grid: rgba(212, 175, 90, 0.08);
    --card-line: rgba(212, 175, 90, 0.3);
    --contour-1: #1C2D4A; --contour-2: #2D3748; --contour-3: #5C4A26; --contour-4: #D4AF5A;
    --glow: rgba(212, 175, 90, 0.28);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
:lang(ar) body, body:lang(ar) { line-height: 1.8; }
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--heading); font-family: var(--f-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap {
  max-width: 1100px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--eyebrow);
}
.lede { color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Header ---------- */
.site-header { border-block-end: 1px solid var(--chrome-line); background: var(--chrome); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--chrome-ink); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; }
.brand svg { width: 38px; height: 38px; flex: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav a { color: var(--chrome-ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.12); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--accent); }
.lang { font-size: 0.9rem; color: var(--chrome-muted); padding-inline-start: 8px; border-inline-start: 1px solid var(--chrome-line); margin-inline-start: 4px; }
.lang small { font-size: 0.75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--f-display);
  padding: 14px 22px; border-radius: 999px;
  border: 2px solid var(--ink); color: var(--ink); background: transparent;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { background: var(--sky); overflow: hidden; }
.hero .wrap { padding-block: clamp(48px, 9vw, 96px) 0; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { max-width: 16ch; }
.dunes { width: 100%; height: clamp(90px, 16vw, 170px); margin-block-start: clamp(24px, 5vw, 48px); }
.dunes .d1 { fill: var(--dune-1); }
.dunes .d2 { fill: var(--dune-2); }
.dunes .d3 { fill: var(--dune-3); }
.dune-wrap { position: relative; }
.dune-wrap .sun {
  position: absolute; inset-inline-end: 18%; top: 4%;
  width: clamp(36px, 6vw, 72px); aspect-ratio: 1; border-radius: 50%;
  background: var(--accent);
}
.page-head { padding-block: clamp(40px, 7vw, 72px) clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 14px; }

/* ---------- Sections ---------- */
section.band { padding-block: clamp(40px, 7vw, 72px); }
section.band + section.band { padding-block-start: 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-block-end: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.point { border-block-start: 3px solid var(--accent); padding-block-start: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.point p { color: var(--muted); }
.prose { max-width: 66ch; display: flex; flex-direction: column; gap: 16px; }
.prose p { color: var(--ink); }
.prose ul { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.prose li::marker { color: var(--accent); }

/* ---------- Game cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.card-art { aspect-ratio: 16 / 10; width: 100%; max-width: 100%; background: #0A1013; display: grid; place-items: center; overflow: hidden; position: relative; }
.card-art img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-art.soon { background: linear-gradient(180deg, var(--sky), var(--accent-soft)); }
.card-art .digits { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.4rem, 7vw, 4rem); color: var(--link); letter-spacing: 0.08em; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { color: var(--muted); }
.card-body .actions { margin-block-start: auto; padding-block-start: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.78rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.badge { position: absolute; inset-block-start: 14px; inset-inline-start: 14px; background: var(--badge); color: var(--on-badge); font: 600 0.78rem/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; padding: 7px 11px; border-radius: 999px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
.mail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.mail-addr { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; word-break: break-all; user-select: all; }
form.contact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.hint { font-size: 0.88rem; color: var(--muted); }
.hidden-field { position: absolute; inset-inline-start: -9999px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--chrome); border-block-start: 1px solid var(--chrome-line); margin-block-start: clamp(40px, 7vw, 72px); }
.site-footer .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; color: var(--chrome-muted); font-size: 0.92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.site-footer nav a { padding-block: 8px; }
.site-footer a { color: var(--chrome-ink); }

@media (max-width: 760px) {
  .grid-3, .cards, .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .nav { gap: 4px 2px; }
  .nav a { padding: 10px 9px; }
}
@media (max-width: 480px) {
  .nav a { padding: 10px 8px; }
  .lang { padding-inline-start: 6px; margin-inline-start: 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a { transition: background-color 0.15s ease; }
}

.more-soon { margin-block-start: 22px; color: var(--muted); }
.more-soon b { color: var(--heading); }
/* Prose inside the page wrapper: align with the page heading, keep lines readable. */
.wrap.prose { max-width: 1100px; }
.wrap.prose > * { max-width: 66ch; }

/* ---------- For teachers and schools ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack-tight { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.tools { display: flex; flex-direction: column; border-block-start: 1px solid var(--line); }
.tool {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 40px;
  padding-block: 28px; border-block-end: 1px solid var(--line);
}
.tool-head { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.tool-head h3 { font-size: clamp(1.35rem, 2.6vw, 1.6rem); }
.tool-pitch { color: var(--muted); font-size: 1.08rem; max-width: 36ch; }
.tool-icon {
  width: 44px; height: 44px; padding: 9px; border-radius: 12px;
  background: var(--accent-soft); color: var(--ink); border: 1px solid var(--card-line);
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.tool-feats { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 10px; align-self: center; }
.tool-feats li::marker { color: var(--accent); }
.tag.status { background: transparent; border: 1px solid var(--link); color: var(--link); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 40px; align-items: start; }
.split .prose { gap: 14px; }
.cta {
  background: var(--panel); color: var(--panel-ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 20px 32px;
  align-items: center; justify-content: space-between;
}
.cta .stack { max-width: 56ch; gap: 8px; }
.cta p { color: inherit; opacity: 0.85; }
.cta h2 { color: var(--panel-ink); }
.cta :focus-visible { outline-color: var(--accent); } /* gold on the midnight/slate panel: 7.0:1 or more */
/* Home: compact tool list */
.tool-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; border-block-start: 1px solid var(--line); }
.tool-mini a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start;
  padding-block: 18px; border-block-end: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.tool-mini .tool-icon { grid-row: span 2; width: 40px; height: 40px; padding: 8px; }
.tool-mini b { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; }
.tool-mini span { color: var(--muted); }
.tool-mini a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.section-foot { margin-block-start: 22px; }
@media (max-width: 760px) {
  .tool, .split, .tool-mini { grid-template-columns: minmax(0, 1fr); }
  .tool { padding-block: 24px; }
}

/* ---------- Tech layer: mono labels, hero grid + contour lines, dashboard cards, glow (dark only) ---------- */
h1 { letter-spacing: -0.02em; }
/* monospace labels */
.eyebrow, .tag, .badge, .lang small { font-family: var(--f-mono); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.1em; }
.tag { font-size: 0.75rem; border-radius: 6px; padding: 4px 8px; }
.badge { border-radius: 6px; font-size: 0.75rem; }
.tag.status { display: inline-flex; align-items: center; gap: 6px; }
.tag.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* hero: faint grid + contour-line dunes that draw in once */
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 75% 45%, #000 35%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 90% at 75% 45%, #000 35%, transparent 80%); }
.contours { width: 100%; height: clamp(90px, 16vw, 170px); margin-block-start: clamp(24px, 5vw, 48px); overflow: visible; }
.contours path { fill: none; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.contours .c1 { stroke: var(--contour-1); } .contours .c2 { stroke: var(--contour-2); }
.contours .c3 { stroke: var(--contour-3); } .contours .c4 { stroke: var(--contour-4); stroke-width: 2.5; }
.contours circle { fill: var(--contour-4); }
.dune-wrap .sun { background: var(--accent); }
@media (prefers-color-scheme: dark) {
  .contours .c4 { filter: drop-shadow(0 0 6px rgba(212, 175, 90, 0.6)); }
  .dune-wrap .sun { box-shadow: 0 0 0 8px rgba(212, 175, 90, 0.12), 0 0 40px rgba(212, 175, 90, 0.4); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: ds-fade 1.6s ease-out both; }
  .contours { animation: ds-reveal 2.6s cubic-bezier(.3,.7,.2,1) both; } /* clip reveal: works at any width */
  .contours circle { opacity: 0; animation: ds-fade .5s ease-out 2.2s forwards; }
  .dune-wrap .sun { animation: ds-fade 1.2s ease-out .4s both; }
}
@keyframes ds-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
/* dashboard cards */
.card, form.contact, .mail-card { border-color: var(--card-line); }
.tool-icon { border: 1px solid var(--card-line); background: var(--accent-soft); stroke-width: 1.75; }
.point h3 { display: flex; align-items: center; gap: 10px; }
.point .tool-icon { width: 36px; height: 36px; padding: 7px; }
@media (prefers-color-scheme: dark) {
  .card, form.contact, .mail-card { background: rgba(17, 34, 64, 0.72); }
  .btn.primary { box-shadow: 0 0 0 1px rgba(212, 175, 90, 0.5), 0 0 22px rgba(212, 175, 90, 0.35); }
  .card:hover, .tool-mini a:hover .tool-icon { box-shadow: 0 0 0 1px rgba(212, 175, 90, 0.4), 0 0 24px rgba(212, 175, 90, 0.16); }
  .cta { border-color: rgba(212, 175, 90, 0.35); box-shadow: 0 0 40px rgba(212, 175, 90, 0.08); }
}
@media (prefers-reduced-motion: no-preference) { .card, .tool-icon { transition: box-shadow .2s ease, border-color .2s ease; } }

/* ---------- Review fixes ---------- */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.skip:focus-visible { outline-color: var(--accent); }
.nav a:focus-visible { outline-offset: -3px; outline-color: var(--chrome-ink); }
.nav a[aria-current="page"]:focus-visible { outline-color: var(--on-accent); }
.field input, .field select, .field textarea { border-color: var(--field-line); }
.brand svg > rect:first-of-type { fill: var(--logo-tile); }
@media (prefers-color-scheme: dark) {
  .card-art.soon { background: linear-gradient(180deg, #16324F, #112240); }
}
.btn[aria-disabled="true"] { cursor: default; color: var(--muted); border-color: var(--field-line); border-style: dashed; }
.btn[aria-disabled="true"]:hover { background: transparent; }

/* ---------- App previews on /schools/ ---------- */
.tool-shot { grid-column: 1 / -1; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.tool-shot img { width: 100%; height: auto; border: 1px solid var(--card-line); border-radius: var(--radius); background: var(--sky); }
.tool-shot figcaption { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Scholar layer: serif headings, wordmark, constellation ---------- */
h1, h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.01em; }
h3, .btn, .tool-mini b { font-family: var(--f-body); }
.brand span { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.04em; }
.mail-addr { font-family: var(--f-body); }
@media (max-width: 900px) { .brand span { font-size: 1.02rem; letter-spacing: 0.02em; } .brand { gap: 8px; } }

/* ---------- Home hero: looping intro scene (pause button + reduced-motion still) ---------- */
.intro-wrap { position: relative; }
.hero .dune-wrap.intro { margin-block-start: clamp(8px, 3vw, 24px); }
.scene { display: block; width: 100%; height: clamp(170px, 26vw, 320px); }
.scene .cl { fill: none; stroke: var(--contour-4); stroke-width: 1.2; opacity: .6; vector-effect: non-scaling-stroke; }
.scene .sky circle { fill: var(--contour-4); }
.scene .sun-disc { fill: var(--accent); }
.scene .sun-glow { fill: var(--accent); opacity: .14; }
.scene .c { fill: none; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.scene .c1 { stroke: var(--contour-1); } .scene .c2 { stroke: var(--contour-2); } .scene .c3 { stroke: var(--contour-3); } .scene .c4 { stroke: var(--contour-4); stroke-width: 2.5; }
.scene .pulse { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 0 1; opacity: 0; vector-effect: non-scaling-stroke; }
.scene .trunk { fill: none; stroke: var(--heading); stroke-width: 3; stroke-linecap: round; }
.scene .canopy { fill: var(--heading); }
.scene .root { fill: none; stroke: var(--contour-4); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scene .node { fill: var(--contour-4); }
.scene .g { font: 600 22px var(--f-body); fill: var(--link); opacity: 0; }
.scene rect.g { fill: none; stroke: var(--link); stroke-width: 2; }
.motion-toggle { position: absolute; inset-inline-end: max(16px, 2vw); bottom: 10px; font: 500 0.75rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 999px; padding: 8px 12px; cursor: pointer; opacity: .9; }
.motion-toggle:hover { opacity: 1; }
@media (prefers-color-scheme: dark) { .scene .sun-glow { opacity: .22; } .scene .pulse, .scene .node, .scene .cl { filter: drop-shadow(0 0 4px rgba(212,175,90,.7)); } }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .scene .cl { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ds-cons 12s ease-in-out infinite; }
  .scene .cl2 { animation-delay: .8s; } .scene .cl3 { animation-delay: 1.6s; }
  .scene .tw { animation: ds-twinkle 4s ease-in-out infinite; } .scene .tw:nth-child(2n) { animation-duration: 5.5s; animation-delay: 1s; } .scene .tw:nth-child(3n) { animation-duration: 6.5s; animation-delay: 2s; }
  .scene .sun-glow { transform-box: fill-box; transform-origin: center; animation: ds-glow 6s ease-in-out infinite; }
  .scene .pulse { animation: ds-pulse 6s linear infinite; } .scene .p2 { animation-delay: 3s; }
  .scene .root { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ds-roots 6s ease-in-out infinite; } .scene .r2 { animation-delay: .4s; }
  .scene .node { animation: ds-node 6s ease-in-out infinite; } .scene .n2 { animation-delay: .4s; }
  .scene .g { animation: ds-float 12s ease-in-out infinite; transform-box: fill-box; }
  .scene .g2 { animation-delay: 2s; } .scene .g3 { animation-delay: 4s; } .scene .g4 { animation-delay: 6s; } .scene .g5 { animation-delay: 8s; } .scene .g6 { animation-delay: 10s; }
  .hero.paused .scene * { animation-play-state: paused !important; }
}
@keyframes ds-cons { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: .6; } 30%, 75% { stroke-dashoffset: 0; opacity: .6; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ds-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ds-glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ds-pulse { 0% { stroke-dasharray: 0 1; stroke-dashoffset: 0; opacity: 0; } 5% { stroke-dasharray: .06 .94; opacity: 1; } 70% { stroke-dashoffset: -.9; opacity: 1; } 80%, 100% { stroke-dasharray: .06 .94; stroke-dashoffset: -.94; opacity: 0; } }
@keyframes ds-roots { 0%, 15% { stroke-dashoffset: 1; } 45%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes ds-node { 0%, 40% { opacity: .35; } 50%, 80% { opacity: 1; } 100% { opacity: .35; } }
@keyframes ds-float { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: .85; } 35% { opacity: .85; } 50%, 100% { opacity: 0; transform: translateY(-90px); } }

@media (max-width: 600px) { .motion-toggle { bottom: auto; top: 0; } }

/* Never start a wrapped header row with the language divider */
@media (max-width: 743px) { .lang { border-inline-start: 0; padding-inline-start: 12px; margin-inline-start: 0; } }

/* ---------- Request a prototype form ---------- */
.card-note { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px 22px; margin-block-end: 24px; max-width: 760px; }
.card-note ol { margin: 10px 0 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.card-note li::marker { color: var(--link); font-weight: 600; }
form.request { max-width: 760px; display: flex; flex-direction: column; gap: 20px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; margin: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step-title { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; color: var(--heading); padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step-n { font: 500 0.75rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--eyebrow); }
.step-intro { color: var(--muted); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.req { color: var(--link); font-weight: 600; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
fieldset.checks legend { font-weight: 500; padding: 0; margin-block-end: 2px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.checks.apps .check-grid { grid-template-columns: minmax(0, 1fr); }
label.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--bg); cursor: pointer; }
label.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent { border-style: dashed; }
.app-blocks { display: flex; flex-direction: column; gap: 16px; }
.app-block { border-inline-start: 3px solid var(--accent); padding-inline-start: 16px; display: flex; flex-direction: column; gap: 14px; }
.app-block h3 { font-size: 1.1rem; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; display: none; }
.progress span { display: block; height: 100%; width: 20%; background: var(--accent); }
form.request.js .progress { display: block; }
.form-error { color: var(--heading); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; }
.form-nav { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.form-nav [data-next], .form-nav [data-submit] { margin-inline-start: auto; }
.btn[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 600px) { .row2 { grid-template-columns: minmax(0, 1fr); } .step { padding: 16px; } }
@media (prefers-reduced-motion: no-preference) { .progress span { transition: width .3s ease; } }
.cta .cta-ghost { color: var(--panel-ink); border-color: var(--panel-ink); }
.cta .cta-ghost:hover { background: rgba(255,255,255,.1); }
/* The hidden attribute must always win over component display rules (form steps, app blocks, buttons). */
[hidden] { display: none !important; }
.step > .step-title { float: left; width: 100%; margin-block-end: 4px; }
.step > .step-title + * { clear: both; }

.turnstile-slot:empty { display: none; }
.turnstile-slot { min-height: 65px; }
.form-ok { color: var(--heading); background: var(--accent-soft); border: 1px solid var(--card-line); border-radius: 10px; padding: 12px 14px; }

/* ---------- App demo videos and guide links (schools page) ---------- */
.demo-frame { position: relative; }
.tool-demo video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border: 1px solid var(--card-line); border-radius: var(--radius); background: var(--sky); }
.demo-toggle { position: absolute; inset-inline-end: 12px; bottom: 12px; font: 500 0.75rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--panel-ink); background: var(--panel); border: 1px solid var(--chrome-line); border-radius: 999px; padding: 9px 13px; cursor: pointer; opacity: .92; }
.demo-toggle:hover { opacity: 1; }
.demo-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.guide-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--link); text-decoration: none; border-bottom: 1px solid currentColor; padding-block: 2px; }
.guide-link::before { content: ""; width: 14px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat; }
.guide-link span { font-weight: 400; color: var(--muted); }
.guide-link:hover { border-bottom-width: 2px; }
.under13 { color: var(--ink); }

/* Games page: the "games just for fun" box after the learning games */
.fun-cta { margin-block-start: 32px; }

/* Short "this has moved" pages (Nullgrid's old address and the games site's /move/) */
.moved-page { padding-block: 96px; min-height: 70vh; }
.moved-page h1 { margin-block: 8px 16px; }
.moved-page p { max-width: 60ch; }
.moved-page .btn { margin-block-start: 16px; }
.move-choice { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.move-choice .btn { margin-block-start: 0; white-space: normal; text-align: start; }
.move-note { margin-block: 24px; padding: 16px 20px; border: 1px solid var(--line, currentColor); border-radius: 12px; max-width: 60ch; }
.move-note h2 { font-size: 1.1rem; margin-block-end: 8px; }
