/* Råd til Testamente - design system */
:root {
  --petrol: #0e3a38;
  --petrol-deep: #092a29;
  --ink: #1b2321;
  --muted: #4f5f5b;
  --bg: #f6f4ee;
  --card: #ffffff;
  --tint: #eef2ee;
  --accent: #177e6f;
  --accent-dark: #0f5f54;
  --sage: #9db4ad;
  --line: #dfe5e0;
  --focus: #b7791f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; color: var(--petrol-deep); }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.4rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 1rem; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
p { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.4rem; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--petrol-deep); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--petrol-deep); color: #fff;
  padding: 0.75rem 1.25rem; border-radius: 0 0 8px 8px;
  z-index: 100; transition: top 0.2s ease; text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 44rem; }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.logo { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--petrol-deep); }
.logo img { width: 36px; height: 36px; border-radius: 8px; }
.logo span { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }

.main-nav { display: flex; gap: 0.1rem; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: 0.55rem 0.6rem; text-decoration: none;
  color: var(--ink); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: var(--tint); color: var(--petrol-deep); }
.main-nav a[aria-current="page"] { color: var(--accent-dark); border-bottom: 2px solid var(--accent-dark); border-radius: 0; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 0.6rem 0.75rem; cursor: pointer;
  min-width: 48px; min-height: 48px;
}
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: var(--petrol-deep); margin: 5px 0; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 60rem) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 0.5rem 1.25rem 1.25rem; z-index: 50;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-header { position: relative; }
}

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding: 1rem 0 0; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--sage); }
.breadcrumb a { color: var(--muted); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(closest-side, rgba(23,126,111,0.07), transparent 70%) 85% 10% / 34rem 34rem no-repeat,
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.25fr 0.75fr; } }

.hero-eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-dark);
  border: 1px solid var(--line); background: var(--card);
  padding: 0.35rem 0.85rem; border-radius: 999px; margin-bottom: 1.4rem;
}

.hero h1 { margin: 0 0 1.25rem; }
.mask-line { display: block; overflow: hidden; }
.mask-line > span {
  display: inline-block; transform: translateY(115%);
  animation: lineUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.mask-line:nth-child(1) > span { animation-delay: 0.10s; }
.mask-line:nth-child(2) > span { animation-delay: 0.24s; }
.mask-line:nth-child(3) > span { animation-delay: 0.38s; }
@keyframes lineUp { to { transform: translateY(0); } }

.hero-lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 38rem; margin-bottom: 1.75rem; }

.hero-art { position: relative; min-height: 15rem; display: none; }
@media (min-width: 56rem) { .hero-art { display: block; } }
.hero-art .doc {
  position: absolute; inset: 8% 12%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgba(14, 58, 56, 0.35);
  transform: rotate(-3deg);
}
.hero-art .doc::before, .hero-art .doc::after {
  content: ""; position: absolute; left: 12%; right: 12%; height: 8px;
  background: var(--tint); border-radius: 4px;
}
.hero-art .doc::before { top: 22%; box-shadow: 0 26px 0 var(--tint), 0 52px 0 var(--tint), 0 78px 0 var(--tint); }
.hero-art .doc::after { bottom: 14%; right: 45%; background: var(--sage); opacity: 0.55; }
.hero-art .stamp {
  position: absolute; right: 4%; bottom: 2%; width: 6.5rem; height: 6.5rem;
  border-radius: 50%; background: var(--petrol); color: #f6f4ee;
  display: grid; place-items: center; text-align: center;
  font-family: var(--serif); font-size: 0.78rem; line-height: 1.3;
  padding: 0.8rem; transform: rotate(6deg);
  box-shadow: 0 16px 40px -16px rgba(9, 42, 41, 0.5);
}

/* Buttons */
.btn {
  display: inline-block; padding: 0.9rem 1.75rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; text-align: center;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 26px -12px rgba(23, 126, 111, 0.65); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: var(--petrol); color: var(--petrol-deep); background: transparent; }
.btn-ghost:hover { background: var(--petrol); color: #fff; }
@media (max-width: 30rem) { .hero .btn { width: 100%; } }

/* Marquee */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; background: var(--card); padding: 0.85rem 0;
}
.marquee-track {
  display: flex; gap: 3rem; width: max-content;
  animation: marquee 46s linear infinite;
  font-family: var(--serif); font-size: 1rem; color: var(--muted); white-space: nowrap;
}
.marquee-track span { display: flex; align-items: center; gap: 3rem; }
.marquee-track i { font-style: normal; color: var(--sage); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections & chapters */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tint { background: var(--tint); }

.chapter { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.chapter-num {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--sage);
  flex-shrink: 0; padding-top: 0.2rem;
}

.answer-box {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 1.5rem 1.75rem; margin-bottom: 1.75rem;
}
.answer-box p:last-child { margin-bottom: 0; }

/* Cards */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media (min-width: 42rem) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.6rem; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(14, 58, 56, 0.3); }
.card h3 { margin-top: 0; }
.card .price { font-family: var(--serif); font-size: 1.7rem; color: var(--petrol-deep); margin: 0.25rem 0 0.5rem; }
.card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-dark); background: var(--tint);
  padding: 0.25rem 0.7rem; border-radius: 999px;
}

/* Tables */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 0.95rem; }
caption { text-align: left; font-weight: 700; margin-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--petrol); color: #fff; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: none; }

/* Calculator */
.calc {
  background: var(--petrol-deep); color: #eef2ee; border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 30px 70px -30px rgba(9, 42, 41, 0.55);
}
.calc h2, .calc h3 { color: #f6f4ee; }
.calc fieldset { border: none; padding: 0; margin: 0 0 1.75rem; }
.calc legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.75rem; padding: 0; }
.pill-group { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.pill label {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 999px;
  border: 1.5px solid rgba(238, 242, 238, 0.35); cursor: pointer;
  font-size: 0.95rem; font-weight: 600; min-height: 48px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.calc .btn { margin-top: 0.25rem; }

.calc-result {
  margin-top: 2rem; background: rgba(246, 244, 238, 0.06);
  border: 1px solid rgba(238, 242, 238, 0.18); border-radius: 14px;
  padding: 1.75rem; display: none;
}
.calc-result.is-visible { display: block; }
.calc-result .estimate-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); }
.calc-result .estimate-range { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); color: #fff; margin: 0.3rem 0 1rem; }
.calc-result a { color: #9fd8cc; }
.calc-note { font-size: 0.9rem; color: rgba(238, 242, 238, 0.75); }

/* FAQ */
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 0.75rem; padding: 0;
}
.faq summary {
  cursor: pointer; font-weight: 700; padding: 1.1rem 1.4rem;
  list-style: none; position: relative; padding-right: 3rem;
  font-family: var(--serif); font-size: 1.08rem; color: var(--petrol-deep);
  min-height: 48px;
}
.faq summary::after {
  content: "+"; position: absolute; right: 1.25rem; top: 50%;
  transform: translateY(-50%); font-size: 1.4rem; color: var(--accent);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 1.4rem 1.25rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Author box */
.author-box {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.25rem); margin: 1.5rem 0;
}
.author-box img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--tint); }
.author-box .author-role { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 0.25rem; }
.author-box .author-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--petrol-deep); margin-bottom: 0.5rem; }
@media (max-width: 30rem) { .author-box { flex-direction: column; } }

/* Meta / trust */
.meta-line { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.source-label {
  display: inline-block; font-size: 0.78rem; color: var(--muted);
  background: var(--tint); border-radius: 6px; padding: 0.3rem 0.7rem; margin-top: 0.5rem;
}
.callout {
  background: var(--tint); border-radius: 10px; padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--petrol-deep); color: #c8d4d0; margin-top: 3rem; }
.footer-grid {
  display: grid; gap: 2rem; grid-template-columns: 1fr;
  padding: 3rem 1.25rem 2rem;
}
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2, .site-footer h3 { color: #f6f4ee; font-size: 1rem; font-family: var(--sans); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 1rem; }
.site-footer a { color: #c8d4d0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-note {
  border-top: 1px solid rgba(238, 242, 238, 0.15); margin: 0;
  padding: 1.25rem; font-size: 0.85rem; text-align: center; color: #93a8a2;
}
.footer-brand { font-family: var(--serif); font-size: 1.35rem; color: #f6f4ee; font-weight: 700; margin-bottom: 0.5rem; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mask-line > span { animation: none; transform: none; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .pill label { transition: none; }
}
