:root {
  --bg: #FEFDF8;
  --red: #AB3C45;
  --blue: #283EA8;
  --yellow: #F5BE2B;
  --green: #4A8560;
  --black: #000;

  --display: "Konkhmer Sleokchher", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;

  --page-width: 1440px;
  --gutter: clamp(20px, 8.8vw, 127px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 73px; } /* keep anchors clear of the sticky nav */
body {
  margin: 0;
  background: var(--bg);
  color: var(--red);
  font-family: var(--body);
  font-size: 20.777px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 2px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--blue);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--page-width);
  height: 73px;
  margin: 0 auto;
  padding: 0 clamp(20px, 10vw, 148px) 0 clamp(20px, 5.2vw, 75px);
}
.icon {
  color: var(--blue);
  font-family: var(--display);
  font-size: 28.079px;
  font-weight: 400;
  line-height: 90%;
  text-decoration: none;
}
.nav ul {
  display: flex;
  gap: clamp(16px, 3vw, 41px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.a-link {
  color: var(--blue);
  font-family: var(--body);
  font-size: 20.777px;
  font-weight: 400;
  line-height: normal;
  text-decoration: none;
}
.nav .a-link:hover,
.nav .a-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }

/* Menu toggle (hamburger) — only shown on small screens */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--blue);
  cursor: pointer;
}
.menu-toggle .bars,
.menu-toggle .bars::before,
.menu-toggle .bars::after {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s ease, background-color .2s ease;
}
.menu-toggle .bars { position: relative; }
.menu-toggle .bars::before,
.menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle .bars::before { transform: translateY(-8px); }
.menu-toggle .bars::after  { transform: translateY(8px); }

/* open state → X */
.nav.is-open .menu-toggle .bars { background: transparent; }
.nav.is-open .menu-toggle .bars::before { transform: rotate(45deg); }
.nav.is-open .menu-toggle .bars::after  { transform: rotate(-45deg); }

/* ---------- Page container: 1440px ---------- */
main {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
}

/* ---------- Shared ---------- */
.title {
  margin: 0;
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(52px, 6.67vw, 96px);
  font-weight: 400;
  font-style: normal;
  line-height: 90%;
}
.text-link {
  color: var(--red);
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* Slightly off-level rule, like a line drawn by hand */
.rule {
  height: 0;
  margin: 0 var(--gutter);
  border: 0;
  border-top: 1px solid var(--red);
  transform: rotate(-0.2deg);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  padding: clamp(48px, 13vw, 190px) var(--gutter) clamp(56px, 8vw, 118px);
}
.hero-copy p { margin: 0; }
.hero-copy .lede {
  max-width: 24ch;
  margin-top: clamp(40px, 6.4vw, 92px);
}
.hero-copy .text-link {
  display: inline-block;
  margin-top: clamp(32px, 4.6vw, 66px);
}
.hero-photo {
  justify-self: start;
  width: min(100%, 305px);
  margin: 0 0 0 clamp(0px, 4vw, 60px);
}
.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 305 / 377;
  object-fit: cover;
  object-position: center top;
}

/* ---------- Story ---------- */
.story {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
  gap: clamp(24px, 4vw, 60px);
  padding: clamp(56px, 9vw, 130px) var(--gutter) clamp(56px, 8vw, 116px);
}
.story-title {
  margin: 0;
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(38px, 4.44vw, 64px);
  font-weight: 400;
  line-height: 100%;
}
.story-title span { display: block; }
.story-title em {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1em;
  font-style: italic;
  font-weight: 400;
  line-height: 100%;
}
.story-copy { padding-top: 4px; }
.story-copy p { margin: 0 0 1.6em; max-width: 44ch; }
.story-copy p:last-of-type { margin-bottom: 1.3em; }

/* ---------- Network ---------- */
.network { padding-bottom: clamp(56px, 8vw, 110px); }
.network-head { padding: clamp(28px, 3vw, 44px) var(--gutter) 0; }
.network .title {
  padding-left: 0;
  margin-bottom: clamp(20px, 2.6vw, 38px);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(24px, 4.6vw, 66px);
  margin: 0;
  padding: 0 0 clamp(12px, 1.4vw, 20px);
  list-style: none;
  border-bottom: 1px solid var(--red);
}
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--red);
  cursor: pointer;
}
.legend button[data-line="code"] { color: var(--blue); }
.legend .swatch {
  width: 42px;
  height: 7px;
  border-radius: 4px;
  background: var(--red);
}
.legend [data-line="code"] .swatch     { background: var(--blue); }
.legend [data-line="urban"] .swatch    { background: var(--yellow); }
.legend [data-line="activities"] .swatch { background: var(--green); }

.map-wrap {
  margin: clamp(24px, 4vw, 60px) auto 0;
  max-width: 1440px;
  padding: 0 clamp(8px, 3vw, 44px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.map {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}
.map .route { fill: none; stroke-width: 7; stroke-linecap: butt; stroke-linejoin: miter; }
.map .stop  { fill: var(--bg); stroke: var(--black); stroke-width: 3.5; }
.map text {
  fill: var(--blue);
  font-family: var(--body);
  font-size: 22.2px;
}
.map .strong { font-weight: 700; }
.map .hub-label { font-size: 36px; font-weight: 700; }

.line { transition: opacity .2s ease; }
.map[data-active] .line { opacity: .18; }
.map[data-active="story"]      .line-story,
.map[data-active="code"]       .line-code,
.map[data-active="urban"]      .line-urban,
.map[data-active="activities"] .line-activities { opacity: 1; }

/* ---------- Responsive ---------- */

/* Tablet & below: story goes single column */
@media (max-width: 960px) {
  .story { grid-template-columns: 1fr; gap: 32px; }
  .story-title { font-size: clamp(30px, 8.6vw, 56px); }
  .story-copy p { max-width: 52ch; }
}

/* Mobile: hamburger menu, stacked layout */
@media (max-width: 768px) {
  body { font-size: 17px; }

  .nav-inner {
    height: 64px;
    padding: 0 20px;
  }
  .menu-toggle { display: inline-flex; }

  .menu {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    padding: 4px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--blue);
  }
  .nav.is-open .menu { display: block; }
  .menu ul {
    flex-direction: column;
    gap: 0;
  }
  .menu li + li { border-top: 1px solid rgba(40, 62, 168, .2); }
  .menu .a-link {
    display: block;
    padding: 16px 0;
    font-size: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 48px;
    padding-bottom: 56px;
  }
  .title { font-size: clamp(44px, 13vw, 72px); }
  .hero-copy .lede { margin-top: 32px; }
  .hero-copy .text-link { margin-top: 28px; }
  .hero-photo { width: min(100%, 305px); margin: 40px 0 0; }

  .story { padding-top: 56px; padding-bottom: 56px; }

  .network-head { padding-top: 32px; }
  .legend { gap: 12px 24px; }
  .legend .swatch { width: 32px; }
  .legend button { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .line,
  .menu-toggle .bars,
  .menu-toggle .bars::before,
  .menu-toggle .bars::after { transition: none; }
}

/* ---------- Map links ---------- */
.map a.station { cursor: pointer; }
.map a.station:hover text,
.map a.station:focus-visible text { text-decoration: underline; text-underline-offset: 4px; }
.map a.station:hover .stop,
.map a.station:focus-visible .stop { fill: var(--black); }
.map a.station:focus-visible { outline: none; }
.map a.station:focus-visible .stop { stroke-width: 6; }

/* ---------- Green theme (Urban Planning pages) ---------- */
body.theme-green {
  --blue: #498360;          /* re-points the "primary" colour */
  color: var(--blue);
}
.theme-green .text-link { color: var(--blue); }
.theme-green .menu li + li { border-color: rgba(73, 131, 96, .25); }

/* ---------- Amber theme (Activities page) ---------- */
body.theme-amber {
  --blue: #E8A600;          /* re-points the "primary" colour */
  color: var(--blue);
}
.theme-amber .text-link { color: var(--blue); }
.theme-amber .menu li + li { border-color: rgba(232, 166, 0, .3); }