/* ==========================================================================
   Vikingplay.se — "Norrsken"
   Implements references/design.md. Read that file before changing anything here.

   Dark canvas, cold light, editorial serif. Borders carry the structure —
   there are no shadows anywhere, because on a near-black canvas a shadow is
   invisible and depth comes from --surface lifting off --night instead.
   ========================================================================== */

:root {
  /* Canvas */
  --night: #0A0F16;
  --surface: #121A24;
  --surface-2: #18232F;
  --line: #1E2A38;
  --line-bright: #2C3E52;

  /* Text */
  --text: #E7EDF3;
  --text-dim: #93A4B6;

  /* Accent — one only. --bone is a warm neutral, --live is reserved. */
  --ice: #5AC8FF;
  --ice-deep: #0E6FA8;
  --ice-glow: rgba(90, 200, 255, .14);
  --bone: #E9E2D4;
  --live: #FF5C5C;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 1150px;
  --gutter: 24px;
  --radius: 3px;
  --radius-lg: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

img { max-width: 100%; height: auto; }

a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8FDBFF; }

:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ice); color: var(--night); padding: 12px 20px;
  font-weight: 700; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* The skip target. `tabindex="-1"` in the markup makes it programmatically
   focusable so activating the skip link actually moves focus, not just scroll.
   The outline is drawn inset — a full-width element with a 2px outset outline
   can push the document's scrollWidth and trip the overflow audit. */
main { display: block; }
main:focus-visible { outline: 2px solid var(--ice); outline-offset: -2px; }

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; }

h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.14;
  margin: 0 0 18px;
}

h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  line-height: 1.22;
  margin: 2.4em 0 .6em;
}

h3 {
  font-family: var(--font-body);
  font-size: 1.15rem; font-weight: 700; letter-spacing: .005em;
  margin: 1.9em 0 .5em;
}

/* Small-caps label headings in the footer columns and the TOC sidebar.
   These are real <h2> elements, not <h4>/<h5>: heading levels must not skip, and
   a card <h3> followed by a footer <h5> jumps a level. They are top-level
   sections of the page, so h2 is both correct and never a skip — only the
   presentation is small. */
footer h2,
aside.toc h2 {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
  line-height: 1.4;
}
aside.toc .related h2 { margin-top: 30px; }

p { margin: 0 0 1.1em; }

.kicker {
  display: block;
  font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--ice);
  margin-bottom: 10px;
}

.lead { font-size: 1.18rem; color: var(--text-dim); max-width: 62ch; }

strong, b { color: #fff; font-weight: 700; }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  background: var(--ice); color: var(--night);
  font: 700 .97rem/1 var(--font-body);
  border: 1px solid var(--ice); border-radius: var(--radius);
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: #8FDBFF; border-color: #8FDBFF; color: var(--night); }

.btn-ghost { background: transparent; color: var(--ice); border-color: var(--line-bright); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ice); color: var(--ice); }

.btn-sm { min-height: 44px; padding: 10px 18px; font-size: .9rem; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */

.topbar {
  background: var(--night);
  border-bottom: 1px solid var(--line);
  font-size: .82rem; color: var(--text-dim);
}
.topbar .container {
  display: flex; align-items: center; gap: 14px;
  min-height: 40px; flex-wrap: wrap;
}
.topbar b { color: var(--text); font-weight: 700; }
.topbar .hl { color: var(--ice); font-weight: 600; }
.topbar .sep { width: 1px; height: 12px; background: var(--line-bright); }

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 22, .92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; gap: 22px; min-height: 68px; position: relative; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-size: 1.28rem; letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand .mark { color: var(--ice); flex-shrink: 0; }
.brand b { color: var(--ice); font-weight: 600; }

.desktop-nav { margin-left: auto; }
.desktop-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
/* Labels must never wrap. A two-line nav item passes an overflow check and still
   looks broken, so the menu collapses to the hamburger instead — see the
   1000px breakpoint below. */
.desktop-nav li { white-space: nowrap; }
/* The hit area is a full 44px tall; the hover underline is drawn by a
   pseudo-element so it still sits tight under the text rather than at the
   bottom of the box. */
.desktop-nav a {
  position: relative;
  display: flex; align-items: center; min-height: 44px;
  color: var(--text-dim); text-decoration: none;
  font-size: .93rem; font-weight: 500;
  transition: color .15s;
}
.desktop-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 10px;
  height: 1px; background: transparent;
  transition: background-color .15s;
}
.desktop-nav a:hover { color: var(--text); }
.desktop-nav a:hover::after { background: var(--ice); }

/* Mobile nav — <details>, no JS. */
.mobile-nav { display: none; margin-left: auto; }
.mobile-nav > summary {
  list-style: none; cursor: pointer;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-bright); border-radius: var(--radius);
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.bars, .bars::before, .bars::after {
  display: block; width: 20px; height: 2px; background: var(--text);
  transition: transform .2s, opacity .2s;
}
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
.mobile-nav[open] .bars { background: transparent; }
.mobile-nav[open] .bars::before { transform: translateY(6px) rotate(45deg); }
.mobile-nav[open] .bars::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-panel {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--night); border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 22px;
}
.mobile-panel ul { list-style: none; margin: 0 0 16px; padding: 0; }
.mobile-panel li { border-bottom: 1px solid var(--line); }
.mobile-panel a {
  display: flex; align-items: center; min-height: 52px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.mobile-panel .btn { width: 100%; }

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 76px 0 68px;
  background:
    radial-gradient(60% 70% at 78% 15%, var(--ice-glow), transparent 70%),
    var(--night);
}
.hero h1 { max-width: 17ch; }
.hero .lead { margin-bottom: 30px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .87rem; color: var(--text-dim); }
.hero .badges span { display: inline-flex; align-items: center; gap: 7px; }
.hero .badges svg { color: var(--ice); flex-shrink: 0; }

/* ── Trust strip ────────────────────────────────────────────────────────── */

.trust { border-bottom: 1px solid var(--line); }
.trust .container { display: grid; grid-template-columns: repeat(5, 1fr); }
.trust .cell { padding: 26px 18px; border-left: 1px solid var(--line); }
.trust .cell:first-child { border-left: 0; padding-left: 0; }
.trust .num {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 600;
  color: var(--text); letter-spacing: -.02em; display: block;
}
.trust .lbl { font-size: .8rem; color: var(--text-dim); }

/* ── Sections, cards, grids ─────────────────────────────────────────────── */

section { padding: 68px 0; }
section.tight { padding: 46px 0; }

.section-head { margin-bottom: 32px; max-width: 62ch; }
.section-head h2 { margin: 0 0 10px; }
.section-head p { color: var(--text-dim); margin: 0; }

.grid { display: grid; gap: 18px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: border-color .15s, background-color .15s;
}
a.card { display: block; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--line-bright); }
a.card:hover { background: var(--surface-2); border-color: var(--ice); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .93rem; }
.card .icon { color: var(--ice); margin-bottom: 14px; display: block; }

/* Post cards on /blogg/ — full-width inside the article column, so they need
   their own top margin rather than the section spacing the grid usually sits in. */
.post-grid { margin: 0 0 34px; }
.post-grid .card { display: flex; flex-direction: column; }
.card-date {
  display: block;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--ice);
  margin-bottom: 10px;
}
.post-grid .card h3 { margin: 0 0 10px; line-height: 1.35; }

/* Topic chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-size: .92rem;
  transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--ice); background: var(--surface-2); color: var(--text); }

/* ── Pricing ────────────────────────────────────────────────────────────── */

.pricing { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  display: flex; flex-direction: column;
}
.plan.popular { border-color: var(--ice); }
.plan h3 {
  margin: 0 0 12px;
  font-size: .78rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .1em;
}
.plan .price {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 600;
  line-height: 1; letter-spacing: -.03em; color: var(--text);
}
.plan .price span { font-size: 1.1rem; color: var(--text-dim); }
.plan .per { font-size: .84rem; color: var(--text-dim); margin: 8px 0 18px; }
.plan ul { list-style: none; margin: 0 0 22px; padding: 0; font-size: .9rem; flex: 1; }
.plan li { padding: 7px 0 7px 20px; position: relative; color: var(--text-dim); border-top: 1px solid var(--line); }
.plan li:first-child { border-top: 0; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 8px; height: 2px; background: var(--ice);
}
.plan .btn { width: 100%; }

.tag {
  position: absolute; top: -1px; right: 16px;
  background: var(--bone); color: var(--night);
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 0 0 var(--radius) var(--radius);
}
.tag-plain { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--line); border-top: 0; }

/* ── Article ────────────────────────────────────────────────────────────── */

.crumbs {
  padding-top: 24px; padding-bottom: 4px;
  font-size: .84rem; color: var(--text-dim);
}
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--ice); text-decoration: underline; }
.crumbs span { margin: 0 8px; }
.crumbs [aria-current] { color: var(--text); margin: 0; }

.article { padding: 8px 0 72px; }
.article .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  align-items: start;
}

/* `.col-main` rather than `<main>`: the single <main id="main"> landmark now wraps
   the whole page in shell.js, so the article's text column is a plain div. */
.col-main { min-width: 0; }
.col-main > p, .col-main > ul, .col-main > ol { max-width: 68ch; }

/* Signature detail: a full-width hairline above every h2, not a coloured left bar. */
.col-main h2 {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 2.4em;
}
.col-main h2:first-of-type { margin-top: 1.6em; }

.article .meta {
  font-size: .84rem; color: var(--text-dim);
  padding-bottom: 20px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.article figure { margin: 0 0 30px; }
.article figure img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); }

.tldr {
  background: var(--surface);
  border: 1px solid var(--line); border-left: 2px solid var(--ice);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 22px 24px; margin: 0 0 30px;
}
.tldr p:last-child { margin-bottom: 0; }

.inline-cta {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px; margin: 32px 0;
  font-size: .96rem; color: var(--text-dim);
}
.inline-cta a { font-weight: 600; }

/* TOC sidebar.
   Specificity note: `aside.toc a` is (0-1-2) and beats a plain `.related a` (0-1-1).
   Anything styling links inside the sidebar must be written at least as strongly. */
aside.toc { position: sticky; top: 88px; font-size: .9rem; }
aside.toc ul { list-style: none; margin: 0 0 30px; padding: 0; }
aside.toc li { border-top: 1px solid var(--line); }
aside.toc li:last-child { border-bottom: 1px solid var(--line); }
aside.toc a {
  display: block; padding: 10px 0;
  color: var(--text-dim); text-decoration: none;
  transition: color .15s;
}
aside.toc a:hover { color: var(--ice); }
aside.toc .related a {
  display: block; padding: 9px 0;
  color: var(--text); text-decoration: none;
  border-top: 1px solid var(--line);
}
aside.toc .related a:hover { color: var(--ice); }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 13px 16px; text-align: left; border-top: 1px solid var(--line); }
thead th {
  border-top: 0; background: var(--surface-2);
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim); white-space: nowrap;
}
tbody tr:nth-child(even) { background: rgba(24, 35, 47, .45); }
td strong { color: var(--text); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--line); margin-bottom: 30px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 18px 40px 18px 0; position: relative;
  font-weight: 600; color: var(--text);
  min-height: 44px; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
/* Chevron rotates 90° — the sibling sites use a "+" rotating 45°. */
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ice); border-bottom: 2px solid var(--ice);
  transform: translateY(-50%) rotate(-45deg);
  transition: transform .15s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 0 20px; color: var(--text-dim); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ── CTA band ───────────────────────────────────────────────────────────── */

.cta-band {
  background: var(--surface);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 52px 0;
}
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 8px; }
.cta-band p { margin: 0; color: var(--text-dim); max-width: 56ch; }

/* ── Related block ──────────────────────────────────────────────────────── */

.related-block { border-top: 1px solid var(--line); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer { border-top: 1px solid var(--line); padding: 56px 0 32px; }
footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
footer .foot-blurb { margin-top: 14px; font-size: .9rem; color: var(--text-dim); max-width: 42ch; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 9px; }
footer li a { color: var(--text-dim); text-decoration: none; font-size: .92rem; }
footer li a:hover { color: var(--ice); }
.legal {
  border-top: 1px solid var(--line); padding-top: 26px;
  font-size: .82rem; color: var(--text-dim); line-height: 1.7;
}

/* ── Breakpoints ────────────────────────────────────────────────────────── */

/* Nav has its own breakpoint, higher than the layout one.
   Seven labels + brand + CTA need roughly 1000px on one line; below that the
   horizontal bar starts wrapping. The rest of the layout is still comfortable in
   two columns down to 900px, so only the menu switches here. */
@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; margin-left: 12px; }
  /* .desktop-nav carried the `margin-left:auto` that pushed everything after the
     brand to the right. With it hidden, the CTA has to take that job or it ends
     up hugging the logo with a gap to its right. */
  .nav > .btn-sm { margin-left: auto; }
}

@media (max-width: 1200px) {
  .desktop-nav ul { gap: 20px; }
  .desktop-nav a { font-size: .89rem; }
}

@media (max-width: 1100px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .plan-trial { grid-column: 1 / -1; }
  footer .cols { grid-template-columns: 1fr 1fr 1fr; }
  footer .cols > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid.g3, .grid.g4 { grid-template-columns: repeat(2, 1fr); }
  .trust .container { grid-template-columns: repeat(3, 1fr); }
  .trust .cell:nth-child(3n+1) { border-left: 0; padding-left: 0; }
  .article .wrap { grid-template-columns: 1fr; gap: 0; }
  aside.toc { position: static; margin-top: 44px; border-top: 1px solid var(--line); padding-top: 28px; }
  .hero { padding: 56px 0 50px; }
  section { padding: 52px 0; }
}

@media (max-width: 560px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .plan-trial { grid-column: auto; }
  .trust .container { grid-template-columns: repeat(2, 1fr); }
  .trust .cell { padding: 20px 14px; }
  .trust .cell:nth-child(3n+1) { border-left: 1px solid var(--line); padding-left: 14px; }
  .trust .cell:nth-child(odd) { border-left: 0; padding-left: 0; }
  .nav > .btn-sm { display: none; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .cta-band .container { flex-direction: column; align-items: flex-start; }
  .topbar .container { min-height: 36px; font-size: .76rem; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
