/* ============ FONTS ============ */
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-standard-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* ============ TOKENS ============ */
:root {
  --bone: #F5F1EB;
  --charcoal: #2A2521;
  --warm-gray: #7A7268;
  --ochre: #B87A4A;
  --ochre-dark: #9A6238;
  --hairline: #D4CCC0;
  --measure-read: 36rem;
  --measure-wide: 64rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bone);
  color: var(--charcoal);
  font-size: 18px;
  line-height: 1.65;
  font-family: 'Geist', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ ACCESSIBILITY ============ */
:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 2px;
}

::selection {
  background: #F0E6D8;
  color: var(--charcoal);
}

a, button { min-height: 44px; }
a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  transform: translateY(-150%);
  background: var(--bone);
  color: var(--charcoal);
  border: 1px solid var(--ochre);
  border-radius: 0.375rem;
  min-height: 44px;
}
.skip-link:focus { transform: translateY(0); }

/* ============ NAV ============ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: transparent;
  z-index: 100;
  transition: background 200ms, backdrop-filter 200ms;
}

nav.scrolled {
  background: rgba(245, 241, 235, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.nav-name {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--warm-gray);
  text-decoration: none;
  transition: color 150ms;
  display: flex;
  align-items: center;
}

.nav-links a:hover {
  color: var(--charcoal);
}

/* Nav CTA — darker ochre for AA contrast on small text */
.nav-cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff !important;
  background: var(--ochre-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 150ms;
}

.nav-cta:hover {
  background: #7E4E2C;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--charcoal);
  position: absolute;
  left: 12px;
  transition: transform 150ms, opacity 150ms;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--bone);
  border-bottom: 1px solid var(--hairline);
  padding: 0 1rem;
}
.nav-mobile.open {
  display: flex;
}
.nav-mobile a {
  font-size: 1rem;
  color: var(--charcoal);
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
}
.nav-mobile a:last-child {
  border-bottom: none;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  height: 68svh;
  min-height: 520px;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2rem 4rem;
  max-width: 72rem;
  margin: 0 auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 44rem;
}

/* ============ HERO TRACES (morph) ============ */
.hero-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.trace {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.trace-charcoal {
  stroke: var(--charcoal);
  opacity: 0.28;
}

.trace-ochre {
  stroke: var(--ochre);
  opacity: 0.6;
}

/* Phase 1 (0-1.6s): both traces draw on via stroke-dashoffset.
   Phase 2 (1.6s+): ochre trace morphs to sharper divergence via JS.
   Killed under reduced motion (jumps straight to final state). */
@media (prefers-reduced-motion: no-preference) {
  .trace {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: trace-draw 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
  }
  .trace-ochre {
    animation-delay: 0.45s;
  }
  @keyframes trace-draw {
    to { stroke-dashoffset: 0; }
  }
}

/* Fade traces toward the bottom so they hand off cleanly to Problem. */
.trace-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 55%,
    var(--bone) 96%);
}

.hero-headline {
  font-family: 'Fraunces', serif;
  font-size: clamp(3rem, 8.5vw, 6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.hero-headline .accent {
  color: var(--ochre);
}

.hero-subtext {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--warm-gray);
  max-width: 30rem;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ochre-dark);
  color: #fff;
  padding: 0.875rem 2.25rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: background 150ms;
  min-height: 44px;
}

.hero-cta:hover {
  background: #7E4E2C;
}

/* ============ SHARED SECTION SHELL ============ */
/* Two-measure system:
   --measure-read: 36rem — all prose (body, headings stay left-aligned to this)
   --measure-wide: 64rem — structural elements only (stats grid, about grid)
   Everything uses one or the other. No in-between widths. */

.section {
  padding: 6rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  scroll-margin-top: 4rem;
}

.section + .section {
  border-top: 1px solid var(--hairline);
}

.section-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
  max-width: 52rem;
}

.body-copy {
  max-width: var(--measure-read);
}

.body-copy p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--warm-gray);
}

.body-copy p + p {
  margin-top: 1.5rem;
}

/* ============ PROBLEM ============ */
.problem-item {
  max-width: var(--measure-read);
  margin-bottom: 2.5rem;
}

.problem-item h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--charcoal);
}

.problem-item p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--warm-gray);
}

.problem-divider {
  width: 100%;
  max-width: var(--measure-read);
  height: 1px;
  background: var(--hairline);
  margin: 2.5rem 0;
}

.problem-closing {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-top: 3.5rem;
}

/* ============ HVA STEMMER (what happens when numbers agree) ============ */
.stat-callout {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--charcoal);
  max-width: var(--measure-read);
  margin: 3rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--ochre);
}

/* ============ TILBUD (offer) ============ */
.offer-dream {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.375rem, 2.8vw, 1.875rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--charcoal);
  max-width: var(--measure-read);
  margin-bottom: 2.5rem;
}

.offer-fit {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  max-width: var(--measure-read);
}

.offer-fit h4 {
  font-family: 'Fraunces', serif;
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--charcoal);
}

.offer-fit p {
  font-size: 1rem;
  color: var(--warm-gray);
}

/* ============ RESULTATER ============ */
.testimonial {
  max-width: var(--measure-read);
  margin: 3rem 0 4rem;
}

.testimonial blockquote {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}

.testimonial cite {
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--warm-gray);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem 2.5rem;
  max-width: var(--measure-wide);
  margin-top: 3rem;
}

.stat {
  border-top: 1px solid var(--hairline);
  padding-top: 1.25rem;
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--warm-gray);
}

/* ============ OM MEG ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  max-width: var(--measure-wide);
  align-items: start;
}

.about-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 0.375rem;
  /* warm grade: slight sepia + soft contrast */
  filter: sepia(0.12) saturate(0.92) contrast(0.97) brightness(1.02);
}

.about-facts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  max-width: var(--measure-wide);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.about-facts h5 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--warm-gray);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.about-facts p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--charcoal);
}

/* ============ KONTAKT ============ */
.contact {
  text-align: left;
}

.contact-links {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-links a {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
  transition: color 150ms;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.contact-links a:hover {
  color: var(--ochre);
}

/* ============ FOOTER ============ */
footer {
  padding: 3rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
}

footer p {
  font-size: 0.875rem;
  color: var(--warm-gray);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  nav {
    padding: 0 1rem;
  }
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .hero {
    padding: 0 1rem 3rem;
    height: auto;
    min-height: 460px;
  }
  .hero-headline {
    font-size: clamp(2.75rem, 11vw, 3.5rem);
  }
  .section {
    padding: 4rem 1rem;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-portrait {
    max-width: 320px;
  }
  .about-facts {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  footer {
    flex-direction: column;
    gap: 0.5rem;
    padding: 2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}