/* ==========================================================================
   E-Waste — Give Your Old Electronics a Second Life
   Design system (from project spec)
   Layout: sticky header → gradient hero (green → light green → dirty white)
           → content sections on dirty white → brown footer
   ========================================================================== */

:root {
  /* Brand colours */
  --green: #4f7942;
  --green-dark: #3a5a30;
  --green-light: #a8c69f;
  --bg: #f2f0e6;           /* dirty white */
  --surface: #fbfaf5;      /* cards */
  --blue: #a7c7e7;         /* baby blue: info boxes, highlights */
  --blue-soft: #e3eef8;
  --blue-ink: #2f5f8a;     /* readable link colour derived from baby blue */
  --brown: #7b5b3a;
  --brown-dark: #5e4329;
  --text: #2e2a24;
  --text-muted: #5f584d;
  --line: #dcd8c8;
  --white: #ffffff;
  --danger: #a33a2a;
  --danger-soft: #f6e3df;

  /* Main gradient */
  --gradient-main: linear-gradient(180deg, var(--green) 0%, var(--green-light) 65%, var(--bg) 100%);

  /* Typography — Soleway is used automatically if installed/self-hosted,
     otherwise the closest free match (Solway, Google Fonts). */
  --font: 'Soleway', 'Solway', Georgia, 'Times New Roman', serif;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-hero: clamp(2.2rem, 1.4rem + 3.6vw, 4rem);

  /* Spacing & shape */
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(46, 42, 36, 0.08);
  --header-h: 68px;

  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); font-weight: 800; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue-ink); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--brown);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { top: 12px; color: var(--white); }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(48px, 7vw, 88px); }
.section--alt { background: var(--surface); }
.section--blue { background: var(--blue-soft); }

/* Section divider: the main gradient as a thin band */
.divider {
  height: 10px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-light) 50%, var(--bg) 100%);
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.6em;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 62ch;
}

.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lead { margin-inline: auto; }

.prose { max-width: 68ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8em 1.5em;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn--primary { background: var(--brown); color: var(--white); }
.btn--primary:hover { background: var(--brown-dark); color: var(--white); transform: translateY(-2px); }
.btn--ghost { border-color: var(--white); color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--green-dark); }
.btn--outline { border-color: var(--brown); color: var(--brown); background: transparent; }
.btn--outline:hover { background: var(--brown); color: var(--white); }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 500;
  background: rgba(242, 240, 230, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--green-dark);
  text-decoration: none;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
}
.logo-mark svg { width: 22px; height: 22px; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  transition: background-color 0.2s, color 0.2s;
}
.nav-list a:hover { background: var(--blue-soft); color: var(--text); }
.nav-list a.active,
.nav-list a[aria-current="page"] { background: var(--green); color: var(--white); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--green);
  color: var(--green);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  cursor: pointer;
  place-items: center;
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 1280px) {
  .nav-toggle { display: grid; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 12px var(--gutter) 20px;
  }
  .site-nav:not(.open) { display: none; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list a { padding: 12px 16px; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  color: var(--white);
  padding-block: clamp(64px, 10vw, 128px) clamp(96px, 12vw, 160px);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(58, 90, 48, 0.92) 0%,
    rgba(79, 121, 66, 0.78) 45%,
    rgba(168, 198, 159, 0.55) 78%,
    var(--bg) 100%);
}
.hero-content { max-width: 680px; }
.hero h1 { margin-bottom: 0.35em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
.hero p {
  font-size: var(--fs-lg);
  max-width: 54ch;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}
.hero .eyebrow { color: var(--blue); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Inner page banner */
.page-hero {
  position: relative;
  isolation: isolate;
  color: var(--white);
  padding-block: clamp(48px, 7vw, 88px) clamp(64px, 8vw, 104px);
  overflow: hidden;
}
.page-hero .hero-bg { object-position: center 40%; }
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(58, 90, 48, 0.94) 0%,
    rgba(79, 121, 66, 0.82) 55%,
    rgba(168, 198, 159, 0.6) 85%,
    var(--bg) 100%);
}
.page-hero h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); }
.page-hero p { max-width: 60ch; font-size: var(--fs-lg); }
.page-hero .eyebrow { color: var(--blue); }

.breadcrumb { font-size: var(--fs-sm); margin-bottom: 12px; opacity: 0.9; }
.breadcrumb a { color: var(--white); }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  min-width: 0;
}
.stat-number {
  display: block;
  font-size: clamp(1.7rem, 1.2rem + 2vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 8px; color: var(--text-muted); font-size: 0.98rem; }
.stats-source { margin-top: 18px; font-size: var(--fs-sm); color: var(--text-muted); }
.stats--overlap { margin-top: calc(-1 * clamp(56px, 8vw, 96px)); position: relative; z-index: 2; }
.stats--overlap .stat { box-shadow: var(--shadow); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.card-media { aspect-ratio: 16 / 10; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body p { color: var(--text-muted); }
.card-link {
  margin-top: auto;
  padding-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--brown);
  text-decoration: none;
}
.card-link svg { width: 18px; height: 18px; transition: transform 0.2s; }
a.card { text-decoration: none; color: inherit; transition: transform 0.25s, box-shadow 0.25s; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: inherit; }
a.card:hover .card-media img { transform: scale(1.05); }
a.card:hover .card-link svg { transform: translateX(4px); }

.icon-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  flex-shrink: 0;
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge--green { background: #e4eedf; color: var(--green-dark); }
.icon-badge--brown { background: #efe6db; color: var(--brown); }
.icon-badge--danger { background: var(--danger-soft); color: var(--danger); }

/* Simple feature tiles (icon + text) */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.tile h3 { margin: 0; font-size: 1.12rem; }
.tile p { color: var(--text-muted); font-size: 0.98rem; }

/* ---------- Split (image + text) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.split > * { min-width: 0; }
.split--reverse .split-media { order: 2; }
.split-media img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.split-media--tall img { aspect-ratio: 4 / 5; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
}

/* ---------- Lists ---------- */
.check-list,
.x-list,
.dot-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li,
.x-list li,
.dot-list li { position: relative; padding-left: 30px; }
.check-list li::before,
.x-list li::before {
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
}
.check-list li::before { content: "✓"; background: #e4eedf; color: var(--green-dark); }
.x-list li::before { content: "✕"; background: var(--danger-soft); color: var(--danger); }
.dot-list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------- Info box ---------- */
.info-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.info-box > div { min-width: 0; }
.info-box h3 { margin-bottom: 0.3em; font-size: 1.1rem; }
.info-box--warning { background: var(--danger-soft); border-color: #e6bcb3; }
.info-box--warning .icon-badge { background: var(--white); color: var(--danger); }
.info-box .icon-badge { background: var(--white); }

/* ---------- Steps (real sequences) ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
  counter-increment: step;
  min-width: 0;
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.4em; }
.step p { color: var(--text-muted); font-size: 0.98rem; }

/* Vertical process (repair) */
.process { list-style: none; padding: 0; margin: 0; counter-reset: proc; display: grid; gap: 0; }
.process > li {
  position: relative;
  padding: 0 0 28px 64px;
  counter-increment: proc;
}
.process > li::before {
  content: counter(proc);
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
}
.process > li::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 48px;
  bottom: 4px;
  width: 2px;
  background: var(--green-light);
}
.process > li:last-child { padding-bottom: 0; }
.process > li:last-child::after { display: none; }
.process h3 { font-size: 1.15rem; margin: 0.45em 0 0.4em; }
.process ul { margin: 0; padding-left: 1.1em; color: var(--text-muted); }
.process ul li { margin-bottom: 4px; }

/* ---------- Lifecycle infographic ---------- */
.lifecycle {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  counter-reset: life;
}
.lifecycle li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  counter-increment: life;
  min-width: 0;
}
.lifecycle li .icon-badge { margin: 0 auto 12px; }
.lifecycle li h3 { font-size: 1.02rem; margin-bottom: 0.3em; }
.lifecycle li p { font-size: 0.92rem; color: var(--text-muted); }
.lifecycle li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translate(50%, -50%);
  color: var(--green);
  font-weight: 800;
  font-size: 1.3rem;
  z-index: 1;
}
@media (max-width: 900px) {
  .lifecycle { grid-template-columns: 1fr; gap: 26px; }
  .lifecycle li:not(:last-child)::after {
    content: "↓";
    right: 50%;
    top: auto;
    bottom: -26px;
    transform: translate(50%, 0);
  }
}

.end-of-life {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.split-bar {
  display: flex;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 12px;
  font-weight: 700;
  font-size: 0.95rem;
}
.split-bar span { display: flex; align-items: center; padding-inline: 14px; white-space: nowrap; }
.split-bar .recycled { width: 22.3%; background: var(--green); color: var(--white); }
.split-bar .lost { flex: 1; background: var(--brown); color: var(--white); justify-content: flex-end; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.95rem; color: var(--text-muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Two-column compare (valuable vs harmful) ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.compare > * { min-width: 0; }
.compare-col {
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.compare-col--good { border-top: 6px solid var(--green); }
.compare-col--bad { border-top: 6px solid var(--danger); }
.compare-col h3 { display: flex; align-items: center; gap: 12px; }
.compare-col dl { margin: 16px 0 0; display: grid; gap: 14px; }
.compare-col dt { font-weight: 700; }
.compare-col dd { margin: 2px 0 0; color: var(--text-muted); }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }

/* Yield figures (1 million phones) */
.yield {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.yield-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--blue);
}
.yield-item strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--blue-ink);
  font-variant-numeric: tabular-nums;
}
.yield-item span { color: var(--text-muted); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; min-width: 560px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--green); color: var(--white); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(167, 199, 231, 0.12); }
td.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill--easy { background: #e4eedf; color: var(--green-dark); }
.pill--medium { background: var(--blue-soft); color: var(--blue-ink); }
.pill--hard { background: #efe6db; color: var(--brown-dark); }
.pill--very-hard { background: var(--danger-soft); color: var(--danger); }

/* Do / Don't */
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.do-dont > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  min-width: 0;
}
.do-dont h3 { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) { .do-dont { grid-template-columns: 1fr; } }

/* 4R */
.four-r { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.four-r .tile { text-align: left; }
.four-r .r-letter {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green);
}
@media (max-width: 900px) { .four-r { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .four-r { grid-template-columns: 1fr; } }

/* Image strip (benefits) */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.photo-strip figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; min-width: 0; }
.photo-strip img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.photo-strip figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 18px 16px;
  color: var(--white);
  background: linear-gradient(180deg, transparent, rgba(46, 42, 36, 0.85));
  font-weight: 500;
}
.photo-strip figcaption strong { display: block; font-size: 1.15rem; }
@media (max-width: 760px) {
  .photo-strip { grid-template-columns: 1fr; }
  .photo-strip img { aspect-ratio: 16 / 10; }
}

/* Sub navigation (long pages) */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.subnav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
}
.subnav a:hover { background: var(--blue-soft); border-color: var(--blue); }
.subnav-wrap { padding-block: 22px 0; }

/* Pros / cons */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pros-cons > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  min-width: 0;
}
.pros-cons h4 { margin: 18px 0 10px; color: var(--green-dark); font-size: 1.02rem; }
.pros-cons h4:first-of-type { margin-top: 6px; }
@media (max-width: 820px) { .pros-cons { grid-template-columns: 1fr; } }

/* Quality ladder */
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: lad; }
.ladder li {
  counter-increment: lad;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.ladder li::before {
  content: counter(lad);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-weight: 800;
}

/* ---------- Quiz ---------- */
.quiz {
  max-width: 760px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
}
.quiz-progress {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.quiz-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.quiz-bar span { display: block; height: 100%; background: var(--green); width: 0; transition: width 0.3s; }
.quiz-question { font-size: 1.3rem; margin-bottom: 18px; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  font-family: var(--font);
  font-size: 1rem;
  text-align: left;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: var(--green); background: #e4eedf; }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--blue-soft); }
.quiz-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.quiz-result { text-align: center; }
.quiz-score { font-size: 3rem; font-weight: 800; color: var(--green); line-height: 1.1; }

/* ---------- Map + locations ---------- */
.map-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.map-layout > * { min-width: 0; }
#map {
  height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--blue-soft);
  z-index: 1;
}
.map-fallback { padding: 24px; color: var(--text-muted); }
.location-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-height: 520px; overflow-y: auto; }
.location {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.location:hover,
.location.is-active { border-color: var(--green); box-shadow: var(--shadow); }
.location h3 { font-size: 1.05rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.location p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 6px; }
.location .tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  letter-spacing: 0.02em;
}
.location .tag--placeholder { background: #efe6db; color: var(--brown-dark); }
.map-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--green);
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.map-pin--store { background: var(--blue-ink); }
.map-pin--school { background: var(--brown); }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  #map { height: 380px; }
  .location-list { max-height: none; }
}

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.member {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
}
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: var(--gradient-main);
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 800;
}
.member h3 { margin-bottom: 2px; font-size: 1.1rem; }
.member p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Form ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.contact-layout > * { min-width: 0; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 34px);
  display: grid;
  gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.98rem; }
.field input,
.field textarea {
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--blue-ink); }
.field.invalid input,
.field.invalid textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; }
.field-hint { color: var(--text-muted); font-size: 0.88rem; }
.form-status { padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 500; }
.form-status.success { background: #e4eedf; color: var(--green-dark); }
.form-status.error { background: var(--danger-soft); color: var(--danger); }
.hidden-field { position: absolute; left: -9999px; }

/* Sources list */
.sources { display: grid; gap: 10px; padding-left: 1.2em; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--gradient-main);
  color: var(--white);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.cta-band h2 { margin-bottom: 0.3em; }
.cta-band p { max-width: 56ch; }
.cta-band .btn--primary { box-shadow: var(--shadow); }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brown);
  color: #f3ece3;
  padding-block: 56px 28px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
.footer-grid > * { min-width: 0; }
.site-footer h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--white); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #f3ece3; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .logo { color: var(--white); margin-bottom: 12px; }
.site-footer .logo-mark { background: var(--white); color: var(--brown); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--fs-sm);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ----------
   Content is visible by default. JS only hides elements that start
   below the fold, then fades them in when they scroll into view. */
.reveal-ready { opacity: 0; transform: translateY(24px); }
.reveal-in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal-ready { opacity: 1; transform: none; }
}

/* Utilities */
.mt-lg { margin-top: clamp(28px, 4vw, 48px); }
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }

/* ==========================================================================
   Animations
   ========================================================================== */

/* ---------- Loading screen (first visit in a session) ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  background: var(--gradient-main);
  color: var(--white);
}
.show-loader .loader {
  display: grid;
  /* Failsafe: never block the page for more than 4s, even without JS */
  animation: loader-failsafe 0.4s ease 4s forwards;
}
.loader.is-done { animation: loader-out 0.6s ease forwards; }
.loader-inner { display: grid; justify-items: center; gap: 18px; text-align: center; }
.loader-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: loader-pulse 1.6s ease-out infinite;
}
.loader-icon svg { width: 52px; height: 52px; animation: spin 2.4s linear infinite; }
.loader-title { font-size: 1.8rem; font-weight: 800; letter-spacing: 0.02em; }
.loader-title span { display: inline-block; animation: letter-up 0.6s ease both; }
.loader-bar { width: 180px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--white); animation: loader-bar 1.1s ease-in-out infinite; }
.loader-text { font-size: 0.95rem; opacity: 0.9; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loader-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  100% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); }
}
@keyframes loader-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes letter-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; transform: scale(1.04); } }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Page transitions ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  background: linear-gradient(135deg, var(--green-dark), var(--green) 55%, var(--green-light));
  transform: translateY(100%);
  display: grid;
  place-items: center;
  color: var(--white);
}
.page-transition svg { width: 56px; height: 56px; opacity: 0.9; animation: spin 1.6s linear infinite; }
/* Leaving: panel slides up and covers the page */
.is-leaving .page-transition { animation: pt-in 0.45s cubic-bezier(0.7, 0, 0.3, 1) forwards; pointer-events: all; }
/* Arriving: panel starts covering and slides away */
.is-arriving .page-transition { transform: translateY(0); animation: pt-out 0.6s cubic-bezier(0.7, 0, 0.3, 1) 0.05s forwards; }
@keyframes pt-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pt-out { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  z-index: 600;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-light), var(--blue));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Hero entrance ---------- */
.hero-bg { animation: ken-burns 22s ease-in-out infinite alternate; }
@keyframes ken-burns { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

.hero-content > *,
.page-hero .container > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-content > :nth-child(1), .page-hero .container > :nth-child(1) { animation-delay: 0.10s; }
.hero-content > :nth-child(2), .page-hero .container > :nth-child(2) { animation-delay: 0.22s; }
.hero-content > :nth-child(3), .page-hero .container > :nth-child(3) { animation-delay: 0.34s; }
.hero-content > :nth-child(4), .page-hero .container > :nth-child(4) { animation-delay: 0.46s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* Floating leaves in the home hero */
.leaves { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.leaves span {
  position: absolute;
  top: -40px;
  width: 18px;
  height: 18px;
  border-radius: 0 70% 0 70%;
  background: var(--green-light);
  opacity: 0.7;
  animation: leaf-fall linear infinite;
}
.leaves span:nth-child(1) { left: 8%;  animation-duration: 13s; animation-delay: 0s; }
.leaves span:nth-child(2) { left: 22%; animation-duration: 17s; animation-delay: 3s; width: 12px; height: 12px; }
.leaves span:nth-child(3) { left: 41%; animation-duration: 15s; animation-delay: 6s; background: var(--blue); }
.leaves span:nth-child(4) { left: 63%; animation-duration: 19s; animation-delay: 1s; width: 14px; height: 14px; }
.leaves span:nth-child(5) { left: 78%; animation-duration: 14s; animation-delay: 8s; }
.leaves span:nth-child(6) { left: 92%; animation-duration: 18s; animation-delay: 4s; width: 10px; height: 10px; background: var(--blue); }
@keyframes leaf-fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(40px, 50vh) rotate(180deg); }
  100% { transform: translate(-20px, 110vh) rotate(360deg); opacity: 0; }
}

/* ---------- Micro-interactions ---------- */
.logo-mark svg { transition: transform 0.6s ease; }
.logo:hover .logo-mark svg { transform: rotate(180deg); }

.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 0.6s ease;
}
.btn:hover::after { left: 140%; }

.tile, .step, .stat, .member, .compare-col, .do-dont > div { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.tile:hover, .step:hover, .stat:hover, .member:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green-light); }
.tile:hover .icon-badge, .step:hover::before { animation: pop 0.4s ease; }
@keyframes pop { 50% { transform: scale(1.15); } }

.member .avatar { transition: transform 0.4s ease; }
.member:hover .avatar { transform: rotate(-8deg) scale(1.06); }

.split-media img, .photo-strip img { transition: transform 0.6s ease; }
.split-media:hover img, .photo-strip figure:hover img { transform: scale(1.04); }

/* Split bar grows when revealed */
.split-bar .recycled { animation: grow-x 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Reveal variants */
[data-reveal="left"].reveal-ready { transform: translateX(-40px); }
[data-reveal="right"].reveal-ready { transform: translateX(40px); }
[data-reveal="zoom"].reveal-ready { transform: scale(0.92); }

@media (prefers-reduced-motion: reduce) {
  .show-loader .loader { display: none; }
  .page-transition { display: none; }
  .leaves { display: none; }
  .hero-bg { animation: none; }
}

/* Keep slide-in animations from causing sideways scrolling on phones */
main, .hero, .page-hero { overflow-x: clip; }

/* ==========================================================================
   Language switcher
   ========================================================================== */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.lang-switch button {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 38px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.lang-switch button:hover { color: var(--text); background: var(--blue-soft); }
.lang-switch button[aria-pressed="true"] { background: var(--brown); color: var(--white); }
.lang-switch button:active { transform: scale(0.94); }

/* Header order: logo · nav · languages · menu button */
.site-header .site-nav { margin-left: auto; }
@media (max-width: 1280px) {
  .lang-switch { margin-left: auto; }
}

/* Solway has no Serbian/Turkish letters (č ć š ž đ ş ğ İ), so switch the
   whole page to Bitter (a similar slab serif) for those languages. */
html[lang^="sr"],
html[lang="tr"] {
  --font: 'Soleway', 'Bitter', Georgia, 'Times New Roman', serif;
}

/* Smooth fade when the language changes */
.lang-fade main { animation: lang-fade 0.35s ease; }
@keyframes lang-fade { from { opacity: 0.25; } to { opacity: 1; } }

/* Desktop order: logo · nav · languages (menu button hidden) */
.site-nav { order: 2; }
.lang-switch { order: 3; }
.nav-toggle { order: 4; }
.logo, .nav-list a { white-space: nowrap; }
