@font-face { font-family: 'iA Writer Quattro'; src: url(assets/fonts/iAWriterQuattroS-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'iA Writer Quattro'; src: url(assets/fonts/iAWriterQuattroS-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --cream: #FFF0DE;
  --ink: #141414;
  --orange: #141414;
  --glass: rgba(255, 236, 214, 0.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e8e8e5; }
body { font-family: 'Schibsted Grotesk', system-ui, sans-serif; color: var(--cream); -webkit-font-smoothing: antialiased; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* ---------- desk overlay: almost nothing, like an instrument readout ---------- */
.ui { position: fixed; inset: 0; pointer-events: none; transition: opacity .6s ease; }
.ui.hidden { opacity: 0; }
.ui a, .ui button { pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-only a:focus { position: fixed; top: 16px; left: 16px; width: auto; height: auto; clip: auto; background: #fff; color: #111; padding: 8px 12px; z-index: 10; }
.readout { position: absolute; margin: 0; font: 400 14px 'iA Writer Quattro', 'Schibsted Grotesk', sans-serif; color: #161616; }
.readout.tl { top: 22px; left: 26px; font-weight: 700; font-size: 17px; }
.readout.br { top: 18px; right: 22px; font-size: 13px; padding: 9px 15px; border-radius: 999px; background: rgba(255,255,255,.62); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 8px 28px rgba(20,20,20,.1), inset 0 0 0 1px rgba(255,255,255,.55); color: #3a3a37; }

/* ---------- book mode ---------- */
.bookui { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.bookui.show { opacity: 1; }
.bookui button { pointer-events: auto; }
.glassy, .pill, .round, .counter, .tip { background: rgba(255,255,255,.62); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 8px 28px rgba(20,20,20,.12), inset 0 0 0 1px rgba(255,255,255,.55); color: #161616; }
.pill { position: absolute; top: 18px; left: 22px; border: 0; border-radius: 999px; padding: 11px 18px; font: 400 15px 'iA Writer Quattro', sans-serif; cursor: pointer; transition: background .2s; }
.pill:hover, .round:hover { background: rgba(255,255,255,.85); }
.pager { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; }
.round { width: 48px; height: 48px; border-radius: 999px; border: 0; font-size: 17px; cursor: pointer; transition: background .2s; }
.counter { min-width: 280px; text-align: center; font: 400 15px 'iA Writer Quattro', sans-serif; padding: 13px 20px; border-radius: 999px; }
button.counter { border: 0; cursor: pointer; }
.hint { position: absolute; right: 22px; top: 18px; margin: 0; font: 400 13px 'iA Writer Quattro', sans-serif; padding: 9px 15px; border-radius: 999px; background: rgba(255,255,255,.62); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 8px 28px rgba(20,20,20,.1), inset 0 0 0 1px rgba(255,255,255,.55); color: #3a3a37; }

/* ---------- tooltip + loader ---------- */
.tip { position: fixed; left: 0; top: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 18px; max-width: 320px; font: 400 15px 'iA Writer Quattro', sans-serif; pointer-events: none; opacity: 0; transition: opacity .15s; }
.tip-title { color: #161616; }
.tip-sub { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #6d6d68; }
.tip.show { opacity: 1; }
.loader { position: fixed; inset: 0; display: grid; place-items: center; background: #e8e8e5; color: #161616; font: 700 17px 'iA Writer Quattro', sans-serif; transition: opacity .8s ease .2s; }
.loader.done { opacity: 0; pointer-events: none; }

@media (max-width: 800px) {
  .readout.br { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ui, .bookui { transition: none; } }

/* ---------- night (desk lamp) ---------- */
html:has(body.dark), body.dark, body.dark .loader { background: #101012; }
body.dark .readout { color: #ecebe6; }
body.dark .readout.br, body.dark .hint { color: #d6d5cf; }
body.dark .glassy, body.dark .pill, body.dark .round, body.dark .counter, body.dark .tip, body.dark .readout.br, body.dark .hint {
  background: rgba(28,28,30,.55); color: #ecebe6; box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08);
}
body.dark .tip-title { color: #ecebe6; }
body.dark .pill:hover, body.dark .round:hover { background: rgba(40,40,44,.8); }
body .ui, body .bookui, body .readout, body .pill, body .round, body .counter, body .hint { transition: background .6s ease, color .6s ease, opacity .6s ease; }

/* ---------- loading ---------- */
.load-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.load-name { font: 700 17px 'iA Writer Quattro', sans-serif; }
.load-sub { font: 400 15px 'iA Writer Quattro', sans-serif; color: #161616; margin-top: -8px; }
.load-track { position: relative; width: 180px; height: 2px; background: rgba(22,22,22,.12); border-radius: 2px; overflow: hidden; }
.load-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #161616; border-radius: 2px; transition: width .35s ease; }
.load-bar:empty::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.1s linear infinite; }
.load-tip { display: none; font: 400 13px 'iA Writer Quattro', sans-serif; color: #6d6d68; margin-top: -8px; }
html.phone .load-tip { display: block; } /* phones only: a hint, not a wall */
.load-step { font: 400 13px 'iA Writer Quattro', sans-serif; color: #6d6d68; min-height: 1.2em; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
body.dark .load-name, body.dark .load-sub { color: #ecebe6; } body.dark .load-track { background: rgba(255,255,255,.14); } body.dark .load-bar { background: #ecebe6; }

/* ---------- impressum + privacy ---------- */
.readout.bl.legal-links { position: fixed; left: 22px; bottom: 18px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.62); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); font: 400 12px 'iA Writer Quattro', sans-serif; color: #55554f; pointer-events: auto; }
body.dark .readout.bl.legal-links { background: rgba(28,28,30,.55); }
.legal-links a { color: inherit; text-decoration: none; }
.legal-links a:hover, .legal-links a:focus-visible { color: #161616; text-decoration: underline; text-underline-offset: 3px; }
body.dark .legal-links { color: #a6a5a0; } body.dark .legal-links a:hover { color: #ecebe6; }
.legal[hidden] { display: none; }
.legal { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: rgba(30,28,24,0); transition: background .5s ease; }
.legal.show { background: rgba(30,28,24,.28); }
.legal-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 18px 20px 0; opacity: 0; transition: opacity .4s ease .3s; }
.legal.show .legal-bar { opacity: 1; }
.legal-tabs { display: flex; gap: 8px; }

.legal-scroll { flex: 1; overflow-y: auto; padding: 0 16px 40px; -webkit-overflow-scrolling: touch; }
/* the sheet slides up out of the pile, slightly crooked, and straightens out */
.legal .paper { margin-top: 24px; transform: translateY(105vh) rotate(-4deg); transition: transform .75s cubic-bezier(.2,.8,.2,1); }
.legal.show .paper { transform: none; }
.legal .paper:focus { outline: none; }
.legal .typing::after { content: '▌'; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 700px) { .legal .paper { margin-top: 12px; } .legal-tabs .pill { padding-inline: 12px; } }
@media (prefers-reduced-motion: reduce) { .legal, .legal .paper, .legal-bar { transition: none; } }
.legal-bar .pill { position: static; background: rgba(255,255,255,.8); color: #161616; }
.legal-bar .legal-tabs .pill[aria-selected="true"] { background: #161616; color: #fff; }

/* ---------- without JavaScript: point to the paper version ---------- */
.noscript { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; margin: 0; padding: 24px; background: #e8e8e5; color: #161616; font: 400 17px 'iA Writer Quattro', sans-serif; text-align: center; }
.noscript a { color: inherit; }

/* ---------- touch + small screens ---------- */
#gl { touch-action: none; } /* pinch, swipe and drag go to the desk, not to the browser */
.lapkeys { display: none; }
html.touch .lapkeys { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: auto; }
.lapkeys button, .lapkeys input { border: 0; border-radius: 999px; padding: 11px 16px; font: 400 15px 'JetBrains Mono', monospace; color: #e3e3e8; background: rgba(31,31,46,.82); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.lapkeys input { flex: 1 1 100%; min-width: 0; font-size: 16px; } /* 16px: iOS doesn't zoom into the field */
.lapkeys input::placeholder { color: #9a9aae; }
@media (max-width: 600px) {
  .readout.tl { top: 18px; left: 16px; font-size: 15px; }
  .pill { top: 12px; left: 12px; padding: 10px 15px; font-size: 14px; }
  .hint { display: none; }
  .pager { bottom: 16px; gap: 10px; width: calc(100vw - 24px); justify-content: center; }
  .counter { min-width: 0; flex: 1; max-width: 260px; padding: 12px 10px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .round { width: 44px; height: 44px; flex: none; }
  .readout.bl.legal-links { left: 12px; bottom: 12px; }
}
