/* ==========================================================================
   Noorte Keskkonnaühisus — design system
   Palette: deep moss + cream + ochre. Editorial typography.
   ========================================================================== */

:root {
  --moss-900: #1a2b21;
  --moss-800: #263e2f;
  --moss-700: #3e5c48;
  --moss-600: #517560;
  --moss-500: #6b917a;
  --moss-200: #d8e2dc;
  --moss-100: #eaf0eb;

  --cream-50:  #faf7f0;
  --cream-100: #f5f1e8;
  --cream-200: #ece5d3;

  --ochre-500: #e8b84d;
  --ochre-600: #d09b2a;
  --ochre-400: #f2ce7a;

  --ink:       #1a1f1b;
  --ink-70:    #2e3630;
  --muted:     #6b7268;
  --line:      #d9d3c3;

  --bg:        var(--cream-100);
  --surface:   var(--cream-50);

  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(26, 43, 33, .06);
  --shadow:    0 12px 32px -12px rgba(26, 43, 33, .18);

  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --content-w:   1180px;
  --prose-w:     680px;
}

/* --- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--moss-800); text-decoration-color: var(--ochre-500); text-underline-offset: 3px; }
a:hover { color: var(--moss-700); }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--moss-800); color: var(--cream-50);
  padding: 10px 16px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* --- Layout primitives --------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 40px);
}
.prose { max-width: var(--prose-w); }
.section { padding-block: clamp(56px, 8vw, 112px); }
.section-tight { padding-block: clamp(40px, 5vw, 72px); }

/* --- Typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96;
  color: var(--moss-900);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.75rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 600; font-family: var(--font-sans); letter-spacing: -0.005em; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss-700);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--ochre-500);
}

.lead {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.55;
  color: var(--ink-70);
  max-width: 640px;
}
.display-italic { font-style: italic; font-variation-settings: "opsz" 144; }

p { margin: 0 0 1em; }
.prose p, .prose li { color: var(--ink-70); }
.prose h2 { margin-top: 2.5em; }
.prose h3 { margin-top: 2em; }
.prose ul { padding-left: 1.2em; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, color .2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--moss-800); color: var(--cream-50); }
.btn-primary:hover { background: var(--moss-900); color: var(--cream-50); }
.btn-outline { border-color: var(--moss-700); color: var(--moss-800); background: transparent; }
.btn-outline:hover { background: var(--moss-800); color: var(--cream-50); }
.btn-ghost { color: var(--moss-800); background: transparent; padding-inline: 8px; }
.btn-ghost:hover { color: var(--ochre-600); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--cream-100) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--cream-100) 96%, transparent);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 18px;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--moss-900); text-decoration: none;
}
.brand__mark { color: var(--moss-800); display: inline-flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-display); }
.brand__line1 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--font-sans); font-weight: 600; color: var(--moss-700); }
.brand__line2 { font-size: 1.15rem; font-weight: 500; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  color: var(--ink-70);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--moss-100); color: var(--moss-900); }
.site-nav a[aria-current="page"] { background: var(--moss-800); color: var(--cream-50); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 0;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--moss-900); transition: transform .2s ease, opacity .2s ease; }

@media (max-width: 900px) {
  .site-nav {
    position: fixed; inset: 68px 0 0 0;
    background: var(--cream-50);
    padding: 32px 24px;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow: auto;
  }
  .site-nav[data-open="true"] { transform: translateX(0); }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav a { font-size: 1.15rem; padding: 14px 18px; font-family: var(--font-display); }
  .nav-toggle { display: inline-flex; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

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

.hero {
  padding-block: clamp(72px, 12vw, 140px) clamp(56px, 10vw, 120px);
  background:
    radial-gradient(circle at 90% 12%, color-mix(in oklab, var(--ochre-500) 22%, transparent) 0, transparent 42%),
    linear-gradient(180deg, var(--cream-100) 0%, var(--cream-50) 100%);
  position: relative;
  overflow: clip;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero__title {
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 400;
  color: var(--moss-900);
}
.hero__title em {
  font-style: italic;
  color: var(--moss-700);
  font-variation-settings: "opsz" 144;
}
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-top: 36px;
  font-size: 0.9rem;
  color: var(--muted);
}
.hero__meta strong { color: var(--moss-900); font-weight: 500; }
.hero__ctas { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px; }

.hero__visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--moss-100);
  box-shadow: var(--shadow);
}
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }
.hero__visual::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(180deg, transparent 0%, rgba(26, 43, 33, .35) 100%);
}
.hero__badge {
  position: absolute; left: 20px; bottom: 20px;
  background: var(--cream-50);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--moss-900);
  display: inline-flex; gap: 8px; align-items: center;
  box-shadow: var(--shadow-sm);
}
.hero__badge .star { color: var(--ochre-600); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { max-width: 480px; margin: 0 auto; }
}

/* --- Marquee of partners ------------------------------------------------- */

.marquee {
  border-block: 1px solid var(--line);
  background: var(--cream-50);
  padding-block: 18px;
  overflow: hidden;
}
.marquee__track {
  display: flex; gap: 48px;
  animation: scroll 40s linear infinite;
  white-space: nowrap;
  align-items: center;
}
.marquee__item {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 1.15rem;
  font-style: italic;
  letter-spacing: 0.01em;
}
.marquee__item::after { content: "•"; margin-left: 48px; color: var(--ochre-500); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* --- Feature/section grid ------------------------------------------------ */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column; gap: 12px;
  height: 100%;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ochre-600); font-weight: 600; }
.card h3 { margin: 0; }
.card p { color: var(--ink-70); margin: 0; }
.card__link {
  margin-top: auto;
  padding-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  text-decoration: none;
  color: var(--moss-800);
}
.card__link::after { content: "→"; transition: transform .2s ease; }
.card:hover .card__link::after { transform: translateX(4px); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* --- Stats --------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding: clamp(32px, 5vw, 56px);
  background: var(--moss-800);
  color: var(--cream-100);
  border-radius: var(--radius-lg);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 400;
  color: var(--ochre-400);
  line-height: 1;
  margin-bottom: 8px;
}
.stat__label { color: var(--moss-200); font-size: 0.92rem; }

/* --- Event / list items -------------------------------------------------- */

.entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }
.entry__date {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--moss-700);
}
.entry__date small { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-sans); margin-top: 2px; }
.entry h3 { margin: 0; font-size: 1.35rem; }
.entry a { text-decoration: none; color: var(--moss-900); }
.entry a:hover { color: var(--moss-700); }
.entry__cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
@media (max-width: 640px) {
  .entry { grid-template-columns: 90px 1fr; }
  .entry__cat { grid-column: 2; }
}

/* --- People / team ------------------------------------------------------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.person__photo {
  aspect-ratio: 3/4;
  background: var(--moss-100);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__name { font-family: var(--font-display); font-size: 1.35rem; margin: 0; color: var(--moss-900); }
.person__role { color: var(--muted); font-size: 0.9rem; }

/* --- Campaign / celebrity grid ------------------------------------------- */

.celeb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}
.celeb {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease;
}
.celeb:hover { transform: translateY(-3px); border-color: var(--ochre-500); }
.celeb__name { font-family: var(--font-display); font-size: 1.05rem; margin: 0; color: var(--moss-900); }
.celeb__role { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  background: var(--moss-900);
  color: var(--moss-200);
  padding-block: 72px 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(216, 226, 220, .1);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-mark { font-family: var(--font-display); font-size: 1.5rem; color: var(--cream-100); margin: 0 0 8px; }
.footer-tagline { color: var(--moss-200); margin: 0 0 20px; }
.footer-award { display: inline-flex; align-items: center; gap: 8px; color: var(--ochre-400); font-size: 0.9rem; }
.footer-award__badge { color: var(--ochre-500); }
.footer-heading { font-family: var(--font-sans); font-weight: 600; color: var(--cream-50); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-list a { color: var(--moss-200); text-decoration: none; font-size: 0.95rem; }
.footer-list a:hover { color: var(--ochre-400); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px;
  font-size: 0.85rem; color: var(--moss-500);
  flex-wrap: wrap; gap: 12px;
}

/* --- Utility ------------------------------------------------------------- */

.center { text-align: center; }
.mt-lg { margin-top: 48px; }
.mt-md { margin-top: 32px; }
.mt-sm { margin-top: 16px; }
.bg-cream { background: var(--cream-50); }
.bg-moss  { background: var(--moss-900); color: var(--cream-100); }
.bg-moss h2, .bg-moss h3 { color: var(--cream-50); }
.bg-moss p { color: var(--moss-200); }

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--moss-100);
  color: var(--moss-800);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge-ochre { background: color-mix(in oklab, var(--ochre-500) 22%, transparent); color: var(--moss-900); }

/* --- Event / detail page hero -------------------------------------------- */

.page-hero {
  padding-block: clamp(64px, 9vw, 104px) clamp(32px, 5vw, 56px);
  background: linear-gradient(180deg, var(--cream-100), var(--cream-50));
}
.page-hero h1 { max-width: 900px; }
.crumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.crumb a { color: var(--moss-700); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* --- Article images / figures -------------------------------------------- */

.article-figure {
  margin: 40px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--moss-100);
}
.article-figure img { width: 100%; height: auto; display: block; }
.article-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 12px 16px;
  font-style: italic;
  background: var(--cream-50);
  border-top: 1px solid var(--line);
}

.article-figure--wide {
  margin-inline: calc(-1 * clamp(20px, 4vw, 40px));
  border-radius: 0;
}
@media (min-width: 900px) {
  .article-figure--wide {
    margin-inline: calc((var(--prose-w) - 100vw) / 2 + 20px);
    max-width: calc(100vw - 40px);
    border-radius: var(--radius);
  }
}

.page-hero__visual {
  margin-top: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--moss-100);
  box-shadow: var(--shadow);
}
.page-hero__visual img { width: 100%; height: 100%; object-fit: cover; }

/* Side-by-side image + content block */
.image-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-block: clamp(40px, 6vw, 72px);
}
.image-split--reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.image-split--reverse .image-split__visual { order: 2; }
@media (max-width: 800px) {
  .image-split, .image-split--reverse { grid-template-columns: 1fr; }
  .image-split--reverse .image-split__visual { order: 0; }
}
.image-split__visual {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--moss-100);
}
.image-split__visual img { width: 100%; height: 100%; object-fit: cover; }

/* Post/news card with thumbnail */
.post-card {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.post-card:last-child { border-bottom: 0; }
.post-card__thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--moss-100);
}
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.03); }
.post-card__meta { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
.post-card__meta strong { color: var(--moss-700); font-weight: 600; }
.post-card h3 { margin: 0 0 8px; font-size: 1.5rem; }
.post-card h3 a { text-decoration: none; color: var(--moss-900); background-image: linear-gradient(var(--ochre-500), var(--ochre-500)); background-position: 0 100%; background-repeat: no-repeat; background-size: 0 2px; transition: background-size .3s ease; }
.post-card:hover h3 a { background-size: 100% 2px; }
.post-card__excerpt { color: var(--ink-70); margin: 0; }
@media (max-width: 720px) {
  .post-card { grid-template-columns: 1fr; }
}

/* --- Reveal on scroll ---------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
}
