/* pieter.regoort.me — zo weinig mogelijk. Alles in Menlo. */

:root {
  color-scheme: light;
  --inkt: #141414;
  --papier: #fafaf7;
  --stil: #8b8b86;
  --lijn: #dcdcd6;
  --duur: 0.6s;
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --inkt: #e6e6e1; --papier: #0e0e0d; --stil: #75756f; --lijn: #2c2c2a; }
}

* { box-sizing: border-box; }
html {
  font: 14px/1.7 Menlo, "SF Mono", ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
  -webkit-text-size-adjust: 100%;
  background: var(--papier);
  color: var(--inkt);
}
body { max-width: 66ch; margin: 0 auto; padding: 14vh 1.5rem 9rem; -webkit-font-smoothing: antialiased; }
::selection { background: var(--inkt); color: var(--papier); }

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
h1, h2, h3 { font-size: 1rem; }
h1 { font-weight: 700; }
h2 { font-weight: 400; margin: 3.4rem 0 0.9rem; }
h3 { font-weight: 400; color: var(--stil); margin: 1.4rem 0 0.4rem; }
p { margin-bottom: 0.85rem; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--lijn);
    text-underline-offset: 0.25em; text-decoration-thickness: 1px; transition: text-decoration-color 0.25s; }
a:hover, a:focus-visible { text-decoration-color: currentColor; }
:focus-visible { outline: 1px dashed currentColor; outline-offset: 3px; }

.stil, .nr { color: var(--stil); }

/* ---------- naam: getypt, met knipperende cursor ---------- */
.typ {
  display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap;
  width: 0; animation: typ 1.1s steps(14, end) 0.35s forwards;
}
.typ-kort { animation: typ-kort 0.4s steps(3, end) 0.2s forwards; }
h1::after, .nu::after {
  content: ""; display: inline-block; width: 0.62em; height: 1.15em; margin-left: 0.15ch;
  vertical-align: -0.2em; background: currentColor;
}
/* De cursor knippert achter de naam en springt daarna naar de regel eronder. */
h1::after { animation: knipper 1.05s steps(1) infinite, weg 0s linear 1.7s forwards; }
.nu::after { visibility: hidden; animation: knipper 1.05s steps(1) infinite, aan 0s linear 1.7s forwards; }
@keyframes weg { to { visibility: hidden; } }
@keyframes aan { to { visibility: visible; } }
@keyframes typ { to { width: 14ch; } }
@keyframes typ-kort { to { width: 3ch; } }
@keyframes knipper { 50% { opacity: 0; } }

/* ---------- de rest verschijnt na het typen ---------- */
@keyframes verschijn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.nu, .balk, .inhoud, main > section, footer { animation: verschijn var(--duur) ease both; }
.nu { animation-delay: 1.5s; color: var(--stil); margin-top: 0.3rem; min-height: 1.7em; white-space: pre-wrap; }
.balk { animation-delay: 1.65s; }
.inhoud { animation-delay: 1.75s; }
main > section:nth-child(1) { animation-delay: 1.9s; }
main > section:nth-child(2) { animation-delay: 2s; }
main > section:nth-child(3) { animation-delay: 2.1s; }
main > section:nth-child(4) { animation-delay: 2.2s; }
main > section:nth-child(5) { animation-delay: 2.3s; }
main > section:nth-child(6) { animation-delay: 2.4s; }
main > section:nth-child(7) { animation-delay: 2.5s; }
footer { animation-delay: 2.7s; margin-top: 6rem; font-size: 0.85rem; }
footer p { margin-bottom: 0.2rem; }
.toetsen { display: none; }
@media (hover: hover) and (pointer: fine) { .toetsen { display: inline; } }
h2 { scroll-margin-top: 2rem; }
h2.gesprongen .nr { color: var(--inkt); }

/* ---------- taal en klok ---------- */
.balk { display: flex; justify-content: space-between; gap: 2ch; margin-top: 2.2rem; color: var(--stil); }
.talen a { text-decoration: none; white-space: pre; }
.talen a::before { content: " "; }
.talen a::after { content: " "; }
.talen a:first-child::before { content: ""; }
.talen a[aria-current]::before { content: "["; color: var(--inkt); }
.talen a[aria-current]:first-child::before { content: "["; margin-left: -1ch; }
.talen a[aria-current]::after { content: "]"; color: var(--inkt); }
.talen a[aria-current] { color: var(--inkt); }
.talen a:hover { color: var(--inkt); }
.klok { white-space: pre; font-variant-numeric: tabular-nums; }

.inhoud { display: flex; flex-wrap: wrap; gap: 0 2ch; margin-top: 0.35rem; color: var(--stil); }
.inhoud a { text-decoration: none; }
.inhoud a:hover { color: var(--inkt); }
.inhoud a::before { content: "→ "; opacity: 0; transition: opacity 0.2s; margin-left: -2ch; }
.inhoud a:hover::before { opacity: 1; }

/* ---------- cv ---------- */
dl { display: grid; grid-template-columns: 9ch 1fr; gap: 0 1ch; }
dt { color: var(--stil); }
dd { margin-bottom: 0.65rem; }

/* ---------- schrijven ---------- */
.stukken { grid-template-columns: 9ch 1fr; margin-bottom: 0.6rem; }
.stukken dd { margin-bottom: 0.25rem; }

/* ---------- foto's ---------- */
.fotos { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2ch 1.5ch; }
.fotos img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.05);
             transition: filter 0.5s ease; }
.fotos a:hover img, .fotos a:focus-visible img { filter: none; }
.fotos span { display: block; color: var(--stil); font-size: 0.85rem; margin-top: 0.3rem; }

.mail { white-space: nowrap; }

@media (max-width: 560px) {
  html { font-size: 13px; }
  body { padding: 9vh 1.25rem 6rem; }
  dl { grid-template-columns: 1fr; }
  dt.leeg { display: none; }
  .fotos { grid-template-columns: 1fr; }
}

@media print {
  html { font-size: 10pt; background: #fff; color: #000; }
  body { max-width: none; padding: 0; }
  .nu, .balk, .inhoud, .toetsen, footer, h1::after { display: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; opacity: 1 !important; }
  .typ { width: auto; }
  h2 { margin-top: 1.6rem; break-after: avoid; }
  section, dd { break-inside: avoid; }
  a { text-decoration: none; }
  .mail::after, dd a[href^="http"]::after { content: " · " attr(href); color: #666; }
  .fotos { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .typ { width: auto; }
  h1::after { visibility: hidden; }
  .nu::after { visibility: visible; }
}
