/* ============================================================
   Milestones page — engineering log
   - Banner (warm-dark, no full-bleed photo)
   - Sticky year rail + vertical card stack
   - Cards alternate image-left / image-right for rhythm
   - Token-clean: all font-sizes use var(--fs-*).
     The only exception is the giant year numeral on each card
     (display numeral, allowed by handoff to stay on clamp()).
   ============================================================ */

.mst-accent { color: var(--accent); }

/* ────── 0. Page surface ────── */
body { background: #17131B; }
#main-content { background: #17131B; color: #FFFFFF; }

/* ────── 1. BANNER ────── */
.mst-banner{
  position: relative;
  /* Top offset matches the standard .au-breadcrumb on other pages
     (header-h + 12px) so the breadcrumb lines up site-wide. */
  padding: calc(var(--header-h, 76px) + 12px) var(--gutter, 32px) 32px;
  max-width: var(--container, 1320px);
  margin: 0 auto;
}
.mst-breadcrumb{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-s);
  color: rgba(255,255,255,0.62);
  margin: 0 0 28px;
  display: flex;
  gap: 8px;
  align-items: center;
  letter-spacing: 0.02em;
}
.mst-breadcrumb a{ color: rgba(255,255,255,0.62); text-decoration: none; transition: color 200ms; }
.mst-breadcrumb a:hover{ color: var(--accent); }
.mst-breadcrumb [aria-current]{ color: #FFFFFF; }

.mst-banner__inner{
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 880px;
}
.mst-banner__eyebrow{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.mst-banner__title{
  font-family: 'Raleway', sans-serif;
  font-size: clamp(24px, 4.5vw, 35px); /* fluid: matches all banners site-wide, no breakpoint jump */
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  color: #FFFFFF;
}
@media (max-width: 767px){
  .mst-banner__title{ line-height: 1.15; }   /* font-size handled by fluid clamp */
}
.mst-banner__lede{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-m);
  line-height: 1.6;
  color: rgba(255,255,255,0.82);
  margin: 0;
  max-width: 64ch;
}

/* ────── 2. ENGINEERING LOG  (rail + cards) ────── */
.mst-log{
  padding: 16px 0 96px;
}
.mst-log__inner{
  max-width: var(--container, 1320px);
  margin: 0 auto;
  padding: 0 var(--gutter, 32px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 1024px){
  .mst-log__inner{ grid-template-columns: 140px 1fr; gap: 56px; }
}

/* ── Sticky year rail ── */
.mst-rail{
  font-family: 'Raleway', sans-serif;
  position: relative;
}
@media (min-width: 1024px){
  .mst-rail{
    position: sticky;
    top: calc(var(--header-h, 76px) + 24px);
    height: max-content;
    align-self: start;
    /* If the full year list is taller than the viewport, let the rail
       scroll internally so every year stays reachable (hidden scrollbar). */
    max-height: calc(100vh - var(--header-h, 76px) - 48px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .mst-rail::-webkit-scrollbar{ display: none; }
}
.mst-rail__label{
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 14px;
}
.mst-rail__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
@media (min-width: 1024px){
  .mst-rail__list{ flex-direction: column; gap: 2px; }
}
.mst-rail__list a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-s);
  font-weight: 600;
  font-family: 'Inter', 'Raleway', sans-serif;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 220ms, background 220ms;
}
@media (min-width: 1024px){
  .mst-rail__list a{
    padding: 6px 8px;
    border-left: 2px solid transparent;
    border-radius: 0;
    margin-left: -2px;
  }
}
.mst-rail__list a:hover{ color: #FFFFFF; background: rgba(255,255,255,0.04); }
.mst-rail__list a.is-active{
  color: #FFFFFF;
  background: rgba(245,130,32,0.10);
}
@media (min-width: 1024px){
  .mst-rail__list a.is-active{
    background: transparent;
    border-left-color: var(--accent);
    color: var(--accent);
  }
}

/* ── Card stack ── */
.mst-cards{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mst-card{
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 44px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  scroll-margin-top: calc(var(--header-h, 76px) + 32px);
}
.mst-card:first-child{ padding-top: 8px; }
.mst-card:last-child{ border-bottom: 0; }

@media (min-width: 768px){
  .mst-card{
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
  }
  /* Alternate image side every other card for visual rhythm.
     All right-aligned helpers below sit inside this media block so
     they don't leak onto mobile (which keeps everything left-aligned). */
  .mst-card:nth-child(even){
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
  .mst-card:nth-child(even) .mst-card__media{ order: 2; }
  .mst-card:nth-child(even) .mst-card__body{ order: 1; text-align: right; }
  .mst-card:nth-child(even) .mst-card__index{ justify-content: flex-end; }
  .mst-card:nth-child(even) .mst-card__title{ margin-left: auto; }
  .mst-card:nth-child(even) .mst-card__text{ margin-left: auto; }
  .mst-card:nth-child(even) .mst-card__list{ text-align: left; max-width: 50ch; margin-left: auto; }
}

.mst-card__media{
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  aspect-ratio: 3 / 2;
  box-shadow: 0 16px 36px rgba(0,0,0,0.32);
  transition: transform 320ms ease, border-color 220ms ease;
}
.mst-card:hover .mst-card__media{
  border-color: rgba(245,130,32,0.30);
}
.mst-card__media img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mst-card:hover .mst-card__media img{
  transform: scale(1.02);
}

.mst-card__body{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mst-card__index{
  font-family: 'Inter', 'Raleway', sans-serif;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mst-card__index-total{ color: rgba(255,255,255,0.45); }

/* Display year - clamp() because it's a display numeral
   (handoff explicitly allows this for sticky giant figures). */
.mst-card__year{
  font-family: 'Inter', 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.94);
  margin: 0;
}
.mst-card__title{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-l);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: #FFFFFF;
  margin: 8px 0 6px;
  max-width: 28ch;
}
.mst-card__text{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-m);
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
  margin: 0;
  max-width: 48ch;
}
/* Multi-bullet body for milestones with more than one entry (2013, 2014). */
.mst-card__list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mst-card__list li{
  position: relative;
  padding-left: 18px;
  font-size: var(--fs-m);
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
}
.mst-card__list li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
/* On even cards (right-aligned text) put the dot on the right of the li
   so the bulleted lines visually echo the alignment. */
@media (min-width: 768px){
  .mst-card:nth-child(even) .mst-card__list li{
    padding-left: 0;
    padding-right: 18px;
  }
  .mst-card:nth-child(even) .mst-card__list li::before{
    left: auto;
    right: 0;
  }
}

/* Mobile - stack image on top, text below, never alternate. */
@media (max-width: 767px){
  .mst-card{ padding: 32px 0; gap: 18px; }
  .mst-card__title{ font-size: var(--fs-l); max-width: 100%; }
  .mst-card__text{ font-size: var(--fs-s); max-width: 100%; }
  .mst-card__year{ font-size: clamp(40px, 11vw, 60px); }
  .mst-card__list li{ font-size: var(--fs-s); }
}

/* ────── Mobile / tablet rail - sticky bottom strip ──────
   Below the desktop breakpoint the rail moves to the bottom
   of the viewport as a horizontal scroller. Swipe to scrub
   (free via overflow-x: auto on touch), tap to jump, and
   the active chip auto-centres as scrollspy fires. */
@media (max-width: 1023px){
  /* Year strip sits at the top (below the header); give the content
     top clearance so the first card isn't hidden under the fixed strip. */
  .mst-log{ padding-top: 32px; padding-bottom: 40px; }

  .mst-rail{
    position: fixed;
    top: var(--header-h, 76px); left: 0; right: 0; bottom: auto;
    z-index: 40;
    background: rgba(23, 19, 27, 0.94);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
            backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding: 10px 0;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
  }
  .mst-rail__label{ display: none; }
  .mst-rail__list{
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 14px;
    gap: 4px;
    scroll-behavior: smooth;
  }
  .mst-rail__list::-webkit-scrollbar{ display: none; }
  .mst-rail__list li{ flex: 0 0 auto; }
  .mst-rail__list a{
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: var(--fs-s);
    font-weight: 600;
    letter-spacing: -0.005em;
    /* Cancel desktop border-left / margin overrides */
    border-left: 1px solid transparent;
    margin-left: 0;
  }
  .mst-rail__list a:hover{
    background: rgba(255, 255, 255, 0.10);
    color: #FFFFFF;
  }
  .mst-rail__list a.is-active{
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
  }

  /* Light-theme flip for the bottom strip */
  :root[data-theme="light"] .mst-rail{
    background: rgba(255, 255, 255, 0.94);
    border-bottom-color: var(--ink-12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  :root[data-theme="light"] .mst-rail__list a{
    background: var(--ink-06);
    color: var(--ink-60);
  }
  :root[data-theme="light"] .mst-rail__list a:hover{
    background: var(--ink-12);
    color: var(--ink);
  }
  :root[data-theme="light"] .mst-rail__list a.is-active{
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
  }
}

/* ────── 3. CODA ────── */
.mst-coda{
  background: #0A0809;
  padding: 72px var(--gutter, 32px);
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.mst-coda__inner{
  max-width: 760px;
  margin: 0 auto;
}
.mst-coda__eyebrow{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.mst-coda__title{
  font-family: 'Raleway', sans-serif;
  font-size: var(--fs-l);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 28px;
  color: #FFFFFF;
}
.mst-coda__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ────── Reduced motion ────── */
@media (prefers-reduced-motion: reduce){
  .mst-card__media img,
  .mst-card__media{ transition: none !important; }
}

/* ────── Light theme adjustments ────── */
:root[data-theme="light"] body,
:root[data-theme="light"] #main-content{
  background: #FAFAF8;
  color: var(--ink);
}
:root[data-theme="light"] .mst-breadcrumb,
:root[data-theme="light"] .mst-breadcrumb a{ color: var(--ink-60); }
:root[data-theme="light"] .mst-breadcrumb [aria-current]{ color: var(--ink); }
:root[data-theme="light"] .mst-banner__title,
:root[data-theme="light"] .mst-card__year,
:root[data-theme="light"] .mst-card__title,
:root[data-theme="light"] .mst-coda__title{ color: var(--ink); }
:root[data-theme="light"] .mst-banner__lede,
:root[data-theme="light"] .mst-card__text,
:root[data-theme="light"] .mst-card__list li{ color: var(--ink-80); }
:root[data-theme="light"] .mst-rail__label,
:root[data-theme="light"] .mst-card__index-total{ color: var(--ink-40); }
:root[data-theme="light"] .mst-rail__list a{ color: var(--ink-60); }
:root[data-theme="light"] .mst-rail__list a:hover{ background: var(--ink-06); color: var(--ink); }
:root[data-theme="light"] .mst-card{ border-bottom-color: var(--ink-12); }
:root[data-theme="light"] .mst-card__media{
  background: var(--paper-elev);
  border-color: var(--ink-12);
  box-shadow: 0 16px 36px rgba(0,0,0,0.10);
}
:root[data-theme="light"] .mst-coda{
  background: var(--paper-elev);
  border-top-color: var(--ink-12);
}
