/* De site van Kanagraphy, in de kleuren van de app (app/.../ui/Thema.kt en res/values/kleuren.xml):
   het rood van een stempel (shu) #B0402B, indigo (ai) #2E4A62, inkt (sumi) #1F1B16 en papier #F7F3EA.
   Licht en donker volgen het toestel (prefers-color-scheme), net als de app. Geen lettertypen van
   buiten: de letters van het toestel. Geen style-attributen (CSP). Richtingen met logische
   eigenschappen (inline-start en inline-end), zodat dir="rtl" (ar, he, fa) vanzelf goed staat. Het
   schrijfvak en het horloge op de beginpagina zijn svg en HTML van tools/site-build.py (aria-hidden),
   met de streken van KanjiVG; ze staan vast op ltr. */

:root {
  --papier: #f7f3ea;
  --vlak: #efe9dd;
  --kaart: #fffdf8;
  --rand: #e0d8c8;
  --lijn: #d2cabb;
  --inkt: #1f1b16;
  --inkt-zacht: #4c463e;
  --ai: #2e4a62;
  --ai-diep: #1b2f40;
  --shu: #b0402b;
  --shu-licht: #f2a08c;
  --shu-vlak: #f8dcd3;
  --spoor: #e6dccb;
  --link: #2e4a62;
  --diep: #e8e1d3;
  --schaduw: 0 1px 2px rgba(46, 74, 98, .08), 0 10px 28px rgba(46, 74, 98, .10);
  --zonder: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #14110e;
    --vlak: #1b1814;
    --kaart: #221e19;
    --rand: #2f2a23;
    --lijn: #3a342c;
    --inkt: #ede6da;
    --inkt-zacht: #cfc6b8;
    --ai: #a8c3dc;
    --ai-diep: #0e1a24;
    --shu: #f2a08c;
    --shu-licht: #f2a08c;
    --shu-vlak: #4a1a10;
    --spoor: #3a332b;
    --link: #a8c3dc;
    --diep: #0f0d0b;
    --schaduw: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:lang(ko) { word-break: keep-all; }
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3 { word-break: auto-phrase; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--inkt);
  font-family: var(--zonder);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3, .merk, .voet-merk {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.3rem); margin: 0 0 .5em; letter-spacing: -.02em; color: var(--ai); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin: 0 0 .6em; color: var(--ai); }
h3 { font-size: 1.15rem; margin: 0 0 .4em; font-weight: 700; }
html:lang(th) h1, html:lang(th) h2, html:lang(ja) h1, html:lang(ko) h1 { text-wrap: wrap; }

p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-color: var(--shu); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible, .knop:focus-visible {
  outline: 3px solid var(--shu);
  outline-offset: 2px;
  border-radius: 4px;
}
abbr[title] { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }
ul, ol { padding-inline-start: 1.3em; }
li { margin: .25em 0; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.smal { max-width: 46rem; }
.lead { font-size: 1.2rem; }
.klein { font-size: .875rem; color: var(--inkt-zacht); }

.overslaan {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--ai); color: var(--papier); font-weight: 700;
  padding: .5rem 1rem; border-radius: 0 0 8px 8px; z-index: 10;
}
.overslaan:focus { top: 0; }

/* ---------------------------------------------------------------- kop */

.kop { border-bottom: 1px solid var(--lijn); background: var(--papier); }
.kop-rij { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-top: .75rem; padding-bottom: .75rem; }
.merk { display: inline-flex; align-items: center; gap: .55rem; color: var(--ai); text-decoration: none; font-size: 1.35rem; }
.merk .logo { width: 38px; height: 38px; flex: none; border-radius: 50%; }
.menu { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-inline-start: auto; }
.menu a { color: var(--inkt); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.menu a:hover, .menu a[aria-current] { border-bottom-color: var(--shu); }

.taalkeuze { position: relative; }
.taalkeuze summary {
  list-style: none; cursor: pointer; padding: .3rem .7rem; border: 1px solid var(--lijn);
  border-radius: 999px; font-size: .95rem; white-space: nowrap;
}
.taalkeuze summary::-webkit-details-marker { display: none; }
.taalkeuze summary::after { content: " \25BE"; color: var(--inkt-zacht); }
.taalkeuze[open] summary { background: var(--vlak); }
.talen {
  position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); z-index: 5;
  list-style: none; margin: 0; padding: .4rem; min-width: 15rem; max-height: 70vh; overflow: auto;
  background: var(--kaart); border: 1px solid var(--lijn); border-radius: 12px; box-shadow: var(--schaduw);
  columns: 2; column-gap: .25rem;
}
.talen li { margin: 0; break-inside: avoid; }
.talen a { display: block; padding: .3rem .55rem; border-radius: 8px; color: var(--inkt); text-decoration: none; }
.talen a:hover { background: var(--vlak); }
.talen a[aria-current] { background: var(--shu-vlak); font-weight: 600; }

/* ---------------------------------------------------------------- beginpagina */

.held { padding: 3rem 0 3.5rem; }
.held-rij { display: grid; gap: 2.5rem; align-items: center; }
.held-klein { color: var(--inkt-zacht); font-size: .95rem; }
.held-beeld { display: flex; justify-content: center; }

.knop {
  display: inline-block; background: var(--shu); color: var(--papier); text-decoration: none;
  padding: .75rem 1.3rem; border-radius: 999px; font-weight: 700;
}
.knop-stil { background: transparent; color: var(--shu); border: 1px solid var(--shu); }

.blok { padding: 3.25rem 0; }
.blok-zacht { background: var(--vlak); border-top: 1px solid var(--rand); border-bottom: 1px solid var(--rand); }
.blok-accent { background: #2e4a62; color: #edf1f5; }
.blok-accent h2 { color: #f6c2b4; }
.blok-accent a { color: #fff; text-decoration-color: #f2a08c; }

.kaarten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.kaart {
  background: var(--kaart); border: 1px solid var(--rand); border-radius: 16px; padding: 1.25rem 1.25rem .5rem;
}
.kaart h3 { color: var(--ai); }
.kaart-plus { border-color: var(--shu); border-width: 2px; }
.kaart-plus h3 { color: var(--shu); }

.twee { display: grid; gap: 2rem; }
.twee-midden { align-items: center; }
.prijs { margin-top: 1.5rem; gap: 1rem; }

/* Opsommingen met een klein stempel ervoor, zoals het icoon. */
.vinkjes { list-style: none; padding: 0; }
.vinkjes li { position: relative; padding-inline-start: 1.7rem; }
.vinkjes li::before {
  content: ""; position: absolute; inset-inline-start: .1rem; top: .5em;
  width: .7rem; height: .7rem; border-radius: 3px; background: var(--shu); transform: rotate(-6deg);
}

.vraag { border-bottom: 1px solid var(--lijn); padding: .75rem 0; }
.vraag summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; }
.vraag summary::marker { color: var(--shu); }
.vraag .antwoord { padding-top: .5rem; }

@media (min-width: 52rem) {
  .held-rij { grid-template-columns: 1.15fr 1fr; }
  .twee { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- het schrijfvak (aria-hidden)
   Zoals het schrijven in de app: hulplijnen, de streken als spoor om na te trekken, twee al
   geschreven, de derde half, met een stip waar hij begint en de nummers van de streken. */

.schrift { width: 19rem; max-width: 82vw; height: auto; direction: ltr; filter: drop-shadow(0 10px 22px rgba(46, 74, 98, .14)); }
.schrift .vak { fill: var(--kaart); stroke: var(--rand); stroke-width: 1; }
.schrift .hulplijn { fill: none; stroke: var(--lijn); stroke-width: .6; stroke-dasharray: 2.5 2.5; }
.schrift path.spoor { fill: none; stroke: var(--spoor); stroke-width: 7.5; stroke-linecap: round; stroke-linejoin: round; }
.schrift path.inkt { fill: none; stroke: var(--inkt); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.schrift path.bezig { fill: none; stroke: var(--shu); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 52 100; }
.schrift .begin { fill: var(--shu); }
.schrift .nummer { fill: var(--inkt-zacht); font: 700 6px var(--zonder); text-anchor: middle; dominant-baseline: central; }

/* ---------------------------------------------------------------- het horloge in een oefening (aria-hidden)
   Zoals Oefenen.kt in wear: zwart rond scherm, vier klanken in een kruis, het teken in het midden
   en de voortgang als ring langs de rand, in de kleuren van het horloge (Thema in HoofdActivity.kt). */

.horloge-plek { display: flex; justify-content: center; }
.horloge {
  direction: ltr; width: 17rem; max-width: 80vw; aspect-ratio: 1; border-radius: 50%; padding: .9rem;
  background: linear-gradient(145deg, #3b3f46, #15171b); box-shadow: var(--schaduw);
}
.wijzerplaat { position: relative; width: 100%; height: 100%; border-radius: 50%; background: #000; overflow: hidden; }
.boog {
  position: absolute; inset: 2%; border-radius: 50%;
  background: conic-gradient(#ff8a75 0 40%, #3a2a26 40% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.antw {
  position: absolute; width: 27%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: #5a2318; color: #ffdad2; font-weight: 800; font-size: 1.3rem;
}
.boven { top: 6.5%; left: 36.5%; }
.onder { bottom: 6.5%; left: 36.5%; }
.links { left: 6.5%; top: 36.5%; }
.rechts { right: 6.5%; top: 36.5%; }
.pols-teken {
  position: absolute; left: 34%; top: 34%; width: 32%; height: 32%;
  fill: none; stroke: #f4efea; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------------------------------------------------------- tekstpagina's */

.tekst { max-width: 46rem; padding: 2.5rem 0 3rem; }
.tekst h2 { margin-top: 2rem; font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
.bijgewerkt { color: var(--inkt-zacht); font-size: .95rem; }
.tekst ol > li { margin: .6em 0; }

.bronnen { padding-inline-start: 1.1em; }
.bronnen li { margin: .45em 0; overflow-wrap: anywhere; }
.groepen > li { margin: .9em 0; }
.groepen > li > .citaat { font-weight: 700; }
.groepen ul { margin: .3em 0 0; }

/* ---------------------------------------------------------------- voet */

.voet { border-top: 1px solid var(--lijn); background: var(--diep); padding: 2.5rem 0 2rem; font-size: .95rem; }
.voet-rij { display: grid; gap: 1.5rem; }
.voet-merk { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; margin-bottom: .5rem; color: var(--ai); }
.voet-merk .logo { width: 29px; height: 29px; border-radius: 50%; }
.voet-kop { font-weight: 700; margin-bottom: .25rem; }
.impressum { line-height: 1.5; }
.voet-links { list-style: none; padding: 0; margin: 0; }
.voet-links a { color: var(--inkt); }
@media (min-width: 46rem) { .voet-rij { grid-template-columns: 2fr 1fr; } }

/* 404 */
.terug { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

@media print {
  .kop, .voet, .taalkeuze, .overslaan { display: none; }
  body { background: #fff; color: #000; }
}
