/* Components and page styles. Use tokens from tokens.css only — see BRAND.md ("Indigo" direction).
   Sections are separated by surface and spacing, never divider lines (BRAND.md §6). */

/* ---------- Type ---------- */
.display {
  font: var(--text-display);
  letter-spacing: -0.035em;
}

h2 {
  font: var(--text-h2);
  letter-spacing: -0.02em;
}

h3 {
  font: var(--text-h3);
  letter-spacing: -0.01em;
}

.lead {
  font-size: 17px;
  max-width: 34em;
}

.label {
  font: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Always Yellow. 6px on light backgrounds so it stays visible; 4px in the photo hero */
.signature-rule {
  display: block;
  width: 64px;
  height: 6px;
  margin-bottom: var(--space-6);
  background: var(--color-accent);
  transform-origin: left center;
}

/* Mobile hero version of the rule (an SVG line that lifts into a roof peak).
   Hidden by default; shown only on phones, see the mobile block. */
.rule-peak {
  display: none;
  overflow: visible;
}

.rule-peak polyline {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 4;
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

/* ---------- Buttons ---------- */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 15px 26px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-soft);
}

.button--small {
  min-height: 44px;
  padding: 0 var(--space-4);
}

.button--secondary {
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.button--secondary:hover {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-surface);
}

.surface-dark .button--secondary,
.card--dark .button--secondary {
  border-color: var(--color-surface);
  color: var(--color-surface);
}

/* Key action: Yellow with Charcoal text, on dark surfaces only (BRAND.md §7) */
.button--key {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-ink);
}

.button--key:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* ---------- Dark surface ---------- */
/* Dark: Indigo, white text, Lavender labels */
.surface-dark,
.card--dark {
  background: var(--color-primary);
  color: var(--color-surface);
}

.surface-dark h2,
.surface-dark h3,
.card--dark h3 { color: var(--color-surface); }

.surface-dark .label,
.card--dark .label { color: var(--color-on-dark-muted); }

.surface-dark :focus-visible,
.card--dark :focus-visible { outline-color: var(--color-surface); }

/* Deep: Charcoal, an optional alternative dark section (no longer the top bar) */
.surface-deep {
  background: var(--color-deep);
  color: var(--color-on-deep-muted);
}

.surface-deep :focus-visible { outline-color: var(--color-surface); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: var(--color-surface);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus { top: var(--space-4); }

/* ---------- Top bar ---------- */
/* Deep indigo strip with Lavender text; sits flush on the Mist header (no gap, no line) */
.top-bar {
  font-size: 13px;
  background: var(--color-primary-deep);
  color: var(--color-on-dark-muted);
}

.top-bar :focus-visible { outline-color: var(--color-surface); }

.top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 38px;
}

.top-bar__contact { font-variant-numeric: tabular-nums; }

/* Above the header (z-index 5), so the email's tap area can reach into the
   header's empty top edge. The bar is its own stacking context (its
   view-transition-name), so this has to be set on the bar, not the link. */
.top-bar {
  position: relative;
  z-index: 6;
}

.top-bar a {
  position: relative;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* 44px tap height without changing the 38px bar: from the top of the bar
   6px down into the header's empty top edge (nothing tappable there) */
.top-bar a::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 44px;
  transform: translateY(calc(-50% + 3px));
}

.top-bar a:hover { color: var(--color-surface); text-decoration: underline; }

@media (max-width: 639px) {
  .top-bar__note,
  .top-bar__email { display: none; }
  .top-bar__inner { justify-content: flex-end; }
}

/* ---------- Header ----------
   Never transparent: solid Mist at every scroll position (BRAND.md §7).
   At the top it sits in normal flow between the top bar and the hero and
   scrolls away with the page. Once it is out of view, scrolling up pins it as
   a compact fixed bar that slides in; scrolling down slides it out again
   (js/main.js). No blur, transparency or shadow. */
.site-header {
  position: relative;
  z-index: 5;
  background: var(--color-ground);
  border-bottom: 1px solid transparent;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 72px;
}

/* The "Kom igång" button never gives way: if the row is too narrow (large
   text), the logo gets smaller instead, keeping its proportions */
.site-header__actions { flex-shrink: 0; }
.site-header .button { white-space: nowrap; }
.site-header .logo { min-width: 0; }

/* Pinned: compact fixed bar, solid Mist with a 1px Line border */
.site-header.is-pinned {
  position: fixed;
  z-index: 7;   /* above the top bar's tap area (the bar itself is out of view by now) */
  top: 0;
  left: 0;
  right: 0;
  border-bottom-color: var(--color-line);
  transition: transform 225ms ease-out;
}

.site-header.is-pinned .site-header__inner { min-height: 64px; }

.site-header.is-pinned.is-hidden:not(:focus-within) { transform: translateY(-100%); }

/* Used by js/main.js while switching between in-flow and pinned */
.site-header.is-instant { transition: none; }

/* While pinned the header is out of the flow; keep its space so nothing jumps */
.site-header.is-pinned + main { margin-top: var(--header-h, 73px); }

/* Official logo files only (BRAND.md §5): logo.svg in the header, logo-white.svg in the footer */
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 40px;
  width: auto;
  /* Never squashed: if the logo has to be narrower than its natural width,
     it scales down inside its box, keeping its proportions */
  object-fit: contain;
  object-position: left center;
}

/* The header logo's <picture> only picks the file (mark-indigo.svg below 320px) */
.logo picture { display: contents; }

/* Below the narrowest phone (200% zoom), the sphere alone (BRAND.md §5, small
   spaces). It sits centred on the button, without the wordmark's optical lift. */
@media (max-width: 319px) {
  .site-header .logo picture img { transform: none; }
}

/* Optical alignment: the wordmark sits at the bottom of the logo file, so lift
   it a little to sit level with the header button (normal and compact header) */
.site-header .logo img { transform: translateY(-5px); }

/* The footer keeps the smaller logo */
.site-footer .logo img { height: 32px; }

/* Right side of the header: the "Om oss" text link, then the "Kom igång" button.
   32px from the link text to the button: the link's own 12px padding plus this gap. */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: calc(var(--space-6) - var(--space-3));
}

/* Quiet text link, styled like the old nav links: Charcoal 15px/500, a 2px
   underline on hover, and a 2px Indigo underline on the current page */
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.header-link:hover,
.header-link[aria-current="page"] { text-decoration-line: underline; }

.header-link[aria-current="page"] { text-decoration-color: var(--color-primary); }

/* Phones: not enough room beside the button at 360px; the footer links to it */
@media (max-width: 639px) {
  .header-link { display: none; }
}

/* ---------- Hero ----------
   Full-width, full-colour photo background (BRAND.md §7, Hero), with a subtle
   dark gradient behind the text for readability and a slow zoom-out on load. */
.hero {
  --hero-copy-w: 600px;
  /* left edge of the content container, measured across the full-width hero */
  --content-left: calc(max(0px, (100% - var(--max-width) - 2 * var(--page-margin)) / 2) + var(--page-margin));
  /* Desktop height: exactly the rest of the first screen below the top bar and
     header, so nothing of the next section shows on load. Their heights come
     from js/main.js (--top-bar-h, --header-h), with the CSS values as fallback.
     At least 580px, at most 960px; min-height, so the content can always grow it. */
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(580px, calc(100vh - var(--top-bar-h, 38px) - var(--header-h, 89px)), 960px);
  min-height: clamp(580px, calc(100svh - var(--top-bar-h, 38px) - var(--header-h, 89px)), 960px);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  overflow: hidden;
  color: var(--color-surface);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero__media picture,
.hero__img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__img {
  object-fit: cover;
  /* both houses fully visible on the right (gables included), sky behind the text */
  object-position: 70% 80%;
}

/* Tablet and desktop: the photo is sized from the hero, anchored bottom-left,
   so that (in the 2880 × 1620 photo, the taller gable's peak sits at 61.9% of
   its height and the left house starts at 43.7% of its width):
   - its height is ~131% of the hero (width 233.3cqh), which puts that peak
     about level with the bottom of the headline, and
   - it is never narrower than the text column ÷ 0.437, so the houses always
     start right of the text (headline, intro, buttons, trust strip).
   The right end of the right-hand house is cropped; both gables stay in view. */
@media (min-width: 768px) {
  .hero__media { container-type: size; }

  .hero__media .hero__img {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: none;
    height: auto;
    width: 125%;
    width: max(100%, 233.3cqh, calc((var(--content-left) + var(--hero-copy-w)) / 0.437));
    transform-origin: 60% 75%;
  }
}

/* Very faint grain over the photo, to hide banding in the smooth sky */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Slow zoom-out (Ken Burns), once on load: only the photo moves */
@media (prefers-reduced-motion: no-preference) {
  .hero__img {
    transform-origin: 70% 80%;
    animation: hero-zoom 18s ease-out both;
    will-change: transform;
  }
}

@keyframes hero-zoom {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}

/* Light darkening so the sky stays bright blue: from the left edge to clear by 50% */
.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 25, 45, 0.3) 0%, rgba(20, 25, 45, 0) 50%);
}

/* Very soft shadow on the smaller text (not the headline) */
.hero .lead,
.hero .trust-strip { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); }

.hero__inner {
  position: relative;
  width: 100%;
}

.hero__copy { max-width: var(--hero-copy-w); }

/* Content on the photo: white text, Yellow details, Lavender trust strip */
.hero h1,
.hero .lead { color: var(--color-surface); }
.hero .dot { color: var(--color-accent); }
.hero .signature-rule { height: 4px; }
.hero .rule-peak polyline { stroke: var(--color-accent); }
.hero .trust-strip { color: var(--color-on-dark-muted); }
.hero :focus-visible { outline-color: var(--color-surface); }

/* Frosted secondary button on the photo: the only frosted or blurred effect
   allowed (BRAND.md §7). Same size, padding and radius as the key button. */
.hero .button--secondary {
  background: rgba(20, 25, 45, 0.35);       /* fallback without backdrop-filter */
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--color-surface);
}

.hero .button--secondary:hover {
  background: rgba(20, 25, 45, 0.5);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--color-surface);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero .button--secondary {
    background: rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .hero .button--secondary:hover { background: rgba(255, 255, 255, 0.24); }
}

.hero__copy .display { margin-bottom: var(--space-5); }
.hero__copy .lead { margin-bottom: var(--space-6); }

.trust-strip {
  list-style: none;
  padding: 0;
  margin-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--color-muted);
}

.trust-strip li + li::before {
  content: "·";
  padding: 0 var(--space-2);
}

/* Phones: stack the facts instead of wrapping mid-line */
@media (max-width: 639px) {
  .trust-strip { flex-direction: column; gap: var(--space-1); }
  .trust-strip li + li::before { content: none; }
}

/* ---------- Scroll cue (desktop hero) ----------
   A minimal "mouse": a 22 × 34px rounded outline (1.5px Lavender at 70%) with
   a 4px Yellow dot that slides down ~8px and fades, every 2s. Bottom left, on
   the text's left edge, 40px above the hero's bottom edge. The button is a
   44px tap area centred on the icon. Needs JavaScript (fade-out and click),
   so it only shows with .js. Hidden on mobile. */
.scroll-cue { display: none; }

@media (min-width: 1024px) {
  .js .scroll-cue {
    --cue-bottom: 40px;
    position: absolute;
    /* 11px of the 44px tap area sits left of the icon, so the icon meets the text edge */
    left: calc(var(--content-left) - 11px);
    bottom: calc(var(--cue-bottom) - 5px);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: opacity 300ms ease-out, visibility 0s linear 300ms;
  }

  .scroll-cue:focus-visible { outline: 2px solid var(--color-surface); outline-offset: 2px; }

  .scroll-cue.is-gone {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* Lavender (#D1C9E9) at 70%; the one fully rounded shape on the site */
  .scroll-cue__mouse {
    position: relative;
    display: block;
    width: 22px;
    height: 34px;
    border: 1.5px solid rgba(209, 201, 233, 0.7);
    border-radius: 11px;
  }

  /* 5px dot, centred horizontally, starting near the top of the outline */
  .scroll-cue__wheel {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-accent);
  }

  /* Short screens: sit a little lower to keep clear space below the trust strip */
  @media (max-height: 800px) {
    .js .scroll-cue { --cue-bottom: 24px; }
  }
}

/* Every 2s: the dot appears at the top (0–10%), slides down 12px with
   ease-in-out (10–75%), stays fully visible for the first 70% of that travel
   (reached at 50.3% of the cycle, because of the easing) and fades out over
   the last 30%, then rests until it reappears at the top. Movement and fade
   are separate animations so the fade doesn't bend the easing. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .scroll-cue__wheel {
    animation:
      cue-wheel-move 2s ease-in-out infinite,
      cue-wheel-fade 2s linear infinite;
  }
}

@keyframes cue-wheel-move {
  0%, 10% { transform: translateY(0); }
  75%, 100% { transform: translateY(12px); }
}

@keyframes cue-wheel-fade {
  0% { opacity: 0; }
  10%, 50.3% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

/* ---------- Photo pair (between the hero and "Två vägar in") ----------
   Two equal 4:3 photos on the content container, 24px apart; stacked on mobile.
   Static: no animation. */
/* The next section starts one spacing step closer than the standard section
   gap: 48px here plus its own top padding (on phones its top padding is 64px) */
.photo-pair {
  padding-top: var(--space-8);
  padding-bottom: var(--space-7);
}

.photo-pair__grid {
  display: grid;
  gap: var(--space-4);
}

.photo-pair__item {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
}

.photo-pair__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the roofer (lift basket and the gable he works on) is centred in his photo; keep the couple and front door in frame */
.photo-pair__item--roofer img { object-position: 50% 50%; }
.photo-pair__item--homeowners img { object-position: 45% 60%; }

@media (min-width: 768px) {
  .photo-pair__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--gutter);
  }
}

/* ---------- Sections ---------- */
.section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section__head { margin-bottom: var(--space-7); }
.section__head .label { margin-bottom: var(--space-3); }

/* ---------- Audience cards ---------- */
.cards {
  display: grid;
  gap: var(--space-5);
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius);
}

.card--raised {
  background: var(--color-surface);
  border: var(--border);
}

.card__title {
  font: var(--text-h2);
  letter-spacing: -0.02em;
  max-width: 16em;
}

/* Large text and zoom: the cards stay as wide as the screen and their text wraps */
.cards > * { min-width: 0; }

.card p:not(.label) { max-width: 32em; }

.card .button { margin-top: auto; }

.check-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 var(--space-5);
  display: grid;
  gap: var(--space-3);
  color: var(--color-ink);
}

.card--dark .check-list { color: var(--color-surface); }

.check-list li {
  position: relative;
  padding-left: var(--space-6);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

/* ---------- Steps ----------
   Each step's number sits in a 48px Indigo outline circle (2px stroke, 18px/500
   number), like the form confirmation's checkmark circle. A 1px Line connector
   joins each circle to the next, running edge to edge and never inside a circle.
   Stacked (phones, and the signup page's side column): a small vertical
   timeline, the circle on the left, title and text beside it, the title's first
   line centred on the circle. Side by side (.steps--row from 768px): circles in
   a row with a horizontal connector, the title 16px below the circle.
   The visible number is aria-hidden; each title starts with a visually hidden
   "Steg n:", and role="list" keeps the list in Safari. */
.steps {
  --steps-gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--steps-gap);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  align-content: start;
}

.step > :not(.step__num) { grid-column: 2; }

.step__num {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

/* First line of the title (18px at 1.3) centred on the circle */
.step__title { margin-top: calc((48px - 1.3em) / 2); }

.step p { max-width: 28em; }

/* Connector: from the bottom of this circle to the top of the next */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 48px;
  bottom: calc(-1 * var(--steps-gap));
  left: 23.5px;
  width: 1px;
  background: var(--color-line);
}

/* Titles break into even lines; step text never ends on a lone word */
.steps--row .step__title { text-wrap: balance; }
.steps--row .step p { text-wrap: pretty; }

@media (min-width: 768px) {
  .steps--row {
    --steps-gap: var(--gutter);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .steps--row .step {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
  .steps--row .step__num { margin-bottom: var(--space-2); }
  .steps--row .step__title { margin-top: 0; }
  /* Connector: from the right edge of this circle to the left edge of the next */
  .steps--row .step:not(:last-child)::after {
    top: 23.5px;
    bottom: auto;
    left: 48px;
    right: calc(-1 * var(--steps-gap));
    width: auto;
    height: 1px;
  }
}

/* "Så fungerar det" (index.html): the heading block and a short intro above the
   steps; from 1024px the heading block sits on the left (27% of the row, at
   most 320px: just wide enough for the h2 on one line at 1440) and the steps
   take the rest, 96px from it and 48px apart, so the heading reads as its own
   group rather than a fourth column; the label's
   cap height level with the top of the circles. The h2 balances any break
   (text-wrap: balance on all headings, base.css). */
.how__intro {
  margin-top: var(--space-4);
  max-width: 34em;
  color: var(--color-ink-soft);
  text-wrap: pretty;
}

@media (min-width: 1024px) {
  .how {
    display: grid;
    grid-template-columns: minmax(0, min(320px, 27%)) minmax(0, 1fr);
    column-gap: var(--space-9);
    align-items: start;
  }
  .how .how__head { margin-bottom: 0; }
  .how .steps--row { --steps-gap: var(--space-7); }
  .how__head .label { text-box: trim-start cap alphabetic; }
}

/* ---------- About ---------- */
.about {
  display: grid;
  gap: var(--space-7);
}

/* Stacked layout: tile graphic above the text, so the roof is laid in view
   before the text reaches reading position */
@media (max-width: 1023px) {
  .about .tile-art { order: -1; }
}

.about__copy .label { margin-bottom: var(--space-3); }
.about__copy h2 { margin-bottom: var(--space-5); }
.about__copy p + p { margin-top: var(--space-4); }
.about__copy p:not(.label) { max-width: 34em; }

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: var(--space-5);
  background: var(--color-line);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Page intro (subpages) ---------- */
.page-intro { padding-top: var(--space-7); }
.page-intro--last { padding-bottom: var(--space-9); }

.page-intro .label { margin-bottom: var(--space-3); }
.page-intro .display { margin-bottom: var(--space-5); }

/* 404 page (404.html): the page intro with a button and a text link below the text */
.not-found .button-row {
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

/* ---------- Om oss (om-oss.html) ----------
   Every text section sits in one 720px column on the container's left edge,
   with its h2 above the content. Only the "Så arbetar vi" cards run the full
   container width. Sections sit 96px apart at every screen size, and a
   heading sits 24px above its content. */
.section.section--compact {
  padding-top: var(--space-9);
  padding-bottom: 0;
}

/* The closing band sits the same 96px below the last section */
.section--compact + .cta-band { margin-top: var(--space-9); }

.column { max-width: 720px; }

.column-head { margin-bottom: var(--space-5); }

/* Short Slate line with a link: under "Vanliga frågor" here, and under the
   FAQ on kom-igang.html (.form-page__faq-more) */
.column-head__note,
.form-page__faq-more {
  font: var(--text-small);
  color: var(--color-muted);
}

.column-head__note { margin-top: var(--space-2); }

/* Inline link; the tap area reaches 44px without changing the line */
.column-head__note a,
.form-page__faq-more a,
.prose p a {
  position: relative;
  color: var(--color-primary-soft);
  text-underline-offset: 3px;
}

.column-head__note a:hover,
.form-page__faq-more a:hover,
.prose p a:hover { color: var(--color-primary); }

.column-head__note a::after,
.form-page__faq-more a::after,
.prose p a::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

/* Links in running text and email addresses break instead of running off the screen */
.prose a,
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* Intro: text left, CEO portrait right on the container's edge, the text
   centred on the photo. Stacked below 1024px: text, then the portrait. */
.intro-split {
  display: grid;
  gap: var(--space-6);
}

/* The intro paragraph a little wider than a .lead elsewhere: as wide as it can
   be while lines stay within about 75 characters */
.intro-split .lead { max-width: 36.5em; }

/* The inner-page h1, as on Kom igång */
.intro-split h1 {
  font: var(--text-h1);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

/* Facts under the intro text: the hero trust line, in Slate on the light
   background, no wider than the intro paragraph (36.5em at 17px), so it
   wraps between facts. Each wrapped line's leading dot falls in a strip left
   of the text that is clipped away. Phones stack it, as in the hero. */
@media (min-width: 768px) {
  .trust-strip--wrap {
    /* the dot with 8px either side, as in the hero (the dot is ~0.29em wide) */
    --dot-w: calc(2 * var(--space-2) + 0.29em);
    max-width: calc(36.5 * 17px + var(--dot-w));
    margin-left: calc(-1 * var(--dot-w));
    clip-path: inset(0 0 0 var(--dot-w));
  }

  .trust-strip--wrap li::before,
  .trust-strip--wrap li + li::before {
    content: "·";
    display: inline-block;
    width: var(--dot-w);
    padding: 0;
    text-align: center;
  }
}

/* CEO portrait: the 2:3 photo shown 4:5 with the face in the upper third,
   caption below in small type. Stacked: 70% wide, at most 300px. */
.portrait { width: min(70%, 300px); }

.portrait__img {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-line);
}

.portrait__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.portrait figcaption {
  margin-top: var(--space-3);
  font: var(--text-small);
  font-weight: 500;
}

/* Story: running text, closing with the CEO quote */
.prose p {
  font-size: 17px;
  text-wrap: pretty;
}

.prose p + p { margin-top: var(--space-4); }

/* Longer running text (integritet.html): h2 sections 48px apart, 16px above
   their content; plain bulleted lists in the same size as the text; bold at 600 */
.prose * + h2 { margin-top: var(--space-7); }
.prose h2 + * { margin-top: var(--space-4); }
.prose ul {
  font-size: 17px;
  padding-left: 1.25em;
}
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--color-ink-soft); }
.prose p + ul { margin-top: var(--space-2); }
.prose ul + p { margin-top: var(--space-5); }
.prose .column-head__note + p { margin-top: var(--space-5); }
.prose strong { font-weight: 600; }

/* Pull quote: one step below h2, Charcoal with Indigo quote marks, no box.
   64px above it, so it reads as its own moment after the story. */
.pull-quote { margin-top: var(--space-8); }
.pull-quote__mark { color: var(--color-primary); }
.pull-quote blockquote { margin: 0; }

.pull-quote blockquote p {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.pull-quote figcaption {
  margin-top: var(--space-3);
  font: var(--text-small);
  color: var(--color-muted);
}

/* FAQ: native details/summary. Each group reads as one block, with a Line
   border above, between and below its questions; an Indigo plus/minus. */
.faq__group + .faq__group { margin-top: var(--space-7); }
.faq__group .label { margin-bottom: var(--space-3); }

.faq__item { border-top: var(--border); }
.faq__item:last-child { border-bottom: var(--border); }

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
  padding: var(--space-4) 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-ink);
  list-style: none;
  cursor: pointer;
}

.faq__item summary::-webkit-details-marker { display: none; }

/* Large text and zoom: the question wraps, so the icon stays on screen */
.faq__item summary > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.faq__icon {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  background: var(--color-primary);
}

/* Two 2px bars: horizontal (::before) and vertical (::after) */
.faq__icon::before { left: 0; right: 0; top: 6px; height: 2px; }
.faq__icon::after { top: 0; bottom: 0; left: 6px; width: 2px; }

/* Open: the vertical bar lies flat and fades into the horizontal one, so the
   plus becomes a minus. js/main.js animates the change (setupFaq). */
.faq__item[open]:not(.is-closing) .faq__icon::after {
  rotate: 90deg;
  opacity: 0;
}

/* Closing: the <details> is already closed (so screen readers hear it at
   once), but its answer stays rendered until it has slid shut */
.faq__item.is-closing::details-content { content-visibility: visible; }

/* The answer runs the column width, clear of the icon (14px) and its gap */
.faq__answer {
  padding-right: calc(14px + var(--space-4));
  padding-bottom: var(--space-5);
}


/* ---------- Form page (kom-igang) ----------
   One two-column section: intro, extras and FAQ on the left, form on the
   right. Mobile order: intro, form, extras, FAQ. */
.form-page {
  padding-top: var(--space-7);
  padding-bottom: var(--space-9);
}

.form-page__grid {
  display: grid;
  gap: var(--space-7);
}

/* Mobile: let intro, form, extras and FAQ order themselves in the grid */
.form-page__aside { display: contents; }
.form-page__intro { order: 1; }
.form-page__form { order: 2; }
.form-page__extra { order: 3; }
.form-page__faq { order: 4; }

.form-page__intro .label { margin-bottom: var(--space-3); }

.form-page__intro h1 {
  font: var(--text-h1);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.form-page__extra .label { margin-bottom: var(--space-5); }
.form-page__extra .check-list { margin: 0; }

/* FAQ below the extras: the om-oss.html accordion as a quieter, secondary
   addition. Twice the column's block gap above it (this margin plus the grid
   gap: 96px; 64px on phones), and 15px Charcoal Soft questions with a 12px icon. */
.form-page__faq { margin-top: var(--space-7); }
.form-page__faq .label { margin-bottom: var(--space-3); }
.form-page__faq-more { margin-top: var(--space-4); }

.faq--compact .faq__item summary {
  font-size: 15px;
  color: var(--color-ink-soft);
}

.faq--compact .faq__icon { width: 12px; height: 12px; }
.faq--compact .faq__icon::before { top: 5px; }
.faq--compact .faq__icon::after { left: 5px; }

.faq--compact .faq__answer {
  font-size: 15px;
  padding-right: calc(12px + var(--space-4));
}

/* Steps in a side column: the stacked timeline, a little tighter */
.steps.steps--compact { --steps-gap: var(--space-5); }
.steps--compact .step { row-gap: var(--space-1); }

.form-card {
  display: block;
  padding: var(--space-5);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: var(--space-5);
}

.form__row {
  display: grid;
  gap: var(--space-5);
}

/* Large text and zoom: everything in the form can get narrower than its
   content, so fields shrink to the card; long words in labels break */
.form > *,
.form__row > *,
fieldset.signup__pane > * { min-width: 0; }

.field label,
.field legend,
.choice__label,
.form__switch-note { overflow-wrap: anywhere; }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
}

.field legend { margin-bottom: var(--space-2); }

.field__optional {
  font-weight: 400;
  color: var(--color-muted);
}

/* Text inputs, selects and textareas share one look (BRAND.md §7 Forms) */
.field :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-3);
  border: var(--border);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-size: 16px;
}

.field textarea {
  padding: var(--space-3);
  line-height: 1.5;
  resize: vertical;
}

/* Select: native control with a simple Charcoal down-arrow */
.field select {
  appearance: none;
  padding-right: var(--space-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20' fill='none' stroke='%232E2D2D' stroke-width='4'%3E%3Cpath d='M4 4 L20 16 L36 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 16px 8px;
  cursor: pointer;
}

.field select:has(option[value=""]:checked) { color: var(--color-muted); }
.field select option { color: var(--color-ink); }

.field :is(input, textarea)::placeholder { color: var(--color-muted); }

.field :is(input:not([type="checkbox"], [type="radio"]), select, textarea):focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
}

.field [aria-invalid="true"]:is(input, select, textarea) { border-color: var(--color-error); }

/* Follow-up field revealed by a choice (e.g. "Annat") */
.field--sub { margin-top: calc(-1 * var(--space-2)); }

/* Segmented choices: real radio inputs, shown as option buttons */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice {
  position: relative;
  flex: 1 1 auto;
  display: flex;
}

.choice__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.choice__label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: var(--border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.choice__input:hover + .choice__label { border-color: var(--color-ink); }

.choice__input:checked + .choice__label {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-surface);
}

.choice__input:focus-visible + .choice__label {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.choice__input[aria-invalid="true"]:not(:checked) + .choice__label { border-color: var(--color-error); }

/* Two equal columns (Vad behöver göras?): two options side by side, four as a 2×2
   grid; a column only grows past half when a label needs it */
.choices--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(max-content, 1fr));
}

@media (max-width: 639px) {
  .choices { flex-direction: column; }
  .choices--grid { grid-template-columns: 1fr; }
}

.field__hint {
  font-size: 14px;
  color: var(--color-muted);
}

.field__error {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-error);
}

.field--check {
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  align-items: start;
}

.field--check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.field--check label {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-ink-soft);
  cursor: pointer;
}

.field--check label a {
  position: relative;
  color: var(--color-primary-soft);
  text-underline-offset: 3px;
}

/* 44px tap height, as the footer links. It reaches down, into the space
   before the submit button, not up over the label text (which ticks the box). */
.field--check label a::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: -2px;
  height: 44px;
}

.field--check .field__error { grid-column: 1 / -1; }

/* Optional yes/no question as a checkbox (kom-igang.html, uppmätning): the consent
   checkbox with a Charcoal 500 label, followed by a "?" with a popup (.info-tip).
   The label's hit area reaches 44px high and covers the box too; the "?" sits
   above it. A word joiner in the HTML keeps the "?" with the label's last word;
   on narrow phones the label wraps into two balanced lines. */
.field--option { position: relative; }

.field__check-text {
  position: relative;
  text-wrap: balance;
}

.field--option label {
  font-weight: 500;
  color: var(--color-ink);
}

.field--option label::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-20px - var(--space-3));
  right: 0;
  min-height: 44px;
  height: 100%;
  transform: translateY(-50%);
}

/* "?" with a short explanation in a popup (js/main.js, setupTips) */
.info-tip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  background: none;
  color: var(--color-primary);
  font: 500 12px/1 var(--font-sans);
  vertical-align: middle;
  cursor: pointer;
}

/* 44 × 44px tap area, mostly to the right, so it doesn't cover the label text */
.info-tip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
}

.info-tip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.info-tip__popup {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: max-content;
  /* js/main.js sets the real limit when it shows (the form's width); while
     hidden it stays within its field, so it never widens the page (zoom) */
  max-width: min(260px, 100%);
  padding: var(--space-3) 14px;
  border-radius: var(--radius);
  background: var(--color-ink);
  color: var(--color-surface);
  font: var(--text-small);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 75ms, visibility 0s 75ms;
}

.info-tip__popup.is-shown {
  opacity: 1;
  visibility: visible;
  transition: opacity 120ms;
}

/* Arrow to the "?" (--tip-arrow: its centre, from the popup's left edge) */
.info-tip__popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tip-arrow, 50%);
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--color-ink);
  border-bottom: 0;
}

.info-tip__popup.is-below::after {
  top: auto;
  bottom: 100%;
  border-top: 0;
  border-bottom: 6px solid var(--color-ink);
}

/* Without JavaScript: shown above the field on hover or focus */
html:not(.js) .info-tip__popup {
  top: auto;
  bottom: calc(100% + var(--space-2));
  left: calc(20px + var(--space-3));
}
html:not(.js) .field--option:has(.info-tip:is(:hover, :focus-visible)) .info-tip__popup {
  opacity: 1;
  visibility: visible;
}

.form__submit { width: 100%; }

.form__note {
  font-size: 14px;
  color: var(--color-muted);
}

/* Confirmation in place of the form (js/main.js, showDone): an Indigo circle and
   checkmark that draw in once, the heading, one line and a way back to the start page */
.form-done__mark {
  width: 56px;
  margin-bottom: var(--space-5);
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2;
}

/* The checkmark: a touch heavier than the circle, with rounded ends and corner */
.form-done__mark path {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-done h3 { margin-bottom: var(--space-2); }
.form-done h3:focus { outline: none; }
.form-done p { color: var(--color-ink-soft); }
.form-done p + p { margin-top: var(--space-2); }
/* The link's 44px tap height leaves room below its text: keep the card's space
   below the link about the same as above the circle */
.form-done p:last-child { margin-bottom: calc(-1 * var(--space-2)); }

/* ---------- Combined signup page (kom-igang) ----------
   A Husägare | BRF | Takläggare switch above the two columns shows one side at a time:
   intro, extras and form (js/main.js, setupSignup). The switch is a radio
   group styled like the option buttons. Switching fades the side being left
   out (75ms) and the other in (150ms); the switch, the signature rule and the
   card itself stay put. */

/* No scroll anchoring: js/main.js keeps the control that was used in place */
:root:has(.signup) { overflow-anchor: none; }

.audience-switch {
  min-width: 0;
  margin: 0 0 var(--space-7);
  padding: 0;
  border: 0;
}

/* Small and left-aligned: each option only as wide as its label, 8px apart.
   Smaller than the form's choice buttons (44px, 14px text), same colours. */
.audience-switch__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.audience-switch .choice { flex: 0 0 auto; }

.audience-switch .choice__label {
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  font-size: 14px;
}

/* 18px outline icons before the labels (inline SVG, currentColor):
   Indigo on unselected options, white on the selected one */
.audience-switch__icon {
  flex: none;
  color: var(--color-primary);
}

.audience-switch .choice__input:checked + .choice__label .audience-switch__icon { color: inherit; }

/* Two columns: never wider than the left column (5fr of 12, 64px gap),
   so it always ends before the form card */
@media (min-width: 1024px) {
  .audience-switch { max-width: calc((100% - var(--space-8)) * 5 / 12); }
}

/* Narrowest two-column widths: one padding step less, so the three options
   with their icons still fit the left column on one line */
@media (min-width: 1024px) and (max-width: 1079px) {
  .audience-switch .choice__label { padding: 0 var(--space-3); }
}

/* Narrow phones: a third of the width can't hold "Takläggare" and its icon
   with room to spare, so the labels show on their own */
@media (max-width: 409px) {
  .audience-switch__icon { display: none; }
}

/* Phones: full width, the three options sharing it equally */
@media (max-width: 767px) {
  .audience-switch { margin-bottom: var(--space-6); }
  .audience-switch__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* Labels are centred, so the padding only matters on the narrowest phones */
  .audience-switch .choice__label { padding: 0 var(--space-1); }
}

/* Large text and zoom: when the three labels no longer fit side by side, the
   options stack, full width and 44px high, instead of overlapping. The limit is
   in em, so it grows with the text: at normal text size it is 272px, the
   switch's width on a 320px phone, where the row still fits. The container is
   the page's .container around the switch (same width on phones), not the
   fieldset: Chrome doesn't scale em with a fieldset's text size here. */
.signup > .container { container: signup / inline-size; }

@container signup (width < 17em) {
  .audience-switch__options { grid-template-columns: minmax(0, 1fr); }
}

/* The switch needs JavaScript; without it the page shows the Husägare side */
html:not(.js) .audience-switch,
html:not(.js) .form__switch-note { display: none; }

.signup__pane { transition: opacity 150ms ease-out; }

.signup.is-switching .signup__pane {
  opacity: 0;
  transition-duration: 75ms;
}

/* The fieldsets around the three forms only group them, to disable the hidden ones */
fieldset.signup__pane {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Compact form: 16px between fields, short fields paired from 640px (.form__row) */
.form--compact,
.form--compact .form__row { gap: var(--space-4); }

.form__switch-note {
  font: var(--text-small);
  color: var(--color-muted);
}

/* Submit with its note beside it (below it when the button is full width) */
.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-2);
}

/* A button that reads as a link. The tap area reaches 44px without changing the line. */
.link-button {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary-soft);
  text-align: start;   /* reads as text when it wraps (large text) */
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover { color: var(--color-primary); }

/* In running text (e.g. "Cookie-inställningar" in the privacy policy) it looks like the text links around it */
.prose .link-button { color: inherit; }
.prose .link-button:hover { color: var(--color-primary); }

.link-button::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

/* A standalone text link (e.g. "Läs mer om oss"), with a 44px tap height */
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  color: var(--color-primary-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover { color: var(--color-primary); }

/* Photo box: image fills the box and is cropped to fit */
.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-line);
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Tone the photo down (unused placeholder style) */
  filter: saturate(0.8) brightness(0.92);
}

/* Tile illustration (Om oss): nine roof tiles with drawn shadows, inlined from
   assets/images/WS_Roof_Tiles_Illustration.svg, straight on the section
   background. main.js lays it tile by tile on scroll. */
.tile-art svg {
  width: 88%;          /* leaves room beside it for tiles sliding in */
  margin-inline: auto;
  overflow: visible;   /* tiles start up the slope, partly outside the drawing */
}

/* Side by side: 77.7% of the column wide, the tiles' centre on the text block's
   centre (label to last line), and 40px right of the centre of the space from
   the text's longest line to the container's right edge: main.js measures that
   line and sets --tile-art-left; until then this works from the paragraphs' box
   edge (34em, var(--space-8) being the column gap). The drawing fills its
   viewBox, so placing the svg places the tiles. The figure takes the text's
   height; the illustration may overhang it. */
@media (min-width: 1024px) {
  .about .tile-art {
    position: relative;
    align-self: stretch;
  }
  .tile-art svg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--tile-art-left, calc((min(34em, 100%) - var(--space-8) - 77.7%) / 2 + 40px));
    width: 77.7%;
    margin: auto 0;
  }
  /* As much space below the section as above, so the block sits centred in it
     and an overhang clears the dark band as it clears the section above */
  .section:has(> .about) { padding-bottom: var(--space-9); }
}

.tile-art g,
.tile-art__shadow { transform-box: fill-box; }

.tile-art__tile > * {
  stroke: var(--color-tile-line);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-art__face { fill: var(--color-surface); }
.tile-art__accent { fill: var(--color-accent); }
.tile-art__side { fill: var(--color-tile-side); }
.tile-art__side-light { fill: var(--color-tile-side-light); }
.tile-art__accent-side { fill: var(--color-tile-accent-side); }
.tile-art__line { fill: none; }

/* Part of the artwork, not a UI shadow. Each sits in a mask holding a copy of
   the tile it falls on (white = show), so it only shows on that tile. */
.tile-art__shadow {
  fill: var(--color-tile-line);
  opacity: 0.5;
}

.tile-art__mask {
  fill: #fff;
  stroke: #fff;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Closing CTA band ---------- */
.cta-band {
  margin-top: var(--space-8);
  padding-top: var(--space-9);
  padding-bottom: var(--space-8);
}

.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
}

.cta-band h2 { margin-bottom: var(--space-3); }

/* ---------- Footer ---------- */
.site-footer {
  padding-bottom: var(--space-6);
}

/* Divider between the CTA band and the footer, aligned to the content edge */
.site-footer__grid {
  position: relative;
  padding-top: var(--space-8);
}

.site-footer__grid::before {
  content: "";
  display: var(--footer-divider, block);
  position: absolute;
  top: 0;
  left: var(--page-margin);
  right: var(--page-margin);
  border-top: 1px solid var(--color-divider-dark);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-6);
}

.site-footer__tagline {
  margin-top: var(--space-3);
  font-size: 15px;
  color: var(--color-on-dark-muted);
}

.site-footer .label { margin-bottom: var(--space-2); }

.footer-list {
  list-style: none;
  padding: 0;
  font-size: 15px;
  color: var(--color-surface);
}

.footer-list li { min-height: 44px; display: flex; align-items: center; }

.footer-list a {
  position: relative;
  color: var(--color-surface);
  text-decoration: none;
}

/* 44px tap height, as "Integritetspolicy" below: the 24px line plus 10px
   either side, within its own 44px row */
.footer-list a::after {
  content: "";
  position: absolute;
  inset: -10px -4px;
}

.footer-list a:hover { text-decoration: underline; }

.site-footer__base {
  margin-top: var(--space-8);
  font-size: 14px;
  color: var(--color-on-dark-muted);
}

body:not(:has(.cta-band)) { --footer-divider: none; }

/* Bottom row: "Integritetspolicy" and "Cookie-inställningar" (reopens the
   cookie settings, js/consent.js) after the copyright, as a pair that wraps
   together. They read like the row's text; each tap area reaches 44px. */
.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-5);
  row-gap: var(--space-2);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-5);
}

.site-footer__link {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.site-footer__link:hover {
  color: var(--color-surface);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__link::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}

/* Needs JavaScript, like the banner itself */
html:not(.js) .site-footer__cookies { display: none; }

/* While the cookie banner shows, the page can scroll everything clear of it
   and focus never lands behind it (--cc-reserve: the banner's height plus its
   gap to the bottom edge, set by js/consent.js) */
html { scroll-padding-bottom: var(--cc-reserve, 0px); }

.site-footer::after {
  content: "";
  display: block;
  height: var(--cc-reserve, 0px);
}


/* ---------- Cookie consent (js/consent.js, CookieConsent v3) ----------
   The library's own stylesheet is not used: these rules style its markup.
   Banner: a compact White card in the bottom-right corner from 1024px, a
   full-width bar at the bottom below that. Settings: the same card, centred
   over a Charcoal overlay (a bottom sheet below 1024px). No shadow, 2px corners.
   Both only fade (200ms); instant with reduced motion (base.css). */
#cc-main {
  font: var(--text-small);
  color: var(--color-ink);
}

#cc-main [tabindex="-1"]:focus { outline: none; }

#cc-main .cm,
#cc-main .pm,
#cc-main .pm-overlay {
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms ease-out, visibility 0s linear 200ms;
}

.show--consent #cc-main .cm,
.show--preferences #cc-main .pm,
.show--preferences #cc-main .pm-overlay {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms ease-out, visibility 0s;
}

/* Arriving from another page of the site, the banner was already there: no fade */
.cc-no-fade #cc-main .cm { transition: none; }

/* The banner */
#cc-main .cm {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  /* Never reaches the header's "Kom igång" button: on a short screen only the
     text scrolls, the buttons always show */
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 128px);
  padding: var(--space-5) var(--page-margin);
  background: var(--color-surface);
  border-top: var(--border);
  view-transition-name: cookie-banner;
}

#cc-main .cm__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 560px;
}

#cc-main .cm__texts {
  min-height: 0;
  overflow-y: auto;
}

#cc-main .cm__title {
  margin-bottom: var(--space-2);
  font: var(--text-h3);
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

#cc-main .cm__desc { color: var(--color-ink); }

/* Phones: the shorter text and a little less padding, so the bar stays at
   about a third of the screen; the full text from 640px */
#cc-main .cc-desc-long { display: none; }

@media (max-width: 639px) {
  #cc-main .cm {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
}

@media (min-width: 640px) {
  #cc-main .cc-desc-long { display: inline; }
  #cc-main .cc-desc-short { display: none; }
}

/* Short screens (phones on their side, 200% zoom): the shorter text too, so it
   fits the half-height bar instead of scrolling inside it */
@media (max-height: 500px) {
  #cc-main .cc-desc-long { display: none; }
  #cc-main .cc-desc-short { display: inline; }
}

#cc-main .cm__footer .text-link { font-size: 14px; }

#cc-main .cm__btns {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

/* "Godkänn alla" and "Avvisa": two equal halves */
#cc-main .cm__btn-group:first-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

#cc-main .cm__btn-group:first-child .button { width: 100%; }

/* The link's 44px tap box reaches into the padding, so the card's edge looks even */
#cc-main .cm__btn-group:last-child { margin-bottom: calc(-1 * var(--space-3)); }

/* "Inställningar": a button that reads as a text link, 44px tap height */
#cc-main .cc-text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#cc-main .cc-text-button:hover { color: var(--color-primary); }

/* Tablets and phones on their side: text left, buttons right, so the bar stays low */
@media (min-width: 640px) and (max-width: 1023px) {
  #cc-main .cm__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: var(--space-6);
    max-width: var(--max-width);
  }
  #cc-main .cm__texts { grid-column: 1; grid-row: 1; }
  #cc-main .cm__footer { grid-column: 1; grid-row: 2; }
  #cc-main .cm__btns {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
  }
  #cc-main .cm__btn-group:last-child { margin-bottom: 0; }
}

/* Short screens (phones on their side): at most half the height */
@media (max-height: 500px) and (max-width: 1023px) {
  #cc-main .cm {
    max-height: 50dvh;
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
}

/* Below 320px (200% zoom on a phone): "Godkänn alla" and "Avvisa" stacked, as
   two halves no longer hold them, and the bar may reach up to just below the
   header (as on phones normally), so the text has room next to the buttons */
@media (max-width: 319px) {
  #cc-main .cm { max-height: calc(100dvh - 128px); }
  #cc-main .cm__btn-group:first-child { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  /* Bottom-right corner, clear of the hero text and buttons on the left
     (360px wide up to 1279px, so it stays clear of the hero text at 1024) */
  #cc-main .cm {
    left: auto;
    right: var(--space-5);
    bottom: var(--space-5);
    width: 360px;
    max-width: calc(100vw - 2 * var(--space-5));
    padding: var(--space-5);
    border: var(--border);
    border-radius: var(--radius);
  }
}

@media (min-width: 1280px) {
  #cc-main .cm { width: 400px; }
}

/* Signup page: the form fills the right-hand column, so the card goes
   bottom-left, over the intro instead of the form */
@media (min-width: 1024px) {
  :root:has(.signup) #cc-main .cm {
    left: var(--space-5);
    right: auto;
  }
}

/* The settings panel */
#cc-main .pm-overlay {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: var(--color-overlay);
}

#cc-main .pm {
  position: fixed;
  z-index: 31;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100dvh - var(--space-7));
  overflow-y: auto;
  padding: var(--space-5) var(--page-margin);
  background: var(--color-surface);
  border-top: var(--border);
}

#cc-main .pm__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

#cc-main .pm__title {
  font: var(--text-h3);
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

/* Close: 44px, the X drawn in Charcoal like the FAQ's plus */
#cc-main .pm__close-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--color-ink);
  cursor: pointer;
}

#cc-main .pm__close-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

#cc-main .pm__close-btn:hover { color: var(--color-primary); }

/* One row per category: name and toggle, the description below, Line between rows */
#cc-main .pm__section--toggle {
  padding: var(--space-3) 0 var(--space-4);
  border-top: var(--border);
}

#cc-main .pm__section--toggle:last-child { border-bottom: var(--border); }

#cc-main .pm__section-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;   /* the same row height with "Alltid på" as with a toggle */
}

/* "Nödvändiga" can't be turned off: this in the toggle's place, right-aligned */
#cc-main .cc-always-on {
  flex: none;
  font-size: 14px;
  color: var(--color-muted);
}

#cc-main .pm__section-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-ink);
}

#cc-main .pm__section-desc {
  max-width: 34em;
  color: var(--color-ink-soft);
}

/* Toggle: a real checkbox over a 44 × 24 switch with a square knob (2px
   corners, like everything else). Off: White with a Slate border and knob.
   On: Indigo with a White knob. "Nödvändiga" is always on (dimmed). No motion. */
#cc-main .section__toggle-wrapper {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

#cc-main .section__toggle {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

#cc-main .toggle__icon {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid var(--color-muted);
  border-radius: var(--radius);
  background: var(--color-surface);
}

#cc-main .toggle__icon-circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 1px;
  background: var(--color-muted);
}

#cc-main .toggle__icon-on,
#cc-main .toggle__icon-off,
#cc-main .toggle__label { display: none; }

#cc-main .section__toggle:hover + .toggle__icon { border-color: var(--color-ink); }

#cc-main .section__toggle:checked + .toggle__icon {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

#cc-main .section__toggle:checked + .toggle__icon .toggle__icon-circle {
  left: 23px;
  background: var(--color-surface);
}

#cc-main .section__toggle:disabled { cursor: default; }
#cc-main .section__toggle:disabled + .toggle__icon { opacity: 0.5; }

#cc-main .section__toggle:focus-visible + .toggle__icon {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* "Godkänn alla" and "Avvisa" equal; "Spara val" outlined, under them on phones */
#cc-main .pm__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

#cc-main .pm__btn-group { display: contents; }

#cc-main .pm__btn { width: 100%; }

#cc-main .pm__btn--secondary { grid-column: 1 / -1; }

@media (min-width: 640px) {
  #cc-main .pm__footer { grid-template-columns: 1fr 1fr 1fr; }
  #cc-main .pm__btn--secondary { grid-column: auto; }
}

@media (min-width: 1024px) {
  #cc-main .pm {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 520px;
    max-width: calc(100vw - 2 * var(--space-5));
    padding: var(--space-5);
    border: var(--border);
    border-radius: var(--radius);
    transform: translate(-50%, -50%);
  }
}


/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .form__row { grid-template-columns: 1fr 1fr; }
  .form__submit { width: auto; justify-self: start; }
}

@media (min-width: 768px) {
  .form-card { padding: 40px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card { padding: var(--space-7); }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  /* Side-by-side columns are sized by their content: the address keeps its
     full width here (it only needs to break in the one-column footer) */
  .footer-list a { overflow-wrap: normal; }
  .site-header__inner { min-height: 88px; }
  /* One step less padding than the audience cards, for short text */
  .card.card--compact { padding: var(--space-6); }
}

@media (min-width: 1024px) {
  .section { padding-top: var(--space-9); padding-bottom: var(--space-8); }
  .section__head { margin-bottom: var(--space-8); }
  .page-intro { padding-top: var(--space-8); }
  .form-page { padding-top: var(--space-8); }
  /* Left column: intro and extras (row 1), FAQ (row 2), 48px apart like the
     blocks within it; the form spans both rows on the right */
  .form-page__grid {
    grid-template-columns: 5fr 7fr;
    grid-template-rows: auto 1fr;
    gap: var(--space-7) var(--space-8);
    align-items: start;
  }
  .form-page__aside {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
  }
  .form-page__form { grid-column: 2; grid-row: 1 / span 2; }
  .form-page__faq { grid-column: 1; grid-row: 2; }
  .about {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
  }
  .photo-placeholder { min-height: 480px; }
  /* Om oss intro: the portrait in its own column on the right, the caption in
     a row of its own, so the text block centres on the photo alone */
  .intro-split {
    grid-template-columns: 1fr 330px;
    grid-template-rows: auto auto;
    column-gap: var(--space-8);
    row-gap: 0;
  }
  .intro-split__text { grid-row: 1; align-self: center; }
  .intro-split .portrait {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-rows: subgrid;
    width: 100%;
  }
}

/* ---------- Compact closing band and footer (desktop only) ---------- */
@media (min-width: 1024px) {
  /* ~40% less light space between the last section and the dark area */
  .cta-band { margin-top: var(--space-3); padding-top: var(--space-7); padding-bottom: var(--space-6); }
  .cta-band__inner { align-items: center; }
  .cta-band h2 { font-size: 36px; margin-bottom: var(--space-2); }

  /* Logo and tagline left; Sidor and Kontakt grouped on the right, 64px apart */
  .site-footer { padding-bottom: var(--space-4); }
  .site-footer__grid {
    grid-template-columns: 1fr auto auto;
    column-gap: var(--space-8);
    padding-top: var(--space-6);
  }
  body:not(:has(.cta-band)) .site-footer__grid { padding-top: var(--space-7); }
  .footer-list li { min-height: 32px; }
  /* Rows are 32px here: the tap area fills its own row, not the next link's */
  .footer-list a::after { inset: -4px; }

  /* Slim bottom row */
  .site-footer__base {
    margin-top: var(--space-5);
    font-size: 13px;
    color: var(--color-on-dark-muted);
  }
}

/* ---------- Page transitions (BRAND.md §7, Page transitions) ----------
   Cross-document View Transitions, CSS only. Browsers without support simply
   navigate as normal. With reduced motion there is no transition at all. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  /* Signature rule grows to full width just after the new content has faded in */
  .signature-rule { animation: rule-grow 300ms ease-out 250ms both; }
}

@keyframes rule-grow {
  from { transform: scaleX(0); }
}

/* Persistent chrome keeps still; only the main content transitions */
.top-bar { view-transition-name: top-bar; }
.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }

::view-transition-group(top-bar),
::view-transition-group(site-header),
::view-transition-group(site-footer),
::view-transition-group(cookie-banner) {
  animation: none;
}

/* Swap straight to the new snapshot. Identical chrome is pixel-still; when it
   differs (compact header after scrolling) it changes at once instead of
   showing two overlapping copies. */
::view-transition-new(top-bar),
::view-transition-new(site-header),
::view-transition-new(site-footer),
::view-transition-new(cookie-banner) {
  animation: none;
}

::view-transition-old(top-bar),
::view-transition-old(site-header),
::view-transition-old(site-footer),
::view-transition-old(cookie-banner) {
  animation: none;
  opacity: 0;
}

/* Main content: old fades out, new fades in and rises 8px */
::view-transition-old(root) {
  animation: vt-fade-out 150ms ease-out both;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: vt-rise-in 250ms ease-out both;
  mix-blend-mode: normal;
}

@keyframes vt-fade-out {
  to { opacity: 0; }
}

@keyframes vt-rise-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------- Mobile, part 1: type, spacing, header, hero (max-width: 767px) ----------
   Phones only; desktop and tablet styles above are untouched. */
@media (max-width: 767px) {
  :root { --page-margin: 24px; }

  /* Type */
  .display { font-size: 40px; }
  .lead { font-size: 17px; line-height: 1.6; text-wrap: pretty; }
  h2 { font-size: 28px; }
  .card__title { font-size: 26px; } /* keeps card headings on two lines at 375px */

  /* Header: smaller logo and "Kom igång" button, clear space between them */
  .site-header__inner { gap: var(--space-3); }
  .site-header .logo img { height: 30px; transform: translateY(-4px); }
  .site-header .button--small {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Hero: same photo; the content sets the height, with 64px of padding top and bottom */
  .hero {
    min-height: 0;
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
  /* Even, light darkening everywhere */
  .hero__shade { background: rgba(20, 25, 45, 0.4); }
  /* Portrait crop: both gables visible at the bottom of the hero */
  .hero__img { object-position: 68% 100%; transform-origin: 68% 100%; }
  .hero .signature-rule { display: none; }
  .hero .rule-peak--static {
    display: block;
    margin-bottom: var(--space-6);
  }
  .section { padding-top: 72px; padding-bottom: 0; }
  .photo-pair { padding-top: 40px; padding-bottom: 0; }
  .photo-pair + .section { padding-top: var(--space-8); }
  .section__head { margin-bottom: var(--space-6); }
  .about { gap: var(--space-6); }
  .cta-band { margin-top: 72px; }
  .form-page { padding-bottom: 72px; }
  .form-page__grid { gap: var(--space-6); }
  .form-page__faq { margin-top: var(--space-6); }
  .page-intro--last { padding-bottom: 72px; }
  .pull-quote blockquote p { font-size: 20px; }
  .faq__group + .faq__group { margin-top: var(--space-6); }

  /* Hero buttons stacked, full width */
  .hero .button-row { flex-direction: column; gap: var(--space-3); }
  .hero .button-row .button { width: 100%; }

  /* Cards: 24px inside, 16px between stacked cards */
  .cards { gap: var(--space-4); }
  .card,
  .form-card { padding: var(--space-5); }

  /* Forms: full-width 16px fields (no iPhone zoom), full-width submit,
     choice buttons stacked when the form is too narrow for one comfortable row */
  .field :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
    width: 100%;
    font-size: 16px;
  }
  .form { container: form / inline-size; }
  @container form (max-width: 559px) {
    .choices { flex-direction: column; }
    .choices--grid { grid-template-columns: 1fr; }
  }
  .form__submit { width: 100%; justify-self: stretch; }

  /* Footer: stacked columns 32px apart, compact */
  .site-footer { padding-bottom: var(--space-5); }
  .site-footer__grid { padding-top: var(--space-7); gap: var(--space-6); }
  .site-footer__base { margin-top: var(--space-6); }

  /* Trust strip: one fact per line, tighter */
  .trust-strip {
    flex-direction: column;
    gap: 0;
    font-size: 14px;
    line-height: 1.5;
  }
  .trust-strip li + li::before { content: none; }
}

/* Narrowest phones (below 360px): the hero headline and the privacy page's
   one-word h1 one step down, to the h1 size at this width (--text-h1: 32px),
   so "Rätt takläggare." stays on one line and "Integritetspolicy" keeps the
   side margin. The 404 page's two-line h1 already fits and keeps its size. */
@media (max-width: 359px) {
  .hero .display,
  .page-intro:not(.not-found) .display { font-size: 32px; }
}

/* Below 320px (200% zoom on a phone): one spacing step less at the screen
   edge and inside cards, so text and form fields keep a usable width */
@media (max-width: 319px) {
  :root { --page-margin: var(--space-4); }
  .card,
  .form-card { padding: var(--space-4); }
}

/* Mobile hero rule: animated copy only when motion is allowed */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .hero .rule-peak--static { display: none; }
  .hero .rule-peak--anim {
    display: block;
    margin-bottom: var(--space-6);
  }
}
