/* ============================================================
   Chapter 3 — Vindkraftens tredje kapitel
   Editorial, calm-luxury one-pager. Manrope throughout.
   ============================================================ */

:root {
  --bg: #f5f3ee;
  --bg-tint: #efece4;
  --ink: #27382e;        /* primary — deep forest green */
  --ink-soft: #34473b;
  --muted: #5a5a5a;      /* secondary */
  --accent: #a48c5c;     /* gold / brass */
  --accent-soft: #c4b48d;
  --on-dark: #f5f3ee;
  --on-dark-muted: #b8c2ba;
  --line: rgba(39, 56, 46, 0.14);
  --line-dark: rgba(245, 243, 238, 0.16);

  --maxw: 1200px;
  --gutter: clamp(1.5rem, 5vw, 6rem);
  --section-y: clamp(5rem, 11vw, 10rem);

  --f-display: clamp(2.4rem, 6vw, 4.6rem);
  --f-h2: clamp(1.9rem, 3.8vw, 3.1rem);
  --f-h3: clamp(1.15rem, 1.6vw, 1.4rem);
  --f-body: clamp(1rem, 1.15vw, 1.15rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: var(--f-body);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--accent); color: var(--bg); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.6rem) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav__logo { display: block; line-height: 0; }
.nav__logo-img { height: clamp(26px, 3.4vw, 34px); width: auto; transition: opacity 0.4s var(--ease); }
.nav__logo-img--dark { display: none; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.4vw, 2.6rem);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav__links a { text-decoration: none; color: var(--on-dark); position: relative; padding: 0.3rem 0; transition: color 0.3s var(--ease); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: currentColor; transition: width 0.3s var(--ease);
}
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 0.5rem 1.15rem !important;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }

/* scrolled state — solid cream bar with dark logo/text */
.nav.is-scrolled {
  background: rgba(245, 243, 238, 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -22px rgba(39, 56, 46, 0.5);
}
.nav.is-scrolled .nav__logo-img--white { display: none; }
.nav.is-scrolled .nav__logo-img--dark { display: block; }
.nav.is-scrolled .nav__links a { color: var(--ink); }
.nav.is-scrolled .nav__cta { border-color: var(--line); }
.nav.is-scrolled .nav__cta:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav.is-scrolled .nav__toggle span { background: var(--ink); }

/* mobile toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px; margin: -6px;
}
.nav__toggle span {
  width: 26px; height: 2px; background: var(--on-dark);
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease), background 0.4s var(--ease);
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 var(--gutter) 1.5rem;
}
.nav__mobile a {
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--on-dark);
}
.hero__bg {
  position: absolute; inset: 0;
  background-image: url('/.netlify/images?url=/assets/hero.jpg&w=2200&q=72');
  background-size: cover;
  background-position: center 40%;
  transform: scale(1.06);
  animation: heroZoom 18s var(--ease) forwards;
  will-change: transform;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(23, 33, 27, 0.55) 0%, rgba(23, 33, 27, 0.12) 32%, rgba(23, 33, 27, 0.35) 68%, rgba(23, 33, 27, 0.82) 100%);
}
.hero__content {
  position: relative;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3.5rem, 8vw, 7rem);
}
.hero__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0 0 1.4rem;
}
.hero__title {
  font-size: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1.8rem;
  max-width: 15ch;
}
.hero__lede {
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  line-height: 1.4;
  font-weight: 400;
  max-width: 42ch;
  color: rgba(245, 243, 238, 0.92);
}
.hero__lede p { margin: 0; }
.hero__lede em { color: #fff; font-style: normal; font-weight: 600; }
.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.hero__scroll-line {
  display: block;
  width: 64px; height: 1px;
  background: var(--accent-soft);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--on-dark);
  transform: translateX(-100%);
  animation: scrollLine 2.4s var(--ease) infinite;
}
@keyframes scrollLine { 0% { transform: translateX(-100%);} 55% { transform: translateX(100%);} 100% { transform: translateX(100%);} }

/* ============================================================
   CHAPTER — shared layout
   ============================================================ */
.chapter {
  padding: var(--section-y) 0;
  position: relative;
}
.chapter__grid,
.feature__grid,
.cards,
.pillars,
.platform,
.contact__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.chapter__grid {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}
.chapter__body { max-width: 62ch; }
.chapter__body h2 { font-size: var(--f-h2); margin-bottom: 1.4rem; }
.chapter__body p { color: var(--ink-soft); }

.chapter__aside {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 6rem;
}
.chapter__num {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 0.9;
}
.chapter__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  max-width: 8rem;
}

.chapter__pull {
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  margin: 1.6rem 0 !important;
}
.chapter__kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem !important;
}
.reveal--accent {
  color: var(--ink) !important;
  font-weight: 600;
  border-left: 2px solid var(--accent);
  padding-left: 1.3rem;
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--accent-soft);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.inline-link:hover { color: var(--ink); border-color: var(--ink); }

/* dark chapters */
.chapter--dark {
  background: var(--ink);
  color: var(--on-dark);
}
.chapter--dark .chapter__body h2,
.chapter--dark .chapter__pull { color: var(--on-dark) !important; }
.chapter--dark .chapter__body p { color: var(--on-dark-muted); }
.chapter--dark .chapter__label { color: var(--on-dark-muted); border-top-color: var(--line-dark); }
.chapter--dark .chapter__num { color: var(--accent-soft); }

/* ============================================================
   FEATURE (image + text) — Kapitel 2 & 5
   ============================================================ */
.feature__grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.chapter--reverse .feature__grid { grid-template-columns: 1fr 0.85fr; }
.chapter--reverse .feature__media { order: 2; }
.feature__media {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 40px 80px -50px rgba(39, 56, 46, 0.7);
}
.feature__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 5 / 6; }
.feature__media::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(245, 243, 238, 0.08);
  pointer-events: none;
}
.feature__body h2 { font-size: var(--f-h2); margin: 1.2rem 0 1.4rem; }
.feature__body p { color: var(--ink-soft); }
.feature__body .chapter__aside { position: static; flex-direction: row; align-items: baseline; gap: 1rem; }
.feature__body .chapter__label { border-top: none; padding-top: 0; }

/* ============================================================
   CARDS — Kapitel 3 (value pillars)
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.card {
  background: rgba(245, 243, 238, 0.04);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: clamp(1.8rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), background 0.5s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); background: rgba(164, 140, 92, 0.07); }
.card__index {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.card h3 { font-size: var(--f-h3); color: var(--on-dark); }
.card p { color: var(--on-dark-muted); font-size: 0.98rem; margin: 0; }

/* ============================================================
   PLATFORM — Kapitel 4 subsection
   ============================================================ */
.platform {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: clamp(3.5rem, 7vw, 6rem);
}
.platform__media {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 40px 80px -55px rgba(39, 56, 46, 0.7);
}
.platform__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.platform__badge {
  position: absolute;
  left: 1rem; bottom: 1rem;
  background: rgba(23, 33, 27, 0.8);
  backdrop-filter: blur(6px);
  color: var(--on-dark);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
}
.platform__note {
  font-size: 0.85rem !important;
  font-style: italic;
  color: var(--muted) !important;
  margin-top: 1.4rem !important;
}

/* ============================================================
   PILLARS — Kapitel 6
   ============================================================ */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.pillar { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.pillar__mark {
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 1.1rem;
}
.pillar h3 { font-size: var(--f-h3); margin-bottom: 0.7rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ============================================================
   STATUS — Kapitel 7
   ============================================================ */
.chapter--status { background: var(--bg-tint); }

/* ============================================================
   CONTACT — Kapitel 8
   ============================================================ */
.contact { padding: var(--section-y) 0; }
.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.contact__intro h2 { font-size: var(--f-h2); margin: 1.2rem 0 1.4rem; color: var(--on-dark); }
.contact__intro p { color: var(--on-dark-muted); max-width: 34ch; }
.contact__intro .chapter__aside { position: static; }

.contact__form { display: grid; gap: 1.2rem; }
.field { display: grid; gap: 0.45rem; }
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.field label span { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.7; }
.field input, .field textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--on-dark);
  background: rgba(245, 243, 238, 0.05);
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  width: 100%;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--on-dark-muted); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(164, 140, 92, 0.08);
}
.contact__hp { position: absolute; left: -9999px; }

.btn {
  justify-self: start;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--bg);
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.contact__status { font-size: 0.92rem; color: var(--accent-soft); margin: 0; min-height: 1.2em; }
.contact__status.is-error { color: #e8a99a; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  color: var(--on-dark);
  border-top: 1px solid var(--line-dark);
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.footer__logo { height: 32px; width: auto; }
.footer__tagline { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.footer__meta { font-size: 0.85rem; color: var(--on-dark-muted); margin: 0; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* stagger children within cards/pillars */
.cards .card:nth-child(2) { transition-delay: 0.08s; }
.cards .card:nth-child(3) { transition-delay: 0.16s; }
.pillars .pillar:nth-child(2) { transition-delay: 0.06s; }
.pillars .pillar:nth-child(3) { transition-delay: 0.12s; }
.pillars .pillar:nth-child(4) { transition-delay: 0.18s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .platform { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav.is-open { background: rgba(245, 243, 238, 0.98); backdrop-filter: blur(10px); border-bottom-color: var(--line); }
  .nav.is-open .nav__logo-img--white { display: none; }
  .nav.is-open .nav__logo-img--dark { display: block; }
  .nav.is-open .nav__toggle span { background: var(--ink); }
  .nav.is-open .nav__mobile { display: flex; }

  .chapter__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .chapter__aside { position: static; flex-direction: row; align-items: baseline; gap: 1rem; }
  .chapter__label { border-top: none; padding-top: 0; align-self: center; }

  .feature__grid,
  .chapter--reverse .feature__grid { grid-template-columns: 1fr; }
  .chapter--reverse .feature__media { order: 0; }
  .feature__media img { aspect-ratio: 4 / 3; }

  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .pillars { grid-template-columns: 1fr; }
  .hero { align-items: flex-end; }
  .hero__lede { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__bg { animation: none; transform: none; }
  .hero__scroll-line::after { animation: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
