/* Browsie – samme uttrykk som appen: varmt papir, blekk, hårfine linjer og Fraunces. */

@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_400Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_400Regular_Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_500Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_600SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* «Papir» fra appen */
  --paper: #F7F4EE;
  --paper-deep: #EFEAE1;
  --card: #FFFDF9;
  --ink: #130A24;
  --ink-soft: #3B3448;
  --muted: #6C6577;
  --line: #E2DCD2;
  --accent: #0B26D5;
  --on-accent: #FFFFFF;

  /* Det mørke båndet bruker alltid «Blekk» */
  --band-paper: #130A24;
  --band-ink: #F7F4EE;
  --band-muted: #ADA5B8;
  --band-line: #342B46;
  --band-accent: #8296FF;

  --serif: "Fraunces", "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #130A24;
    --paper-deep: #1C1430;
    --card: #211936;
    --ink: #F7F4EE;
    --ink-soft: #D9D3E2;
    --muted: #ADA5B8;
    --line: #342B46;
    --accent: #8296FF;
    --on-accent: #130A24;

    --band-paper: #F7F4EE;
    --band-ink: #130A24;
    --band-muted: #6C6577;
    --band-line: #E2DCD2;
    --band-accent: #0B26D5;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

/* ---------- Topp ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand:hover { color: inherit; }
.brand img { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); }
.brand .dot { color: var(--accent); }

.nav { display: flex; gap: clamp(14px, 3vw, 28px); font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding-top: clamp(48px, 9vw, 112px);
  padding-bottom: clamp(56px, 9vw, 112px);
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; margin: 0; }

h1 {
  font-size: clamp(44px, 7.4vw, 88px);
  line-height: 1.0;
  text-wrap: balance;
}
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--accent); }

.lede {
  margin: 26px 0 0;
  max-width: 34em;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 36px; }

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.store-button:hover { color: var(--paper); transform: translateY(-1px); }
.store-button:active { transform: scale(0.97); }
.store-button svg { width: 18px; height: 18px; fill: currentColor; }
.store-button[aria-disabled="true"] { cursor: default; }
.store-button[aria-disabled="true"]:hover { transform: none; }

.cta-note { font-size: 15px; color: var(--muted); }

/* Telefonen i hero */
.device {
  justify-self: center;
  width: min(100%, 340px);
  padding: 10px;
  border-radius: 54px;
  background: var(--ink);
  box-shadow: 0 1px 0 var(--line), 0 40px 80px -30px rgba(19, 10, 36, 0.45);
  transform: rotate(2deg);
}
.device img { width: 100%; border-radius: 44px; background: var(--paper-deep); aspect-ratio: 1206 / 2622; object-fit: cover; }

/* ---------- Seksjoner ---------- */

.section { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; text-wrap: balance; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: 18px; max-width: 30em; }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.feature {
  padding: 30px 28px 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feature h3 { font-size: 24px; line-height: 1.15; }
.feature p { margin: 12px 0 0; color: var(--ink-soft); font-size: 16px; }

/* Hierarkiet: nivåene til venstre, et eksempel på et sidepanel til høyre */
.hierarchy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }

.levels { list-style: none; margin: 0; padding: 0; }
.levels li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 22px 0; border-top: 1px solid var(--line); }
.levels li:last-child { border-bottom: 1px solid var(--line); }
.levels li:nth-child(2) { padding-left: 24px; }
.levels li:nth-child(3) { padding-left: 48px; }
.levels li:nth-child(4) { padding-left: 72px; }
.levels .num { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 18px; padding-top: 4px; }
.levels h3 { font-size: 26px; line-height: 1.15; }
.levels p { margin: 8px 0 0; color: var(--ink-soft); font-size: 16px; }

.tree {
  margin: 0;
  padding: 22px 22px 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 30px 60px -40px rgba(19, 10, 36, 0.35);
  font-size: 15px;
}
.tree ul { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); margin-left: 12px; }
.tree > ul { margin-bottom: 18px; }
.tree li { padding: 4px 0 4px 10px; }
.tree-space { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; font-family: var(--serif); font-size: 21px; }
.tree-space strong { font-weight: 500; }
.tree-icon {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--c); font-size: 15px;
}
.tree-group { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); }
.tree-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.tree-tab { color: var(--ink-soft); }
.tree-tab::before { content: ""; display: inline-block; width: 14px; height: 10px; margin-right: 9px; border: 1px solid var(--muted); border-radius: 3px; vertical-align: -1px; }
.tree-tag {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}

/* Enkelt, litt mer, avansert */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); }
.mode { padding: 26px 26px 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.mode:nth-child(2) { background: var(--paper-deep); }
.mode:nth-child(3) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mode:nth-child(3) p { color: var(--paper); opacity: 0.78; }
.mode:nth-child(3) .eyebrow { opacity: 0.6; }
.mode .eyebrow { margin-bottom: 14px; }
.mode h3 { font-size: 24px; line-height: 1.15; }
.mode p { margin: 10px 0 0; color: var(--ink-soft); font-size: 16px; }

kbd {
  font-family: var(--sans);
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--card);
  white-space: nowrap;
}

/* Skjermbilder i en rad */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
  gap: clamp(16px, 6vw, 96px);
  align-items: start;
}
.shot { margin: 0; }
.shot .frame { padding: 7px; border-radius: 40px; background: var(--ink); }
.shot img { width: 100%; border-radius: 33px; aspect-ratio: 1206 / 2622; object-fit: cover; background: var(--paper-deep); }
.shot figcaption { margin-top: 16px; font-size: 15px; color: var(--muted); }
.shot figcaption strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--ink); margin-bottom: 2px; }

/* ---------- Mørkt bånd om personvern ---------- */

.band { background: var(--band-paper); color: var(--band-ink); }
.band .section { border-top: 0; }
.band h2 em { color: var(--band-accent); }
.band .section-head p { color: var(--band-muted); }
.band a { color: var(--band-ink); }
.band a:hover { color: var(--band-accent); }

.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.facts li { padding: 22px 0; border-top: 1px solid var(--band-line); }
.facts strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 6px; }
.facts span { color: var(--band-muted); font-size: 16px; }

/* ---------- Avslutning og bunn ---------- */

.closing { text-align: center; }
.closing img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 28px; border: 1px solid var(--line); }
.closing h2 { max-width: 14em; margin: 0 auto; }
.closing p { margin: 18px auto 0; color: var(--ink-soft); max-width: 32em; }
.closing .cta { justify-content: center; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; }

/* ---------- Tekstsider (personvern og støtte) ---------- */

.doc { max-width: 720px; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(56px, 8vw, 104px); }
.doc h1 { font-size: clamp(40px, 6vw, 64px); }
.doc .updated { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.doc .intro { margin-top: 28px; font-size: 19px; color: var(--ink-soft); }
.doc h2 { font-size: clamp(24px, 3vw, 30px); margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 21px; margin-top: 30px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 8px 0; }

.doc details { border-top: 1px solid var(--line); padding: 18px 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--line); }
.doc h2 + details { border-top: 0; }
.doc summary { cursor: pointer; font-family: var(--serif); font-size: 21px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; color: var(--accent); font-family: var(--sans); font-weight: 400; transition: transform 0.2s ease; }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p { margin: 12px 0 0; }

.contact-card { margin-top: 48px; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.contact-card h2 { margin: 0; padding: 0; border: 0; }
.contact-card p { margin: 10px 0 0; }

/* ---------- Mindre skjermer ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .device { width: min(78%, 320px); transform: rotate(0); }
  .section-head { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .hierarchy { grid-template-columns: 1fr; }
  .modes { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav a.hide-small { display: none; }
  .features { grid-template-columns: 1fr; }
  .feature { padding: 24px 20px 28px; }
  .levels li:nth-child(2) { padding-left: 12px; }
  .levels li:nth-child(3) { padding-left: 24px; }
  .levels li:nth-child(4) { padding-left: 36px; }
  .tree { padding: 18px 16px 22px; }
  .tree-tag { display: none; }
  .shots {
    grid-template-columns: repeat(2, 72%);
    justify-content: start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shot { scroll-snap-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .store-button, .doc summary::after { transition: none; }
}
