/* Polaris v4 — redaktionellt observatorium.
   Ett system hela vägen: natthimmel, guld och Cormorant bär varumärket.
   Brödtext i Source Sans 3, bildtexter i Space Mono. Tunna linjer, inga lådor.
   Läsytor svalt ljusa (aldrig creme). */

:root {
  --night: #07090c;
  --night-2: #0d1218;
  --bone: #e8e0d0;
  --bone-2: rgba(232, 224, 208, 0.74);
  --bone-3: rgba(232, 224, 208, 0.5);
  --rule-d: rgba(232, 224, 208, 0.16);
  --gold: #c9a84c;
  --gold-2: #e5c97a;
  --paper: #f3f4f5;
  --white: #ffffff;
  --ink: #121417;
  --ink-2: #464c55;        /* 8.6:1 mot paper */
  --ink-3: #6a707a;
  --rule-l: #d6d9dd;
  --gold-ink: #8a6a17;     /* guld som text på ljust, 5.0:1 */

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --gutter: clamp(18px, 4vw, 56px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: clamp(19px, 1.05rem + .2vw, 21px); line-height: 1.6; overflow-x: hidden; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { font: inherit; color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--gold); color: var(--night); padding: 10px 16px; }
.skip:focus { left: 8px; }

/* Rubriker: Cormorant, rak, aldrig ett kursivt effektord */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; margin: 0; }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; }

/* ── Natthimmel (topp, jobbet, fot) ── */
.sky, .work, .foot { position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: var(--bone); }
.sky { background: var(--night) url(/assets/aurora-poster.jpg) center / cover no-repeat; }
.sky-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }
.sky-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(7,9,12,.6), rgba(7,9,12,.7) 50%, rgba(7,9,12,.94)), radial-gradient(ellipse at 50% 40%, transparent 25%, rgba(7,9,12,.6)); }
.starfield { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.starfield .star { position: absolute; background: #fff; border-radius: 50%; }
.starfield .star.twinkle { animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: var(--star-min, .3); } 50% { opacity: var(--star-max, 1); } }

/* Masthead */
.mast { border-bottom: 1px solid var(--rule-d); }
.mast .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.wordmark { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; letter-spacing: .32em; color: var(--bone); }
.wordmark span { color: var(--gold); }
.mast nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.mast nav a { color: var(--bone-2); text-decoration: none; font-size: .95rem; padding: 10px 0; }
.mast nav a:hover { color: var(--bone); }
.mast nav a.sub { color: var(--gold); border: 1px solid rgba(201,168,76,.6); padding: 9px 16px; }
.mast nav a.sub:hover { background: rgba(201,168,76,.1); }

/* Hero */
.hero { padding: clamp(56px, 8vw, 120px) 0 clamp(64px, 8vw, 120px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: end; }
.hero h1 { font-size: clamp(3rem, 1.4rem + 4.4vw, 6rem); line-height: .98; color: #fff; margin-bottom: 28px; text-wrap: balance; }
.lede { font-size: clamp(1.15rem, 1rem + .45vw, 1.4rem); line-height: 1.5; color: var(--bone-2); max-width: 32em; margin: 0 0 40px; text-wrap: pretty; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.go-main { display: inline-flex; align-items: center; min-height: 56px; padding: 0 26px; background: var(--gold); color: var(--night); text-decoration: none; font-weight: 700; }
.go-main:hover { background: var(--gold-2); }
.find { display: flex; align-items: center; gap: 12px; flex: 1 1 300px; min-width: 0; border-bottom: 1px solid var(--bone-3); }
.find input { flex: 1; min-width: 0; min-height: 56px; background: transparent; border: 0; color: var(--bone); font: inherit; font-size: 1.05rem; }
.find input::placeholder { color: var(--bone-3); }
.find input:focus { outline: none; }
.find:focus-within { border-bottom-color: var(--gold); }
.find button { background: none; border: 0; color: var(--gold); font-weight: 700; min-height: 48px; cursor: pointer; }

/* Figur (instrument) på natthimmel */
.fig { margin: 0; border-top: 1px solid var(--rule-d); padding-top: 22px; }
.fig-sentence { font-family: var(--serif); font-size: clamp(1.7rem, 1.2rem + 1.2vw, 2.4rem); line-height: 1.2; color: #fff; margin: 0 0 26px; min-height: 2.4em; }
.fig-blank { display: inline-block; width: 3.6em; border-bottom: 1px solid var(--bone-2); }
.fig-word { font-family: var(--mono); font-size: .72em; color: var(--gold-2); border-bottom: 1px solid var(--gold); padding: 0 .1em; }
.bars { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3.2em; align-items: center; gap: 14px; font-size: 1rem; color: var(--bone-2); }
.bars .bar { height: 6px; background: rgba(232,224,208,.1); }
.bars .bar span { display: block; height: 100%; background: var(--bone-3); transition: width .35s ease; }
.bars li.chosen { color: #fff; }
.bars li.chosen .bar span { background: var(--gold); }
.bars .pct { font-family: var(--mono); font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; }
.bars li.rest { color: var(--bone-3); }
.dial label { display: flex; justify-content: space-between; font-size: .95rem; color: var(--bone-2); }
.dial output { color: var(--bone); }
.dial input { width: 100%; accent-color: var(--gold); height: 34px; margin: 4px 0 0; }
.dial .ends { display: flex; justify-content: space-between; font-size: .85rem; color: var(--bone-3); }
.fig-act { display: flex; gap: 24px; align-items: center; margin: 22px 0 0; flex-wrap: wrap; }
.line-btn { min-height: 48px; padding: 0 20px; background: transparent; border: 1px solid var(--bone-3); color: var(--bone); cursor: pointer; }
.line-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.text-btn { background: none; border: 0; color: var(--bone-2); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; min-height: 44px; padding: 0; }
.fig-note { color: var(--bone-2); font-size: 1rem; margin: 20px 0 0; }
figcaption.cap { font-family: var(--mono); font-size: .78rem; color: var(--bone-3); margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--rule-d); }

/* ── Ljusa läsytor ── */
.sec { padding: clamp(64px, 9vw, 128px) 0; border-top: 1px solid var(--rule-l); }
.sec:first-of-type { border-top: 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 80px); }
.sec h2 { font-size: clamp(2.2rem, 1.4rem + 2.2vw, 3.6rem); line-height: 1.02; }
.sec .intro { color: var(--ink-2); max-width: 34em; margin: 14px 0 0; }

/* Innehåll (kapitel) */
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.toc > li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--rule-l); }
.toc .n { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--gold-ink); padding-top: 4px; }
.toc h3 { font-size: clamp(1.6rem, 1.2rem + .9vw, 2.1rem); line-height: 1.1; }
.toc h3 a { text-decoration: none; }
.toc h3 a:hover { text-decoration: underline; }
.toc p { margin: 6px 0 0; color: var(--ink-2); }
.toc .parts { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 1rem; }
.toc .parts li + li::before { content: "·"; color: var(--ink-3); margin: 0 12px; }
.toc .parts a { color: var(--ink); }
.toc li.later .n, .toc li.later h3 { color: var(--ink-3); }
.toc li.later .soon { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); margin-left: 12px; vertical-align: middle; }

/* Fallet */
.case { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 100px); align-items: start; margin-top: 48px; }
.fax { background: var(--white); border: 1px solid var(--rule-l); padding: 26px 28px; }
.fax-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: .8rem; color: var(--ink-3); padding-bottom: 12px; border-bottom: 1px solid var(--rule-l); margin-bottom: 16px; }
.fax-meta strong { color: var(--ink); font-weight: 400; }
.fax p { margin: 0; font-size: 1.1rem; line-height: 1.55; }
.fax .url { text-decoration: underline; text-decoration-color: var(--ink-3); word-break: break-all; }
.case-ask { margin: 22px 0 14px; color: var(--ink-2); }
.dark-btn { min-height: 52px; padding: 0 24px; background: var(--ink); color: #fff; border: 0; cursor: pointer; font-weight: 700; }
.dark-btn:hover { background: #2a2f36; }
.review h3 { font-size: 1.55rem; margin: 0 0 10px; }
.review > div + div { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--rule-l); }
.review ul { margin: 0; padding-left: 1.1em; }
.review li { margin: 6px 0; }
.review li::marker { color: var(--gold-ink); }
.review-empty { color: var(--ink-3); border-top: 1px solid var(--rule-l); padding-top: 18px; }

/* Uppslagsverket */
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 48px clamp(32px, 5vw, 72px); margin-top: 48px; }
.entries h3 { font-size: 1.5rem; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.entries ul { list-style: none; margin: 0; padding: 0; }
.entries li { border-bottom: 1px solid var(--rule-l); }
.entries a { display: block; padding: 13px 0; text-decoration: none; line-height: 1.35; }
.entries a:hover { text-decoration: underline; }

/* ── AI på jobbet (natthimmel) ── */
.work { background: radial-gradient(ellipse at 15% 0%, rgba(13,79,74,.4), transparent 60%), radial-gradient(ellipse at 90% 100%, rgba(45,26,74,.35), transparent 55%), var(--night); padding: clamp(72px, 9vw, 128px) 0; }
.work h2 { font-size: clamp(2.4rem, 1.4rem + 2.6vw, 4rem); line-height: 1; color: #fff; margin-bottom: 52px; }
.work h3 { font-size: 1.55rem; color: #fff; margin-bottom: 16px; }
.work-news { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); padding-bottom: 56px; border-bottom: 1px solid var(--rule-d); }
.work-latest { font-family: var(--serif); font-size: clamp(1.7rem, 1.2rem + 1.2vw, 2.4rem); line-height: 1.15; margin: 0 0 22px; }
.work-latest a { text-decoration-color: var(--gold); }
.work-feed { list-style: none; margin: 0 0 18px; padding: 0; }
.work-feed li { border-top: 1px solid var(--rule-d); }
.work-feed a { display: flex; gap: 20px; padding: 14px 0; text-decoration: none; color: var(--bone); }
.work-feed a:hover { color: var(--gold-2); }
.work-feed .d { font-family: var(--mono); font-size: .8rem; color: var(--gold); white-space: nowrap; padding-top: 4px; }
.work-more { color: var(--gold); }
.work-sub { border-top: 1px solid var(--gold); padding-top: 22px; }
.work-when { font-family: var(--mono); font-size: .8rem; color: var(--gold); margin: 0 0 10px; }
.work-sub h3 { font-size: 1.7rem; line-height: 1.15; }
.work-sub p { color: var(--bone-2); }
.work-sub input { display: block; width: 100%; min-height: 54px; margin: 0 0 12px; padding: 0 2px; background: transparent; border: 0; border-bottom: 1px solid var(--bone-3); color: var(--bone); font: inherit; }
.work-sub input::placeholder { color: var(--bone-3); }
.work-sub input:focus { outline: none; border-bottom-color: var(--gold); }
.work-sub input[aria-invalid] { border-bottom-color: #e8875a; }
.work-sub button { margin-top: 8px; min-height: 54px; width: 100%; background: var(--gold); color: var(--night); border: 0; font-weight: 700; cursor: pointer; }
.work-sub button:hover { background: var(--gold-2); }
.work-fine { font-family: var(--mono); font-size: .78rem; color: var(--bone-3) !important; margin-top: 12px; }
.work-lib { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(36px, 6vw, 96px); padding-top: 56px; }
.work-guides, .work-arts { list-style: none; margin: 0; padding: 0; }
.work-guides li, .work-arts li { border-top: 1px solid var(--rule-d); }
.work-guides a { display: block; padding: 18px 0; text-decoration: none; }
.work-guides strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: #fff; line-height: 1.2; margin-bottom: 6px; }
.work-guides span { color: var(--bone-2); font-size: 1rem; }
.work-arts a { display: block; padding: 13px 0; text-decoration: none; color: var(--bone); line-height: 1.35; }
.work-arts a:hover, .work-guides a:hover strong { color: var(--gold-2); }
.work-arts .kat { display: block; font-family: var(--mono); font-size: .72rem; color: var(--gold); margin-bottom: 3px; }
.work-links { margin-top: 20px; }
.work-links a { color: var(--gold); }

/* Om */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 80px); }
.about p { margin: 0 0 16px; max-width: 36em; }
.person { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--rule-l); }
.person h3 { font-size: 1.6rem; }
.person .role { color: var(--ink-3); font-family: var(--mono); font-size: .78rem; margin: 4px 0 14px; }

/* Fot */
.foot { padding: 52px 0 60px; }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; font-size: .95rem; color: var(--bone-2); }
.foot a { color: var(--bone); }

/* Mobil */
@media (max-width: 900px) {
  .mast nav a:not(.sub) { display: none; }
  .hero .wrap, .sec-head, .case, .work-news, .work-lib, .about { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { align-items: start; }
  .go-main { flex: 1 1 100%; justify-content: center; }
  .bars li { grid-template-columns: 5.8em minmax(0, 1fr) 3em; gap: 10px; }
  .toc > li { grid-template-columns: 2.2rem minmax(0, 1fr); gap: 14px; }
  .toc .n { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  .wordmark { font-size: 1.05rem; letter-spacing: .24em; }
  .mast nav a.sub { padding: 8px 12px; font-size: .85rem; }
}

/* Justeringar efter första skärmbilden */
@media (min-width: 901px) { .hero .wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.hero h1 { font-size: clamp(3rem, 1.4rem + 3.5vw, 5.2rem); }
figcaption.cap { color: var(--bone-2); font-size: .82rem; }
.toc .parts li + li::before { content: none; }
.toc .parts li:not(:last-child)::after { content: "·"; color: var(--ink-3); margin: 0 12px; }
.toc li.later .soon { font-size: .8rem; }
.toc .n, .work-feed .d { font-variant-numeric: lining-nums tabular-nums; }

/* Granskning v5 (GPT + Grok eniga): läsbarhet 80+ och färre mono-etiketter.
   Space Mono används nu bara för AI:ns egna ord (valt ord i Fig. 1). */
:root { --bone-2: rgba(232, 224, 208, 0.88); --bone-3: rgba(232, 224, 208, 0.7); }
figcaption.cap { font-family: var(--sans); font-size: .95rem; font-style: normal; }
.bars .pct, .work-feed .d, .work-when, .work-fine, .work-arts .kat, .toc li.later .soon, .person .role, .fax-meta { font-family: var(--sans); letter-spacing: 0; }
.bars li, .bars .pct { font-size: 1.05rem; }
.dial label, .dial .ends { font-size: 1rem; }
.work-feed a, .work-arts a { font-size: 1.08rem; }
.work-feed .d { font-size: .95rem; }
.work-arts .kat { font-size: .9rem; }
.work-guides span { font-size: 1.05rem; }
.work-fine { font-size: .95rem; }
.toc li.later .soon { font-size: .9rem; }
.person .role { font-size: 1rem; }
.fax-meta { font-size: .95rem; }
.entries a { font-size: 1.08rem; }
.toc .parts { font-size: 1.05rem; }
/* Grundstorleken på html så att alla rem-mått följer brödtexten (19–21 px) */
html { font-size: clamp(19px, 1rem + .25vw, 21px); }
body { font-size: 1rem; }
.work-when { font-size: .9rem; }

/* Uppslagsverket på startsidan: sex frågor i två spalter, tunna linjer */
.asks { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); column-gap: clamp(32px, 5vw, 72px); border-top: 1px solid var(--ink); }
.asks li { border-bottom: 1px solid var(--rule-l); }
.asks a { display: block; padding: 18px 0; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.25; }
.asks a:hover { text-decoration: underline; }

/* Polaris i siffror: det som finns att läsa, i en rad */
.facts { background: var(--paper); border-top: 1px solid var(--rule-l); }
.facts .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts a { display: grid; gap: 4px; padding: clamp(28px, 4vw, 48px) 0; text-decoration: none; border-left: 1px solid var(--rule-l); padding-left: clamp(16px, 2.4vw, 32px); }
.facts a:first-child { border-left: 0; padding-left: 0; }
.facts strong { font-family: var(--serif); font-weight: 600; font-size: clamp(2.4rem, 1.6rem + 2vw, 3.6rem); line-height: 1; font-variant-numeric: lining-nums; }
.facts span { color: var(--ink-2); }
.facts a:hover span { text-decoration: underline; }
@media (max-width: 760px) {
  .facts .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts a:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts a:nth-child(n+3) { border-top: 1px solid var(--rule-l); }
}

/* fast sidhuvud: ankarlänkar ska inte hamna under det */
section[id], form[id] { scroll-margin-top: 90px; }
