/* ---------- Fonts ---------- */
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Light Oblique.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Medium.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Medium Oblique.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Demi.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Demi Oblique.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Bold Oblique.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Heavy.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Bauhaus";
  src: url("assets/fonts/itc-bauhaus/ITC Bauhaus Heavy Oblique.ttf") format("truetype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f7f3;
  --bg-deep: #12a04a;
  --ink: #14171a;
  --ink-soft: #3a3f44;
  --ink-muted: #6b7178;
  --rule: #e1e6df;
  --accent: #12a04a;
  --accent-deep: #12a04a;
  --accent-hover: #0d7a38;
  --accent-darker: #0a5e2a;
  --accent-soft: #d8efe0;
  --on-dark: #ffffff;

  --display: "ITC Bauhaus", Georgia, serif;
  --sans: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --measure: 38rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4rem, 10vw, 8rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2 {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 0.6em 0;
}
h3 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 0.6em 0;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.15; }
h3 { font-size: 1.2rem; line-height: 1.3; }

p { margin: 0 0 1em 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 1.5rem 0;
  font-weight: 500;
}

/* ---------- Language switching ---------- */
[data-lang="sv"] .en,
[data-lang="en"] .sv { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem var(--gutter);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 2.4rem;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.94rem;
  flex-wrap: wrap;
  justify-content: center;
}
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.lang-toggle button {
  background: none;
  border: 0;
  padding: 0.3rem 0.1rem;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink-muted);
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  color: var(--accent-deep);
  font-weight: 600;
}
.lang-toggle button:hover { color: var(--ink); }

@media (max-width: 860px) {
  .site-nav { display: none; }
}

/* ---------- Layout ---------- */
.section, .hero {
  padding: var(--section-y) var(--gutter);
  max-width: 78rem;
  margin: 0 auto;
}

.section-alt {
  background: var(--bg-alt);
  max-width: none;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section-alt > * {
  max-width: 78rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-text { min-width: 0; }
.hero-image {
  margin: 0;
  min-width: 0;
}
.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
}

.hero h1 {
  max-width: 18ch;
  margin-bottom: 1.5rem;
}
.hero-line-1, .hero-line-2 { display: block; }
.hero-line-2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.42em;
  line-height: 1.25;
  color: var(--ink-soft);
  margin-top: 0.7em;
  letter-spacing: -0.005em;
  max-width: 28ch;
}
.hero .lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-soft);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 3rem 0;
}
.hero-meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  max-width: 50rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  font: 500 0.95rem/1 var(--sans);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* ---------- Prose ---------- */
.prose {
  max-width: var(--measure);
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.prose p { margin-bottom: 1.1em; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose em { font-style: italic; }
.prose code {
  background: rgba(0,0,0,0.05);
  padding: 0.05em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
}

.section-intro {
  max-width: var(--measure);
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}

.section-footnote {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.two-col {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.5rem;
}
.two-col > div { font-size: 1rem; }
.two-col h3 {
  font-family: var(--sans);
  margin-bottom: 0.5rem;
}

/* ---------- Paths grid ---------- */
.paths {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 3rem;
}
.paths h3 {
  font-family: var(--sans);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}
.paths p { color: var(--ink-soft); margin: 0; font-size: 0.98rem; }

/* ---------- Funds ---------- */
.fund-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.75rem;
  margin-top: 1rem;
}
.fund-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fund-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px -20px rgba(15, 30, 20, 0.18);
  border-color: var(--accent-soft);
}
.fund-tag {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.7rem 0;
  font-weight: 500;
}
.fund-card h3 {
  font-size: 1.7rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.fund-sub {
  font-style: italic;
  color: var(--ink-muted);
  margin: 0 0 1.4rem 0;
  font-size: 1.02rem;
}
.fund-desc {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.fund-desc p { margin-bottom: 0.9em; }

.fund-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.fund-meta li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
}
.fund-meta li > span {
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.fund-meta em {
  font-style: normal;
  color: var(--ink);
}

.fund-cta {
  margin: 1.5rem 0 0 0;
  font-weight: 500;
}

@media (max-width: 540px) {
  .fund-meta li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* ---------- Partners ---------- */
.partner-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.partner h3 {
  font-family: var(--sans);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.partner p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}
.partner-note {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: var(--measure);
}

/* ---------- Contact ---------- */
.section-contact {
  background: var(--bg-deep);
  color: var(--on-dark);
  max-width: none;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.contact-row {
  max-width: 78rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
}
.section-contact h2 { color: var(--on-dark); margin-bottom: 0.5rem; }
.section-contact p { color: rgba(241, 246, 238, 0.82); font-size: 1.05rem; max-width: 32rem; }
.section-contact .btn-primary {
  background: #fff;
  color: var(--accent-darker);
}
.section-contact .btn-primary:hover { background: var(--bg-alt); color: var(--accent-darker); }
.section-contact .btn-ghost {
  border-color: rgba(255,255,255,0.6);
  color: var(--on-dark);
  margin-left: 0.5rem;
}
.section-contact .btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }

@media (max-width: 720px) {
  .contact-row { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 3rem var(--gutter) 2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.footer-row {
  max-width: 78rem;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 2rem;
}
.footer-brand {
  font-family: var(--sans);
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}
.footer-heading {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.6rem 0;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--ink); }

.footer-fineprint {
  max-width: 78rem;
  margin: 0 auto;
  font-size: 0.82rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

/* ---------- Animations ---------- */
@keyframes ut-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ut-fade-in {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes ut-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Hero entrance — staggered */
.hero-text > * {
  opacity: 0;
  animation: ut-fade-up 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.15s; }
.hero-text > *:nth-child(3) { animation-delay: 0.25s; }
.hero-text > *:nth-child(4) { animation-delay: 0.32s; }
.hero-text > *:nth-child(5) { animation-delay: 0.40s; }
.hero-text > *:nth-child(6) { animation-delay: 0.48s; }
.hero-text > *:nth-child(7) { animation-delay: 0.56s; }

.hero-image {
  opacity: 0;
  animation: ut-fade-in 0.95s ease-out 0.18s forwards;
}

/* Header brand mark — subtle hover */
.brand-logo {
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand:hover .brand-logo {
  transform: rotate(-4deg) scale(1.04);
}

/* Lang toggle smooth */
.lang-toggle button { transition: color 0.2s ease; }

/* Scroll reveal — sections opt in via .reveal class */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Stagger child reveals inside revealed section (cards, partner items) */
.reveal .fund-card,
.reveal .partner,
.reveal .paths > li {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view .fund-card,
.reveal.in-view .partner,
.reveal.in-view .paths > li {
  opacity: 1;
  transform: none;
}
.reveal.in-view .fund-card:nth-child(1),
.reveal.in-view .partner:nth-child(1),
.reveal.in-view .paths > li:nth-child(1) { transition-delay: 0.10s; }
.reveal.in-view .fund-card:nth-child(2),
.reveal.in-view .partner:nth-child(2),
.reveal.in-view .paths > li:nth-child(2) { transition-delay: 0.20s; }
.reveal.in-view .partner:nth-child(3),
.reveal.in-view .paths > li:nth-child(3) { transition-delay: 0.30s; }
.reveal.in-view .partner:nth-child(4),
.reveal.in-view .paths > li:nth-child(4) { transition-delay: 0.40s; }

/* Buttons — subtle press */
.btn { transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.btn:active { transform: translateY(1px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-text > *, .hero-image { animation: none; opacity: 1; transform: none; }
  .reveal, .reveal .fund-card, .reveal .partner, .reveal .paths > li {
    opacity: 1; transform: none; transition: none;
  }
  .fund-card:hover, .brand:hover .brand-logo { transform: none; }
}
