/* MijnKI base: tokens, type, shared parts. Paper administration: carbon-blue ink, stamp red, envelope grey. */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
/* digits only: Archivo numerals (plain zero) in front of Atkinson, whose zero is slashed */
@font-face { font-family: "Digits"; src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; unicode-range: U+0030-0039; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #f7f8f5;
  --ground: #dde3e9;
  --ink: #16225f;
  --ink-soft: #46508a;
  --stamp: #c93720;
  --ok: #1d7549;
  --field: #ffffff;
  --rule: rgba(22, 34, 95, 0.28);
  --focus: #16225f;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --text: "Digits", "Atkinson Hyperlegible Next", "Segoe UI", Verdana, sans-serif;
  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.75rem;
  --step-3: 2.2rem;
  --measure: 62ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151c3f;
    --ground: #0d1230;
    --ink: #e9ecff;
    --ink-soft: #aab2e0;
    --stamp: #ff7d66;
    --ok: #62d09b;
    --field: #0f1534;
    --rule: rgba(233, 236, 255, 0.3);
    --focus: #e9ecff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0) / 1.62 var(--text);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

h1, h2, h3 { font-family: var(--display); font-stretch: 76%; font-weight: 800; letter-spacing: -0.012em; line-height: 1.02; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 8.2vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h3 { font-size: var(--step-2); line-height: 1.1; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--stamp); }
strong { font-weight: 700; }
small, .small { font-size: var(--step--1); }
.muted { color: var(--ink-soft); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.logo { font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: 1.9rem; letter-spacing: -0.01em; text-decoration: none; line-height: 1; }
.logo span { color: var(--stamp); }

/* buttons: square-cornered like a form tab */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 3px; font: 700 var(--step-0)/1 var(--text); text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.btn:hover { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: var(--step--1); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; cursor: pointer; }
.linkbtn:hover { color: var(--stamp); }

/* form fields */
label.f { display: block; margin: 0 0 18px; font-weight: 700; }
label.f .hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); margin-top: 2px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; min-height: 52px;
  background: var(--field); color: var(--ink); font: 400 var(--step-0)/1.4 var(--text);
  border: 2px solid var(--ink); border-radius: 3px;
}
textarea { min-height: 96px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--stamp); box-shadow: inset 4px 0 0 var(--stamp); }
.err { color: var(--stamp); font-weight: 700; margin: 6px 0 0; font-size: var(--step--1); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; font-weight: 400; }
.check input { width: 24px; height: 24px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }

/* ledger rows: label, dotted leader, value. Structure that reads like a receipt or a form */
.ledger { list-style: none; margin: 0 0 1.2em; padding: 0; max-width: 40rem; }
.ledger li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; }
.ledger li::before { content: none; }
.ledger .dots { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-5px); min-width: 20px; }
.ledger .v { font-weight: 700; white-space: nowrap; }
.ledger li.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: var(--step-1); }
.ledger li.total .v { font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: 2.3rem; line-height: 1; }

/* the slip: a ticket with a stub on the left and the result on the right */
.slip { position: relative; display: grid; grid-template-columns: 11.5rem 1fr; background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; }
.slip .stub { padding: 20px 18px 74px; border-right: 2px dashed var(--ink); position: relative; }
.slip .stub::before, .slip .stub::after { content: ""; position: absolute; right: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--ground); border: 2px solid var(--ink); clip-path: inset(0 0 0 50%); }
.slip .stub::before { top: -11px; clip-path: inset(50% 0 0 50%); }
.slip .stub::after { bottom: -11px; clip-path: inset(0 0 50% 50%); }
.slip .body { padding: 20px 24px 22px; min-height: 17rem; position: relative; }
.slip .stub label { font-weight: 700; display: block; font-size: var(--step--1); line-height: 1.3; }
.slip .stub input { min-height: 46px; padding: 8px 10px; font-size: 1rem; }
.slip .result-label { color: var(--ink-soft); font-size: var(--step--1); margin: 0 0 4px; }
.slip .result { font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1; margin: 0 0 6px; text-wrap: balance; }
.slip .placeholder { color: var(--ink-soft); }

/* timeline: the two-month window, drawn to scale */
.tl { position: relative; height: 60px; margin: 52px 6px 0; }
.tl .axis { position: absolute; left: 0; right: 0; top: 14px; height: 6px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 10px); opacity: .4; }
.tl .fill { position: absolute; left: 0; top: 14px; height: 6px; background: var(--ink); }
.tl .mk { position: absolute; top: 0; transform: translateX(-50%); font-size: .8rem; line-height: 1.2; text-align: center; white-space: nowrap; }
.tl .mk::before { content: ""; display: block; width: 2px; height: 24px; background: var(--ink); margin: 0 auto 2px; }
.tl .mk.end { left: 100%; transform: translateX(-100%); text-align: right; }
.tl .mk.end::before { margin-right: 0; margin-left: auto; }
.tl .mk.start { left: 0; transform: none; text-align: left; }
.tl .mk.start::before { margin-left: 0; }
.tl .mk.go::before { background: var(--ok); }
.tl .mk.go { color: var(--ok); font-weight: 700; }
.tl .mk.today::before { background: var(--stamp); }
.tl .mk.go, .tl .mk.today { display: flex; flex-direction: column-reverse; align-items: center; top: -34px; }
.tl .mk.go::before, .tl .mk.today::before { margin: 2px 0 0; height: 36px; }
.tl .mk.today { color: var(--stamp); font-weight: 700; }

/* the stamp lands when a deadline is known */
.stamp { position: absolute; left: 14px; bottom: 18px; border: 3px solid var(--stamp); color: var(--stamp); padding: 4px 12px 5px; font-family: var(--display); font-stretch: 76%; font-weight: 800; font-size: 1.2rem; line-height: 1; border-radius: 3px; transform: rotate(-5deg); white-space: nowrap; opacity: .92; background: color-mix(in srgb, var(--paper) 70%, transparent); pointer-events: none; }
.stamp.land { animation: land .34s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes land { from { transform: rotate(-14deg) scale(1.7); opacity: 0; } to { transform: rotate(-5deg) scale(1); opacity: .92; } }
@media (prefers-reduced-motion: reduce) { .stamp.land { animation: none; } }

.note { border-left: 6px solid var(--ink); background: color-mix(in srgb, var(--paper) 60%, transparent); padding: 12px 16px; margin: 0 0 1.2em; max-width: var(--measure); }
.note.warn { border-left-color: var(--stamp); }
.note.ok { border-left-color: var(--ok); }
.note p:last-child { margin-bottom: 0; }

footer.site { padding: 40px 0 56px; color: var(--ink-soft); font-size: var(--step--1); }
footer.site p { max-width: 70ch; }

@media (max-width: 720px) {
  .slip { grid-template-columns: 1fr; }
  .slip .stub { border-right: 0; border-bottom: 2px dashed var(--ink); }
  .slip .stub::before, .slip .stub::after { right: auto; top: auto; bottom: -11px; clip-path: inset(0 0 50% 0); }
  .slip .stub::before { left: -11px; clip-path: inset(0 0 50% 50%); }
  .slip .stub::after { right: -11px; left: auto; clip-path: inset(0 50% 50% 0); }
  .slip .body { min-height: 0; }
  .slip .stub { padding-bottom: 20px; }
  .stamp { position: static; display: inline-block; margin: 14px 0 0; }
}
