/* Front page only. Loaded after scrollcraft.css and before app.css. */

/* Verdict colouring from data: each element carries data-l="ycnnn" (one letter per
   data class) and an ancestor carries data-rung. home.js resolves it to data-v. */
[data-v="y"] { --c: var(--yes); --cb: var(--yes-bg); }
[data-v="c"] { --c: var(--care); --cb: var(--care-bg); }
[data-v="n"] { --c: var(--no); --cb: var(--no-bg); }

/* ------------------------------------------------------------------ hero -- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--ink); }
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s6) var(--s8); align-items: center; min-height: calc(100svh - 53px); padding-top: var(--s8); padding-bottom: var(--s8); }
.hero__in > * { min-width: 0; }
.ask { margin: 0; }
.hero .btn--ghost { background: var(--bg); }
.hero .btn--ghost:hover { background: var(--surface); }
.ask__q { font-size: clamp(2.1rem, 1.1rem + 4.2vw, 4.3rem); line-height: 1.16; letter-spacing: -0.035em; font-weight: 600; text-wrap: initial; }
.ask__q select { font: inherit; letter-spacing: inherit; color: var(--ink); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230d1411' stroke-width='1.8'/%3E%3C/svg%3E") right 0.28em center / 0.34em no-repeat; border: 0; border-bottom: 3px solid var(--ink); border-radius: 3px 3px 0 0; padding: 0 0.72em 0 0.16em; margin: 0.06em 0; width: auto; max-width: 100%; min-height: 0; line-height: 1.12; appearance: none; -webkit-appearance: none; cursor: pointer; box-shadow: var(--e1); text-overflow: ellipsis; }
.ask__q select:hover { background-color: #fff; box-shadow: var(--e2); }
.ask__q select:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.answer { position: relative; z-index: 2; box-shadow: var(--e2); align-self: center; }
.answer__list li { display: grid; grid-template-columns: 104px 1fr; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.answer__list li:last-child { border-bottom: 0; }
/* Norwegian verdict words are longer ("Med forbehold"); English keeps its column. */
:lang(nb) .answer__list li { grid-template-columns: 128px minmax(0, 1fr); }
.answer__list b { display: block; font-weight: 600; font-size: 0.95rem; }
.answer__list span:not(.v) { color: var(--soft); font-size: 0.88rem; line-height: 1.4; display: block; margin-top: 2px; }
.answer__list.is-swap li { animation: swap 260ms var(--ease) both; }
.answer__list.is-swap li:nth-child(2) { animation-delay: 40ms; }
.answer__list.is-swap li:nth-child(3) { animation-delay: 80ms; }
.answer__list.is-swap li:nth-child(4) { animation-delay: 120ms; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }
.hero__foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: center; justify-content: space-between; }
.hero__foot p:last-child { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Back plane: every plan on the market as one row of five marks. Far, soft, slow. */
.hero__board { position: absolute; z-index: 0; top: -6%; right: -4%; width: min(58vw, 860px); display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px 18px; opacity: 0.5; transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px + var(--sy, 0) * -60px), 0) rotate(-7deg); filter: blur(0.6px); pointer-events: none; -webkit-mask-image: linear-gradient(100deg, transparent 4%, #000 46%); mask-image: linear-gradient(100deg, transparent 4%, #000 46%); }
.hero__board i { display: contents; }
.hero__board b { height: 15px; border-radius: 2px; background: var(--line); transition: background-color 300ms var(--ease); }
.hero__board b[data-v="y"] { background: var(--yes-bg); }
.hero__board b[data-v="c"] { background: var(--care-bg); }
.hero__board b[data-v="n"] { background: var(--no-bg); }
.hero__board b[data-on] { background: var(--c); }

@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; min-height: 0; padding-top: var(--s7); padding-bottom: var(--s7); gap: var(--s5); }
  .hero__board { width: 120vw; right: -40vw; top: -3%; opacity: 0.34; }
  .answer__list li { grid-template-columns: 96px 1fr; padding: var(--s3); }
  .hero__foot p:last-child .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------ dial -- */
.dial { background: var(--surface); border-bottom: 1px solid var(--ink); }
.dial__stage { display: grid; align-items: center; height: 100svh; }
.dial__in { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: var(--s8); align-items: center; padding-top: 52px; max-width: 1360px; }
.dial .label { font-size: 0.78rem; }
.ladder { margin-top: var(--s4); border-top: 1px solid var(--ink); }
.ladder button { display: grid; grid-template-columns: 1fr; gap: 0; width: 100%; text-align: left; font: inherit; color: var(--faint); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 13px 12px 13px 18px; cursor: pointer; position: relative; transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.ladder button::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 4px; background: var(--ink); transform: scaleY(0); transition: transform 240ms var(--ease); }
.ladder b { font-weight: 600; font-size: 1.18rem; letter-spacing: -0.01em; }
.ladder span { font-size: 0.84rem; max-height: 0; overflow: hidden; opacity: 0; transition: opacity 200ms var(--ease); }
.ladder button:hover { color: var(--ink); }
.ladder button[aria-current] { color: var(--ink); background: var(--bg); }
.ladder button[aria-current]::before { transform: scaleY(1); }
.ladder button[aria-current] span { max-height: 3em; opacity: 1; color: var(--soft); }
.dial__count { margin-top: var(--s5); display: flex; align-items: baseline; gap: var(--s3); }
.dial__count .mono { font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; min-width: 2ch; }
.dial__count span:last-child { color: var(--soft); }
.dial__say { margin-top: var(--s3); min-height: 4.7em; max-width: 44ch; font-size: 1.05rem; }

.board__row { display: grid; grid-template-columns: 172px 1fr; gap: var(--s3); align-items: center; padding: clamp(3px, 0.75svh, 8px) 0; border-bottom: 1px solid var(--line); }
.board__row:last-child { border-bottom: 0; }
.board__row > a { font-size: 0.98rem; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board__row > a:hover { text-decoration: underline; }
.board__cells { display: flex; gap: 5px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; font: 500 0.76rem/1 var(--mono); padding: 8px 9px 8px 8px; border-radius: var(--r); color: var(--c, var(--soft)); background: var(--cb, var(--bg)); transition: background-color 260ms var(--ease), color 260ms var(--ease); }
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip i { width: 9px; height: 9px; flex: none; }
.chip[data-v="y"] i { border-radius: 50%; background: currentColor; }
.chip[data-v="c"] i { border-radius: 50%; border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.chip[data-v="n"] i { background: linear-gradient(45deg, transparent 40%, currentColor 40% 60%, transparent 60%), linear-gradient(-45deg, transparent 40%, currentColor 40% 60%, transparent 60%); }
.chip.is-flip { animation: flip 420ms var(--ease); }
@keyframes flip { 0% { transform: scaleY(1); } 40% { transform: scaleY(0.12); } 100% { transform: scaleY(1); } }

@media (max-width: 900px) {
  .dial__in { grid-template-columns: 1fr; gap: var(--s3); padding-top: 108px; align-content: start; }
  .dial__stage { align-items: start; }
  .ladder { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: var(--s2); border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
  .ladder button { padding: 8px 2px; text-align: center; border-bottom: 0; border-right: 1px solid var(--line); height: 100%; }
  .ladder li:last-child button { border-right: 0; }
  .ladder button::before { display: none; }
  .ladder b { font-size: 0.68rem; font-weight: 500; letter-spacing: 0; line-height: 1.15; display: block; }
  .ladder span { display: none; }
  .ladder button[aria-current] { background: var(--ink); color: #fff; }
  .dial__count { margin-top: var(--s3); }
  .dial__count .mono { font-size: 2.2rem; }
  .dial__say { min-height: 5.8em; font-size: 0.92rem; margin-top: 4px; }
  .board__row { grid-template-columns: 132px 1fr; padding: clamp(2px, 0.6svh, 7px) 0; }
  .board__row > a { font-size: 0.8rem; }
  .chip { padding: 5px; flex: 1 1 0; max-width: 46px; justify-content: center; }
  .chip > span { display: none; }
}
@media (max-width: 900px) and (max-height: 720px) { .dial__say { display: none; } .dial__in { padding-top: 88px; } }

/* ------------------------------------------------------------ staff page -- */
.staffact { padding: clamp(64px, 10vw, 128px) 0; border-bottom: 1px solid var(--ink); }
.staffact__in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s8); align-items: center; }
.staffact__copy > * + * { margin-top: var(--s4); }
.staffact__copy h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -0.03em; }
.staffact__copy p { color: var(--soft); max-width: 46ch; }
.staffact__copy .label { margin-top: var(--s6); }
.staffpage { box-shadow: var(--e2); margin: 0; }
.staffpage h3 { font-size: 1.2rem; margin-bottom: var(--s3); }
.staffpage__no { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
.staffpage__act { margin-top: var(--s4); display: flex; gap: var(--s2); flex-wrap: wrap; }
.staffpage__act .btn { pointer-events: none; }
@media (max-width: 900px) { .staffact__in { grid-template-columns: 1fr; gap: var(--s6); } }
@media (max-width: 560px) { .staffpage th:nth-child(3), .staffpage td:nth-child(3) { display: none; } }

/* ----------------------------------------------------------------- trail -- */
.trail { background: var(--surface); border-bottom: 1px solid var(--ink); }
/* Default is a readable column (phones, reduced motion, no script). home.js adds
   .is-pan on wide screens with motion allowed, and only then is it a pinned rail. */
.trail__rail { display: flex; flex-direction: column; gap: var(--s7); padding: var(--s8) var(--gutter); max-width: 720px; margin: 0 auto; }
.trail__lead h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); letter-spacing: -0.03em; }
.trail__lead p { color: var(--soft); margin-top: var(--s4); font-size: 1.08rem; }
.trail.is-pan .trail__stage { display: flex; align-items: center; height: 100svh; overflow: hidden; }
.trail.is-pan .trail__rail { flex-direction: row; align-items: flex-start; gap: clamp(28px, 5vw, 72px); padding: 60px var(--gutter) 0 max(var(--gutter), calc((100vw - 1180px) / 2 + var(--gutter))); width: max-content; max-width: none; margin: 0; will-change: transform; }
.trail.is-pan .trail__lead { width: min(74vw, 400px); flex: none; align-self: center; }
.trail.is-pan .step { width: min(84vw, 440px); flex: none; }
.trail.is-pan .step--wide { width: min(88vw, 620px); }
.step > .label { margin-bottom: var(--s3); display: flex; align-items: center; gap: var(--s2); }
.step > .label::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.step > p.soft { margin-top: var(--s4); font-size: 0.95rem; max-width: 44ch; }
.step .panel { box-shadow: var(--e2); }
.step__plans { margin: var(--s3) 0; border: 1px solid var(--line); border-radius: var(--r); }
.step__plans li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.step__plans li:last-child { border-bottom: 0; }
.step__plans li[data-on] { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 2px; font-weight: 500; }
.step__doc { padding: var(--s5); max-height: min(62svh, 520px); overflow: hidden; position: relative; }
.step__doc::after { content: ""; position: absolute; inset: auto 0 0 0; height: 72px; background: linear-gradient(transparent, var(--surface)); }
.step__doc h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.quiz > * + * { margin-top: var(--s2); }
.quiz > p:first-child { margin-bottom: var(--s3); }
.quiz__opt { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.93rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; cursor: pointer; transition: background-color 140ms var(--ease), transform 120ms var(--ease); }
.quiz__opt:hover { background: var(--bg); }
.quiz__opt:active { transform: translateY(1px); }
.quiz__opt[data-state="right"] { border-color: var(--yes); background: var(--yes-bg); color: var(--yes); font-weight: 500; }
.quiz__opt[data-state="wrong"] { border-color: var(--no); background: var(--no-bg); color: var(--no); }
.quiz__why { font-size: 0.9rem; color: var(--soft); padding-top: var(--s2); }
@media (prefers-reduced-motion: no-preference) and (min-width: 861px) {
  .trail.is-pan .step { opacity: clamp(0.5, calc((var(--sc-p, 1) - var(--at, 0)) * 9 + 0.5), 1); transform: translateY(calc(clamp(0, 1 - (var(--sc-p, 1) - var(--at, 0)) * 9, 1) * 22px)); }
  .trail.is-pan .step:nth-of-type(1) { --at: -1; }
  .trail.is-pan .step:nth-of-type(2) { --at: 0.12; }
  .trail.is-pan .step:nth-of-type(3) { --at: 0.38; }
  .trail.is-pan .step:nth-of-type(4) { --at: 0.62; }
}
/* ----------------------------------------------------------------- start -- */
.start { background: var(--ink); color: #f1f2ee; padding: clamp(72px, 12vw, 150px) 0; }
.start__in { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s8); align-items: start; }
.start h2 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.04; }
.start__field { display: block; }
.start__field + .start__field { margin-top: var(--s5); }
.start__field > span { display: block; font-size: 0.9rem; color: #b4bbb5; margin-bottom: var(--s2); }
.start__field output { color: #fff; font-size: 1rem; }
.start input[type="text"] { background: transparent; color: #fff; border: 0; border-bottom: 2px solid #f1f2ee; border-radius: 0; font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); font-weight: 500; letter-spacing: -0.02em; padding: 6px 0 10px; caret-color: #fff; }
.start input[type="text"]::placeholder { color: #68726c; }
.start input[type="text"]:focus { outline: none; border-bottom-color: #fff; box-shadow: 0 2px 0 #fff; }
.start input[type="range"] { width: 100%; accent-color: #f1f2ee; height: 28px; }
.start__price { margin: var(--s5) 0; font-size: 1.08rem; color: #c9cfc9; }
.start__price b { color: #fff; font-weight: 600; }
.start .btn--inv { background: #f1f2ee; color: var(--ink); border-color: #f1f2ee; }
.start .btn--inv:hover { background: #fff; }
.start :focus-visible { outline-color: #fff; }
.start__small { margin-top: var(--s4); font-size: 0.88rem; color: #98a19b; }
@media (max-width: 900px) { .start__in { grid-template-columns: 1fr; gap: var(--s6); } }

@media (prefers-reduced-motion: reduce) {
  .hero__board { transform: rotate(-7deg); }
  .dial[data-sc-act] .dial__stage { height: auto; padding: var(--s8) 0; }
}

/* film link in the hero, and the paste check act */
.hero__film { margin-left: var(--s3); font-weight: 500; white-space: nowrap; }
.hero__film .mono { color: var(--soft); font-size: 0.8em; margin-left: 4px; }
.pasteact { padding-block: clamp(72px, 14vh, 150px); background: var(--surface); border-block: 1px solid var(--line); }
.pasteact__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.pasteact__film { overflow: hidden; box-shadow: var(--e2); }
.pasteact__copy { display: grid; gap: var(--s4); }
.pasteact__copy h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem); letter-spacing: -0.03em; }
.pasteact__copy p { color: var(--soft); max-width: 46ch; }
@media (max-width: 860px) { .pasteact__in { grid-template-columns: minmax(0, 1fr); } .hero__film { display: inline-block; margin: var(--s3) 0 0; } }

/* The board holds every tool in the directory and must always fit the pinned stage: two columns filled top to
   bottom, rows that share the height, marks without plan names (the name is the mark's title, and on the tool page). */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 13), minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 40px); height: min(70svh, calc(var(--rows, 13) * 40px)); }
.board__row { grid-template-columns: minmax(0, 10.5em) minmax(0, 1fr); padding: 0; min-height: 0; }
.board__row:nth-child(n) { border-bottom: 1px solid var(--line); }
.board__row > a { font-size: 0.9rem; }
.board__cells { gap: 4px; }
.chip { padding: 0; flex: 1 1 0; max-width: 34px; height: clamp(12px, 2.1svh, 22px); justify-content: center; }
.chip > span { display: none; }
.chip i { width: 8px; height: 8px; }
@media (max-width: 860px) {
  .board { column-gap: 12px; height: min(52svh, calc(var(--rows, 13) * 30px)); }
  .board__row { grid-template-columns: minmax(0, 5.6em) minmax(0, 1fr); gap: 6px; padding: 0; }
  .board__row > a { font-size: 0.68rem; }
  .board__cells { gap: 2px; }
  .chip { max-width: 18px; padding: 0; }
  .chip i { width: 6px; height: 6px; }
}
