/* Q Res Publica – mörker → gryning → Q.
   Sidans bakgrund är filmens sista bildruta (#FDFDFD) så att filmen glider över i sidan.
   Typsnitten ligger lokalt (OFL), samma som Q Signum och Q Cista. */

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/hanken-grotesk-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --night: #09090b;
  --paper: #fdfdfd;
  --paper-warm: #f8f5ef;
  --card: #ffffff;
  --ink: #17140f;
  --ink-sub: #534d44;
  --muted: #6b655b;
  --line: rgba(23, 20, 15, 0.12);
  --gold: #f4b13e;
  --orange: #e25a28;
  --accent: #b2441a;
  --accent-hover: #8f3412;
  --sun: linear-gradient(135deg, #f4b13e 0%, #ee8a31 55%, #e25a28 100%);
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--card); padding: 8px 12px; }

/* ── Sidhuvud ─────────────────────────────────────────── */
.top {
  --top-ink: var(--ink);
  --top-sub: var(--ink-sub);
  position: relative;
  z-index: 3;
  color: var(--top-ink);
  transition: color 0.9s var(--ease);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 18px; }
.logo img { width: 30px; height: 32px; }
.logo span { font-family: var(--font-serif); font-weight: 400; font-size: 25px; letter-spacing: 0; line-height: 1; }
.logo:hover { color: inherit; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav a { color: var(--top-sub); text-decoration: none; transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--top-ink); }
.nav .lang { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.nav .login {
  color: var(--top-ink);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 6px 14px;
  opacity: 0.85;
}
.nav .login:hover { opacity: 1; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 15px; padding: 6px 12px; border: 1px solid currentColor; border-radius: 999px; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 10px);
  display: flex; flex-direction: column; gap: 4px; min-width: 210px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}
.menu nav a { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; }
.menu nav a:hover { background: var(--paper-warm); }
@media (max-width: 860px) {
  .top .nav { display: none; }
  .menu { display: block; }
}

/* ── Startsidans film ─────────────────────────────────── */
.hero {
  position: relative;
  background: var(--paper);
  min-height: 100svh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  /* Följer filmens egen ljusning (6,4–8,5 s). */
  transition: background-color 2.1s cubic-bezier(.45,0,.55,1);
}
/* Filmens svarta är rent svart, så heron är det också. */
.js .hero { background: #000; }
.js .hero .top { --top-ink: #eeeae2; --top-sub: rgba(238, 234, 226, 0.66); }
.js.dawn .hero { background: var(--paper); }
.js.dawn .hero .top { --top-ink: var(--ink); --top-sub: var(--ink-sub); }
.instant .hero, .instant .hero .top { transition: none; }

.film { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px 40px; }
.film-frame { position: relative; width: min(100%, 880px, 92svh); aspect-ratio: 16 / 9; }
.film-frame video, .film-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* Kanterna tonas ut i dimma mot bakgrunden så att filmen aldrig syns som en ruta. */
  /* I mörkret: tät dimma, jordens kant löses upp i natten. */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, rgba(0,0,0,.5) 72%, transparent 98%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, rgba(0,0,0,.5) 72%, transparent 98%);
}
.film-frame img { display: none; }
/* Vid gryningen (filmens kanter är svarta när den byts) vidgas dimman så att ordbilden får plats. */
.js.dawn .film-frame video, .film-frame img {
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 63%, transparent 84%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 63%, transparent 84%);
}
.instant .film-frame video { display: none; }
.instant .film-frame img { display: block; }

.hero-text { text-align: center; max-width: 760px; margin-top: 8px; }
.js .hero-text { opacity: 0; transform: translateY(14px); transition: opacity 1.1s var(--ease) 1.4s, transform 1.1s var(--ease) 1.4s; }
.js.dawn .hero-text { opacity: 1; transform: none; }
.instant .hero-text { transition: none; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -0.015em;
}
.hero h1 em { font-style: italic; background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
.hero .lead { margin: 22px auto 0; max-width: 620px; color: var(--ink-sub); font-size: clamp(17px, 1.7vw, 19px); }
.hero .actions { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn-sun { background: var(--sun); color: #1b0f05; box-shadow: 0 8px 24px rgba(226, 90, 40, 0.28); }
.btn-sun:hover { color: #1b0f05; transform: translateY(-1px); box-shadow: 0 12px 30px rgba(226, 90, 40, 0.34); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { color: var(--ink); border-color: rgba(23, 20, 15, 0.3); }

/* ── Sektioner ────────────────────────────────────────── */
section.block { padding: clamp(64px, 9vw, 120px) 0; }
section.warm { background: var(--paper-warm); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
h2.title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.06; letter-spacing: -0.01em; max-width: 820px; }
.intro { margin-top: 18px; color: var(--ink-sub); max-width: 680px; font-size: 18px; }

.promises { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promise { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px 30px; }
.promise .num { font-family: var(--font-serif); font-size: 44px; line-height: 1; background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent; }
.promise h3 { margin-top: 18px; font-size: 20px; letter-spacing: -0.01em; }
.promise p { margin-top: 8px; color: var(--ink-sub); }

.areas { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.area {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 24px; color: var(--ink); text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
a.area:hover { color: var(--ink); transform: translateY(-2px); border-color: rgba(226, 90, 40, 0.35); box-shadow: 0 14px 34px rgba(23, 20, 15, 0.07); }
.area .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(244, 177, 62, 0.14); color: var(--accent); margin-bottom: 8px; }
.area .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.area .life { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.area h3 { font-size: 20px; letter-spacing: -0.01em; }
.area p { color: var(--ink-sub); font-size: 15.5px; }
.area .meta { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.area .host { color: var(--accent); }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper-warm); color: var(--ink-sub); }
.status.live { background: rgba(46, 125, 72, 0.1); color: #256339; }
.status.pilot { background: rgba(244, 177, 62, 0.18); color: #7a4a05; }

/* Möt Q */
.meet { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.chat {
  background: var(--night); color: #eeeae2; border-radius: 22px; padding: 26px;
  box-shadow: 0 30px 70px rgba(9, 9, 11, 0.25); position: relative; overflow: hidden;
}
.chat::before {
  content: ''; position: absolute; width: 380px; height: 380px; right: -150px; top: -170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 177, 62, 0.35), transparent 65%);
}
.chat .bar { position: relative; display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(238, 234, 226, 0.7); margin-bottom: 18px; }
.chat .bar img { width: 22px; height: 24px; }
.msg { position: relative; max-width: 88%; padding: 12px 16px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; }
.msg + .msg { margin-top: 12px; }
.msg.you { margin-left: auto; background: rgba(238, 234, 226, 0.12); border-bottom-right-radius: 5px; }
.msg.q { background: rgba(244, 177, 62, 0.1); border: 1px solid rgba(244, 177, 62, 0.22); border-bottom-left-radius: 5px; }
.msg.q p + p { margin-top: 8px; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; background: rgba(244, 177, 62, 0.18); color: #f6c46d; white-space: nowrap; }
.confirm { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.confirm span { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(238, 234, 226, 0.25); }
.confirm span:first-child { background: var(--sun); color: #1b0f05; border-color: transparent; font-weight: 600; }
.chat .note { position: relative; margin-top: 16px; font-size: 12.5px; color: rgba(238, 234, 226, 0.5); }
.points { margin-top: 26px; display: grid; gap: 16px; list-style: none; }
.points li { padding-left: 28px; position: relative; color: var(--ink-sub); }
.points li::before { content: ''; position: absolute; left: 0; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--sun); }
.points strong { color: var(--ink); }

/* Stiftelsen-band */
.foundation { background: var(--night); color: #eeeae2; text-align: center; position: relative; overflow: hidden; }
.foundation::before {
  content: ''; position: absolute; left: 50%; bottom: -560px; width: 900px; height: 900px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 177, 62, 0.42) 0%, rgba(226, 90, 40, 0.16) 38%, transparent 66%);
}
.foundation .wrap { position: relative; }
.foundation .eyebrow { color: #f6c46d; }
.foundation h2.title { margin: 0 auto; color: #f4f1ea; }
.foundation .intro { margin: 18px auto 0; color: rgba(238, 234, 226, 0.75); }
.foundation .actions { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.foundation .btn-ghost { background: transparent; color: #eeeae2; border-color: rgba(238, 234, 226, 0.3); }
.foundation .btn-ghost:hover { color: #fff; border-color: rgba(238, 234, 226, 0.6); }

/* ── Undersidor ───────────────────────────────────────── */
.page-head { padding: clamp(48px, 8vw, 104px) 0 clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(42px, 6vw, 72px); line-height: 1.03; letter-spacing: -0.015em; max-width: 900px; }
.page-head .lead { margin-top: 20px; font-size: clamp(18px, 1.8vw, 21px); color: var(--ink-sub); max-width: 720px; }
.prose { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 110px); }
.prose h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; margin: 56px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; margin: 30px 0 6px; }
.prose p, .prose li { color: var(--ink-sub); }
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { margin: 14px 0 0 22px; display: grid; gap: 8px; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold); font-family: var(--font-serif); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.25; color: var(--ink); }
.callout { margin: 28px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--paper-warm); border: 1px solid var(--line); color: var(--ink-sub); }
.callout strong { color: var(--ink); }
.cards { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { font-size: 15.5px; }
.steps { counter-reset: s; list-style: none; margin-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: #1b0f05; font-weight: 700; font-size: 14px; }

/* ── Sidfot ───────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 48px 0 56px; font-size: 14.5px; color: var(--muted); }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot h4 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.foot ul { list-style: none; display: grid; gap: 6px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .motto { margin-top: 12px; max-width: 300px; }
.foot .fine { margin-top: 36px; font-size: 13px; }

/* ── Mobil ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .promises, .areas { grid-template-columns: 1fr 1fr; }
  .meet { grid-template-columns: 1fr; gap: 40px; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .film { padding: 0 0 32px; }
  .film-frame { width: 100%; margin: 0; }
  .hero-text { padding: 0 16px; }
  .promises, .areas, .cards { grid-template-columns: 1fr; }
  .chat { padding: 20px 16px; border-radius: 18px; }
  .msg { max-width: 94%; }
  .foot .cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Produkterna: "En dag i ditt liv" ─────────────────── */
.flow-intro { padding-bottom: 24px; }
.day-label { margin-top: 36px; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.day-label span { display: inline-block; margin-left: 6px; color: var(--accent); }

.flow { position: relative; }
.ch { --ch-ink: var(--ink); --ch-sub: var(--ink-sub); --ch-glow: rgba(244, 177, 62, 0.28); --ch-bg: var(--paper);
  background: var(--ch-bg); color: var(--ch-ink); padding: clamp(72px, 10vw, 128px) 0; min-height: 88vh; display: flex; align-items: center; }
.ch > .wrap { width: 100%; }
.tone-dawn   { --ch-bg: linear-gradient(180deg, var(--paper) 0%, #fbf1e1 100%); --ch-glow: rgba(244, 160, 62, 0.4); }
.tone-light  { --ch-bg: var(--paper); --ch-glow: rgba(244, 177, 62, 0.22); }
.tone-warm   { --ch-bg: var(--paper-warm); --ch-glow: rgba(226, 90, 40, 0.2); }
.tone-night  { --ch-bg: #0e0c15; --ch-ink: #f1ede6; --ch-sub: rgba(241, 237, 230, 0.7); --ch-glow: rgba(139, 112, 255, 0.35); }
.tone-forest { --ch-bg: #0d1912; --ch-ink: #eef1e9; --ch-sub: rgba(238, 241, 233, 0.72); --ch-glow: rgba(244, 177, 62, 0.3); }
.tone-snow   { --ch-bg: linear-gradient(180deg, #f3f7fa 0%, #e7eff5 100%); --ch-glow: rgba(120, 170, 220, 0.35); }

.ch-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 6vw, 88px); align-items: center; }
.ch.flip .ch-text { order: 2; }
.ch-time { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ch-sub); font-variant-numeric: tabular-nums; }
.ch-time .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 5px rgba(244, 177, 62, 0.18); }
.ch-prod { margin-top: 22px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ch-prod span { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.ch-prod em { font-style: normal; font-size: 14px; color: var(--ch-sub); }
.ch h3 { margin-top: 10px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.05; letter-spacing: -0.012em; }
.ch p { margin-top: 18px; color: var(--ch-sub); font-size: 17.5px; max-width: 520px; }
.ch-points { list-style: none; margin-top: 22px; display: grid; gap: 9px; }
.ch-points li { position: relative; padding-left: 26px; font-size: 15.5px; }
.ch-points li::before { content: ''; position: absolute; left: 0; top: 7px; width: 14px; height: 8px; border-left: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: rotate(-45deg); }
.visit { display: inline-block; margin-top: 26px; font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.tone-night .visit, .tone-forest .visit { color: #f6c46d; }
.ch .status { display: inline-block; margin-top: 26px; }
.tone-night .status, .tone-forest .status { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }

/* Scenen bakom grafiken */
.scene { position: relative; padding: clamp(28px, 4vw, 52px) clamp(18px, 3vw, 40px); border-radius: 30px; isolation: isolate; }
.scene::before { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(70% 70% at 70% 30%, var(--ch-glow), transparent 70%), radial-gradient(60% 60% at 20% 90%, rgba(244, 177, 62, 0.12), transparent 70%); }

/* Appkortet */
.ui { position: relative; max-width: 420px; margin: 0 auto; background: #fff; color: var(--ink); border-radius: 22px; padding: 20px 20px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 60px -20px rgba(23, 20, 15, 0.28), 0 0 0 1px rgba(23, 20, 15, 0.06); font-size: 14.5px; }
.ui > * + * { margin-top: 12px; }
.ui-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.ui-head em { font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; background: rgba(244, 177, 62, 0.16); color: #8a4a0c; white-space: nowrap; }
.ui-dark { background: #17141f; color: #f1ede6; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ui-dark .ui-head em { background: rgba(139, 112, 255, 0.22); color: #cfc3ff; }
.ck { width: 18px; height: 18px; flex: none; fill: none; stroke: #2e8a52; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: #f4f1ea; color: var(--ink-sub); }
.chips span.on { background: var(--sun); color: #1b0f05; font-weight: 600; }
.ui-dark .chips span { background: rgba(255, 255, 255, 0.08); color: rgba(241, 237, 230, 0.8); }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ring svg { width: 72px; height: 72px; margin: 0 auto; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .trk { stroke: #f1ece3; }
.ring .val { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: var(--off); transition: stroke-dashoffset 1.4s var(--ease) calc(var(--d, 0) * 120ms); }
.ring:nth-child(1) .val { stroke: #f4b13e; } .ring:nth-child(2) .val { stroke: #ee8a31; } .ring:nth-child(3) .val { stroke: #e25a28; }
.ring b { display: block; margin-top: 6px; font-size: 15px; } .ring span { font-size: 12px; color: var(--muted); }
.insight { padding: 13px 14px; border-radius: 14px; background: #fff6e8; border: 1px solid rgba(244, 177, 62, 0.4); color: var(--ink-sub); line-height: 1.45; }
.insight b { color: var(--ink); } .insight .chips { margin-top: 10px; }
.foot-row { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #faf8f4; }
.person i { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; background: var(--c); }
.person span { flex: 1; color: var(--ink-sub); line-height: 1.35; } .person b { color: var(--ink); margin-right: 4px; }
.sub-card { border: 1px dashed rgba(23, 20, 15, 0.18); border-radius: 14px; padding: 12px; }
.sub-head { font-weight: 600; font-size: 13px; margin-bottom: 8px; }

.row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1ece3; line-height: 1.4; color: var(--ink-sub); }
.row.todo .ck { stroke: #c9a24b; }
.ui > .row + .row { margin-top: 0; }
.freed .bar-top, .bar .bar-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-sub); margin-bottom: 6px; }
.bar-track { height: 8px; border-radius: 99px; background: #f1ece3; overflow: hidden; }
.bar-track i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--sun); border-radius: inherit; transform-origin: left; transition: transform 1.2s var(--ease) calc(var(--d, 0) * 110ms); }
.bar { --p: 0; } .bar .bar-track i { width: calc(var(--p) * 100%); }
.cal { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #f3f0ff; color: #4a3c8c; font-size: 13.5px; }
.cal span { font-weight: 700; }

.receipt { display: flex; align-items: center; gap: 10px; }
.paper { padding: 10px 12px; background: #fbfaf7; border: 1px solid #ece6db; border-radius: 6px; display: grid; font-size: 12.5px; transform: rotate(-2deg); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06); }
.paper span { color: var(--muted); }
.arrow { color: var(--orange); font-weight: 700; }
.booked { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #2e6b44; background: #eef7f1; padding: 8px 10px; border-radius: 10px; }
.bill { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: #faf8f4; }
.bill em { font-style: normal; color: var(--muted); font-size: 13px; }
.spark { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-sub); }
.spark svg { flex: 1; height: 32px; } .spark path { fill: none; stroke: #2e8a52; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 0; }
.spark b { color: #2e8a52; }

.ask { position: relative; padding: 12px 40px 12px 14px; border-radius: 14px; border: 1.5px solid rgba(226, 90, 40, 0.45); font-weight: 500; }
.ask i { position: absolute; right: 12px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--sun); }
.path { display: flex; align-items: center; gap: 0; padding: 6px 4px; }
.path span { flex: 1; height: 4px; background: #f1ece3; position: relative; }
.path span::after { content: ''; position: absolute; right: -6px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: #f1ece3; }
.path .done { background: var(--gold); } .path .done::after { background: var(--gold); }
.path .now::after { background: #fff; border: 3px solid var(--orange); width: 12px; height: 12px; }
.course { display: grid; gap: 2px; padding: 11px 13px; border-radius: 12px; background: #faf8f4; }
.course span { font-size: 13px; color: var(--muted); }

.closet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--c); display: grid; place-items: center; }
.tile svg { width: 56%; fill: rgba(255, 255, 255, 0.55); stroke: rgba(0, 0, 0, 0.12); stroke-width: 1; }
.tile em { position: absolute; left: 6px; bottom: 6px; font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); color: var(--ink); }
.tile em.hire { background: #f4b13e; color: #1b0f05; } .tile em.new { background: #2e8a52; color: #fff; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats div { padding: 10px 12px; border-radius: 12px; background: #faf8f4; display: grid; }
.stats b { font-size: 17px; } .stats span { font-size: 12px; color: var(--muted); }

.np { display: flex; gap: 14px; align-items: center; }
.np .art { width: 64px; height: 64px; border-radius: 12px; background: radial-gradient(circle at 30% 30%, #f4b13e, #e25a28 55%, #4b2a7a); flex: none; }
.np span { display: block; font-size: 13px; color: rgba(241, 237, 230, 0.6); }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.eq i { flex: 1; border-radius: 2px; background: linear-gradient(to top, #e25a28, #f4b13e); height: 30%; animation: eq 1.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -97ms); }
@keyframes eq { 0% { height: 18%; } 50% { height: 85%; } 100% { height: 35%; } }
.why { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); color: rgba(241, 237, 230, 0.75); line-height: 1.45; }
.why b { color: #fff; }

.ui-map { padding: 0; overflow: hidden; background: #e9eee3; }
.ui-map > * + * { margin-top: 0; }
.map { width: 100%; height: auto; display: block; background: #dfe7d6; }
.map .topo { fill: none; stroke: rgba(70, 100, 60, 0.28); stroke-width: 1.2; }
.map .track { fill: none; stroke: #e25a28; stroke-width: 2.4; stroke-dasharray: 5 5; stroke-linecap: round; }
.map .pass { fill: #fff; stroke: #2d4a2a; stroke-width: 2.5; }
.map .pass.me { fill: var(--gold); stroke: #8a4a0c; }
.map .dog { fill: #e25a28; stroke: #fff; stroke-width: 2; animation: pulse 1.6s ease-in-out infinite; transform-origin: 250px 70px; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.map-card { margin: 12px 14px 0 !important; padding: 10px 12px; border-radius: 12px; background: #fff; display: grid; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.map-card span { font-size: 13px; color: var(--muted); }
.ui-map .stats { margin: 10px 14px 14px !important; }
.ui-map .stats div { background: #fff; }

.peak svg { width: 100%; height: 70px; } .peak path { fill: #c9dbe8; } .peak .snow { fill: #fff; }

/* Avslutningen: Q i mitten */
.orbit { width: min(100%, 440px); margin: 0 auto; overflow: visible; }
.orbit .ring-o { fill: none; stroke: rgba(241, 237, 230, 0.14); stroke-width: 1; stroke-dasharray: 3 6; }
.orbit .spoke { stroke: rgba(244, 177, 62, 0.45); stroke-width: 1.2; stroke-dasharray: 160; stroke-dashoffset: 0; transition: stroke-dashoffset 1s var(--ease) calc(var(--d) * 90ms + 200ms); }
.orbit .node circle { fill: #f4b13e; stroke: #0e0c15; stroke-width: 3; }
.orbit .node text { fill: #f1ede6; font-family: var(--font-ui); font-size: 13px; font-weight: 600; text-anchor: middle; }
.orbit .node { transition: opacity 0.6s var(--ease) calc(var(--d) * 90ms + 400ms); }
.finale { min-height: 80vh; }

/* Animationer när kapitlet syns (bara med JS; utan JS syns allt direkt) */
.js .ch .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease) calc(var(--d, 0) * 90ms), transform 0.8s var(--ease) calc(var(--d, 0) * 90ms); }
.js .ch.in .rv { opacity: 1; transform: none; }
.js .ch .ring .val { stroke-dashoffset: 163.4; }
.js .ch.in .ring .val { stroke-dashoffset: var(--off); }
.js .ch .bar-track i { transform: scaleX(0); }
.js .ch.in .bar-track i { transform: none; }
.js .ch .spark path { stroke-dashoffset: 160; transition: stroke-dashoffset 1.4s var(--ease) 0.5s; }
.js .ch.in .spark path { stroke-dashoffset: 0; }
.js .ch .orbit .spoke { stroke-dashoffset: 160; }
.js .ch.in .orbit .spoke { stroke-dashoffset: 0; }
.js .ch .orbit .node { opacity: 0; }
.js .ch.in .orbit .node { opacity: 1; }
.js .ch .map .track { stroke-dasharray: 5 5; }
.js .ch .scene, .js .ch .ui-map { transform: translateY(26px) scale(0.98); opacity: 0; transition: transform 1s var(--ease), opacity 0.8s var(--ease); }
.js .ch.in .scene, .js .ch.in .ui-map { transform: none; opacity: 1; }

/* Kapitelraden till höger */
.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 5; display: none; flex-direction: column; gap: 4px;
  padding: 10px 8px; border-radius: 999px; background: rgba(253, 253, 253, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(23, 20, 15, 0.08); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.rail a { position: relative; display: grid; place-items: center; width: 18px; height: 18px; text-decoration: none; }
.rail i { width: 7px; height: 7px; border-radius: 50%; background: rgba(23, 20, 15, 0.28); transition: transform 0.25s, background 0.25s; }
.rail span { position: absolute; right: 28px; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ink); background: #fff; padding: 4px 10px; border-radius: 99px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); opacity: 0; transform: translateX(6px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.rail a:hover span, .rail a:focus-visible span, .rail a[aria-current="true"] span { opacity: 1; transform: none; }
.rail a[aria-current="true"] i { background: var(--orange); transform: scale(1.5); }
.in-flow .rail { opacity: 1; pointer-events: auto; }
@media (min-width: 1180px) { .rail { display: flex; } }

@media (max-width: 900px) {
  .ch { min-height: 0; }
  .ch-grid { grid-template-columns: 1fr; gap: 36px; }
  .ch.flip .ch-text { order: 0; }
}
@media (max-width: 600px) {
  .scene { padding: 22px 0; }
  .scene::before { inset: 0 -16px; border-radius: 0; }
  .ui { font-size: 14px; }
}
