/* Test Run. Two typefaces with two jobs: Icelandic, the language being learnt, is always set in Literata (.is);
   everything said about it, in English, in Schibsted Grotesk (a Nordic face with a plain zero: a slashed 0 reads as Ø here).
   Yellow is a highlighter: it marks what a student would mark. */
@font-face { font-family: 'Literata'; src: url('fonts/literata.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Schibsted'; src: url('fonts/schibsted.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
/* the letters Polish needs (ą ć ę ł ń ś ź ż): fetched only by a page that uses them */
@font-face { font-family: 'Schibsted'; src: url('fonts/schibsted-ext.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --snow: #f5f8fa;
  --paper: #ffffff;
  --ink: #0e2a3b;
  --soft: #4a6272;
  --line: #d5dee5;
  --fjord: #0f5c7a;
  --fjord-dark: #0a4660;
  --hl: #ffe34d;
  --pass: #1f7a4d;
  --pass-bg: #e3f3ea;
  --miss: #b3261e;
  --miss-bg: #fbe9e7;
  --sans: 'Schibsted', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --w: 66rem;
  --pad: clamp(1.1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--snow); color: var(--ink); font-family: var(--sans); font-size: 1.125rem; line-height: 1.55; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--fjord); text-underline-offset: 0.18em; }
a:hover { color: var(--fjord-dark); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.is { font-family: var(--serif); font-optical-sizing: auto; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }
.soft { color: var(--soft); }
.small { font-size: 0.94rem; }
mark, .hl { background: var(--hl); color: var(--ink); padding: 0.05em 0.15em; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* the bar at the top */
.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
/* the name is English, so it is set like the rest of the English: the serif is kept for Icelandic */
.top .name { font-family: var(--sans); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 clamp(0.9rem, 3vw, 1.8rem); font-size: 1rem; }
.top nav a { color: var(--ink); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { border-bottom-color: var(--ink); }

/* buttons */
.btn { display: inline-block; border: 2px solid var(--fjord); background: var(--fjord); color: #fff; font-weight: 700; font-size: 1.08rem; line-height: 1.2; padding: 0.85rem 1.3rem; border-radius: 6px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--fjord-dark); border-color: var(--fjord-dark); color: #fff; }
.btn.quiet { background: transparent; color: var(--fjord); }
.btn.quiet:hover { background: #e4eef3; color: var(--fjord-dark); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--fjord); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* ---------- the front page ---------- */
.hero { padding-top: clamp(1.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 7vw, 5rem); }
.word { display: inline-block; position: relative; font-family: var(--serif); font-weight: 600; font-size: clamp(4.4rem, 21vw, 14.5rem); line-height: 0.95; letter-spacing: -0.035em; margin-left: -0.04em; isolation: isolate; }
.word::before { content: ''; position: absolute; z-index: -1; left: -0.06em; right: -0.1em; top: 0.3em; bottom: 0.02em; background: var(--hl); border-radius: 0.04em 0.09em 0.05em 0.1em; transform: rotate(-1.1deg); }
.gloss { margin-top: clamp(1.2rem, 3vw, 2.2rem); max-width: 36rem; font-size: 1.05rem; color: var(--soft); }
.gloss b { color: var(--ink); font-family: var(--serif); font-weight: 600; }
.hero h1 { margin-top: clamp(1.8rem, 5vw, 3.2rem); max-width: 21ch; font-size: clamp(1.75rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -0.015em; font-weight: 700; }
.hero .acts { margin-top: 1.7rem; display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: center; }

.band { padding-top: clamp(2.5rem, 7vw, 4.5rem); padding-bottom: clamp(2.5rem, 7vw, 4.5rem); border-top: 2px solid var(--ink); }
.band h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.012em; max-width: 24ch; }
.band .lead { margin-top: 0.9rem; max-width: 40rem; }
.cols { display: grid; gap: clamp(1.5rem, 5vw, 4rem); grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

/* the facts: a label and what is known */
.facts { display: grid; grid-template-columns: minmax(7.5rem, 11rem) 1fr; border-top: 1px solid var(--line); }
.facts dt, .facts dd { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--soft); padding-right: 1rem; }
.facts dd b { font-weight: 700; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts dt { border-bottom: 0; padding-bottom: 0; } .facts dd { padding-top: 0.15rem; } }
.source { margin-top: 1rem; }

/* the sign-up */
.signup { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: clamp(1.1rem, 3vw, 1.7rem); }
.signup label.field { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.signup input[type=email] { width: 100%; padding: 0.8rem 0.9rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); font-size: 1.1rem; }
.check { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.6rem; align-items: start; margin-top: 0.9rem; font-size: 1rem; line-height: 1.4; cursor: pointer; }
.check input { width: 1.35rem; height: 1.35rem; margin: 0.08rem 0 0; accent-color: var(--fjord); }
.signup .btn { margin-top: 1.1rem; width: 100%; }
.signup .after { margin-top: 0.8rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 6px; font-size: 1rem; }
.msg.bad { background: var(--miss-bg); color: #7a1711; }
.msg.good { background: var(--pass-bg); color: #14532f; }

/* the four parts, in the order of the day */
.parts { counter-reset: part; border-top: 1px solid var(--line); }
.parts li { counter-increment: part; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0 0.6rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.parts li::before { content: counter(part); font-weight: 700; font-size: 1.25rem; line-height: 1.5; color: var(--fjord); }
.parts .is { font-weight: 600; font-size: 1.25rem; }
.parts .en { color: var(--soft); margin-left: 0.4rem; }
.parts p { grid-column: 2; margin-top: 0.15rem; font-size: 1rem; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 0.95rem 0; font-weight: 700; list-style-position: outside; }
.faq details p { padding: 0 0 1.1rem; max-width: 42rem; }

.foot { border-top: 2px solid var(--ink); padding-top: 1.6rem; padding-bottom: 3rem; font-size: 0.98rem; color: var(--soft); display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; }
.foot a { color: var(--soft); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }

/* text pages: privacy, and the small pages the server answers email links with */
.prose { max-width: 42rem; padding-top: 2rem; padding-bottom: 4rem; }
.prose h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.12; letter-spacing: -0.015em; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.prose p, .prose ul { margin-top: 0.8rem; }
.prose ul { list-style: disc; padding-left: 1.3rem; }
.prose li { margin-top: 0.3rem; }
.draft { margin-top: 1.2rem; padding: 0.8rem 1rem; background: var(--hl); border-radius: 6px; font-size: 1rem; }
body.plain { display: grid; min-height: 100vh; place-items: start center; }
.note { width: 100%; max-width: 34rem; padding: clamp(2rem, 9vh, 6rem) var(--pad) 3rem; }
.note .brand a { font-family: var(--sans); font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.note h1 { margin-top: 1.6rem; font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.15; letter-spacing: -0.015em; }
.note p { margin-top: 1rem; }
.note form { margin-top: 1.4rem; }
.quote { margin-top: 1rem; padding: 0.6rem 1rem; background: var(--paper); border-left: 5px solid var(--hl); font-family: var(--serif); }
.quote p { margin-top: 0.4rem; }

/* which view is shown (assets/app.js sets data-view on <body>) */
[data-view-of] { display: none; }
body[data-view='home'] [data-view-of='home'], body[data-view='practice'] [data-view-of='practice'], body[data-view='privacy'] [data-view-of='privacy'] { display: block; }
body:not([data-view]) [data-view-of='home'] { display: block; }
body[data-view='home'] header.top[data-view-of='home'], body:not([data-view]) header.top[data-view-of='home'] { display: flex; }

/* ---------- the practice test ---------- */
.pt { padding-bottom: 5rem; }
.pt-bar { position: sticky; top: 0; z-index: 5; background: var(--snow); border-bottom: 2px solid var(--ink); }
.pt-bar .wrap { display: flex; align-items: center; gap: 1rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.pt-steps { display: flex; gap: 0.35rem; flex: 1; min-width: 0; }
.pt-steps li { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.2; padding: 0.3rem 0 0.35rem; border-top: 5px solid var(--line); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-steps li.done { border-top-color: var(--fjord); color: var(--ink); }
.pt-steps li.now { border-top-color: var(--ink); color: var(--ink); font-weight: 700; }
.pt-steps .is { font-size: 0.98rem; }
.pt-clock { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--soft); }
@media (max-width: 560px) { .pt-steps li span.en { display: none; } }

.pt-main { padding-top: clamp(1.4rem, 4vw, 2.6rem); }
.pt-main > .wrap > h1, .pt-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15; letter-spacing: -0.015em; }
.pt-head .task { margin-top: 0.5rem; font-size: 1.2rem; }
.pt-head .task .is { font-weight: 600; }
.pt-head .gl { display: block; font-size: 1rem; color: var(--soft); }
.pt-two { margin-top: 1.5rem; display: grid; gap: clamp(1.4rem, 4vw, 3rem); grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); align-items: start; }
@media (max-width: 860px) { .pt-two { grid-template-columns: 1fr; } }
@media (min-width: 861px) { .pt-two > .sticky { position: sticky; top: 4.6rem; } }
.text { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: clamp(1.1rem, 3vw, 1.8rem); font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; }
.text h2 { font-size: 1.45rem; margin-bottom: 0.6rem; }
.text p + p { margin-top: 0.9rem; }
.text .tr { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 1rem; color: var(--soft); }
.text .who { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: var(--soft); margin-right: 0.4rem; }

.qs { display: grid; gap: 1.4rem; }
.q legend { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.35; padding: 0; margin-bottom: 0.5rem; }
.q legend .n { font-family: var(--sans); font-weight: 700; color: var(--fjord); margin-right: 0.35rem; }
.q .gl { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.95rem; color: var(--soft); }
.opt { display: grid; grid-template-columns: 1.6rem auto 1fr; gap: 0.6rem; align-items: center; padding: 0.6rem 0.8rem; margin-top: 0.4rem; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; font-family: var(--serif); font-size: 1.15rem; cursor: pointer; }
.opt:hover { border-color: var(--soft); }
.opt input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--fjord); }
.opt:has(input:checked) { border-color: var(--fjord); background: #e9f2f6; }
/* in the answers (these outrank the "chosen" look above) */
.qs .opt.right { border-color: var(--pass); background: var(--pass-bg); cursor: default; }
.qs .opt.wrong { border-color: var(--miss); background: var(--miss-bg); cursor: default; }
.q > p { margin-top: 0.6rem; }
.opt .tag { grid-column: 2 / -1; font-family: var(--sans); font-size: 0.9rem; font-weight: 700; }
.opt .abc { font-family: var(--sans); font-weight: 700; color: var(--fjord); min-width: 1rem; }
/* the listening questions as in the test: heard, and A, B or C marked */
.ask { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; padding: 0.5rem 1rem 0.5rem 0.7rem; border: 2px solid var(--fjord); border-radius: 999px; background: var(--paper); color: var(--fjord); font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2; cursor: pointer; }
.ask svg { width: 1.1rem; height: 1.1rem; fill: currentColor; flex: none; }
.ask:hover { background: #e4eef3; }
.ask.on { background: var(--fjord); color: #fff; }
.qs.aloud .opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.qs.aloud .opt { margin-top: 0; grid-template-columns: 1.6rem auto; justify-content: center; }
.qs.aloud .q legend { margin-bottom: 0.4rem; }
.written { margin-top: 0; font-weight: 700; }
.written-why { margin: 0.3rem 0 1.3rem 2.1rem; max-width: 30rem; }
.opt.right .tag { color: var(--pass); } .opt.wrong .tag { color: var(--miss); }
.pt-nav { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: center; }
.pt-nav .left { margin-right: auto; }

/* listening */
.player { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: clamp(1rem, 3vw, 1.5rem); display: grid; gap: 0.9rem; }
.player .row { display: flex; align-items: center; gap: 1rem; }
.player .play { flex: none; width: 4rem; height: 4rem; border-radius: 50%; border: 0; background: var(--fjord); color: #fff; cursor: pointer; display: grid; place-items: center; }
.player .play:hover { background: var(--fjord-dark); }
.player .play svg { width: 1.6rem; height: 1.6rem; fill: currentColor; }
.player .track { flex: 1; height: 0.6rem; background: var(--line); border-radius: 0.3rem; overflow: hidden; }
.player .track i { display: block; height: 100%; width: 0; background: var(--fjord); }
.player .time { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--soft); min-width: 5.2rem; text-align: right; }

/* writing */
.pic { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.pic svg { display: block; width: 100%; height: auto; }
.write label { display: block; margin-bottom: 0.4rem; }
.write textarea { display: block; width: 100%; min-height: 13rem; padding: 0.9rem 1rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-family: var(--serif); font-size: 1.2rem; line-height: 1.55; resize: vertical; }
.keys { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.keys button { min-width: 2.5rem; padding: 0.35rem 0.5rem; border: 2px solid var(--line); border-radius: 6px; background: var(--paper); font-family: var(--serif); font-size: 1.2rem; cursor: pointer; }
.keys button:hover { border-color: var(--ink); }
.count { margin-top: 0.7rem; font-weight: 700; }
.count.ok { color: var(--pass); }
.tip { margin-top: 1rem; font-size: 1rem; }
.tip summary { cursor: pointer; font-weight: 700; }
.tip p { margin-top: 0.5rem; max-width: 40rem; }
.toast { margin-top: 0.6rem; padding: 0.55rem 0.8rem; background: var(--hl); border-radius: 6px; font-size: 0.98rem; }

/* speaking */
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1rem; margin-top: 1.1rem; }
.rec audio { height: 2.6rem; max-width: 100%; }
.recdot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--miss); margin-right: 0.45rem; vertical-align: baseline; }
.examples { margin-top: 1.1rem; padding: 0.9rem 1.1rem; background: var(--paper); border-left: 6px solid var(--hl); border-radius: 0 8px 8px 0; }
.examples li { margin-top: 0.5rem; }
.examples li:first-child { margin-top: 0; }
.examples .is { font-size: 1.2rem; display: block; }
.examples .gl { color: var(--soft); font-size: 0.98rem; }
.self { margin-top: 1.3rem; }
.self legend { font-weight: 700; margin-bottom: 0.3rem; }
.self .choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.self label { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: 1rem; }
.self label:has(input:checked) { border-color: var(--fjord); background: #e9f2f6; }
.self input { accent-color: var(--fjord); margin: 0; }

/* results */
.scores { margin-top: 1.4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.scores > div { padding: 1rem 1rem 1rem 0; }
.scores .n { font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.scores .n small { font-size: 1.2rem; font-weight: 400; color: var(--soft); }
.scores .is { display: block; font-weight: 600; font-size: 1.15rem; margin-bottom: 0.4rem; }
.scores p { font-size: 0.98rem; color: var(--soft); margin-top: 0.35rem; }
.review { margin-top: 2.6rem; }
.review > h2 { font-size: 1.5rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--ink); }
.review > h2 .is { font-weight: 600; }
.review .block { margin-top: 1.6rem; }
.mine { white-space: pre-wrap; }
.checklist { margin-top: 0.8rem; list-style: disc; padding-left: 1.3rem; font-size: 1rem; }
.checklist li { margin-top: 0.25rem; }
.words { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 1rem; }
.words .is { font-weight: 600; }
.standin { margin-top: 0.8rem; font-size: 0.95rem; color: var(--soft); }
