/* ---------- history timeline ---------- */
.history {
  padding-block: clamp(3.5rem, 9vh, 6.5rem);
  padding-inline: clamp(1rem, 4vw, 4rem);
  overflow-x: clip;
}

.hist-head { text-align: start; max-inline-size: 1280px; margin-inline: auto; margin-block-end: clamp(2rem, 5vh, 3.5rem); }

.hist-body {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1280px;
  margin-inline: auto;
  align-items: start;
}
@media (min-width: 1000px) {
  .hist-body {
    grid-template-columns: minmax(92px, 124px) 1.3fr 0.85fr;
    column-gap: clamp(1.5rem, 3vw, 3.5rem);
  }
  .hist-stage { position: sticky; inset-block-start: 7vh; }
}

.hist-panel {
  max-width: 34rem;
  display: grid;
  align-content: center;
  gap: 0.15rem;
}

.hist-num { width: max-content; max-width: 100%; margin-block-end: 0.35rem; }
.hist-num svg { display: block; width: clamp(190px, 24vw, 320px); height: auto; }

.hy-base,
.hy-fill {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 104px;
  direction: ltr;
  unicode-bidi: isolate;
}
.hy-base { fill: none; stroke: #45453c; stroke-width: 1.6; }
.hy-fill { fill: none; stroke-width: 2.4; }

.hist-title {
  margin: 0 0 0.55rem;
  max-width: 30ch;
  font-size: clamp(1.08rem, 1.7vw, 1.45rem);
  font-weight: 600;
  line-height: 1.6;
  color: #f4f2ee;
}

.hist-sub {
  margin: 0;
  max-width: 40ch;
  font-size: 0.92rem;
  line-height: 1.95;
  color: #a6a69f;
}

.hist-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.hist-points li {
  position: relative;
  padding-inline-start: 0.95rem;
  max-width: 44ch;
  font-size: 0.9rem;
  line-height: 1.95;
  color: #a3a39d;
}
.hist-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.98em;
  inline-size: 5px;
  block-size: 1px;
  background: #6a6a63;
}

/* stacked years, left of the copy */
.hist-years {
    display: grid;
    gap: 0.35rem;
    justify-items: end;
    align-content: center;
}
.hist-years button {
  background: none;
  border: 0;
  padding: 0.1rem 0;
  font: inherit;
  position: relative;
  font-variant-numeric: tabular-nums;
  color: #5c5c57;
  cursor: pointer;
  transition: color 0.25s linear;
}
.hist-years button:hover { color: #a3a39d; }
.hist-years button[aria-selected="true"] { color: #f4f2ee; }
.hist-years button:focus-visible { outline: 1px solid #f4f2ee; outline-offset: 3px; }

@media (max-width: 999px) {
  .hist-stage { order: 1; }
  .hist-years {
    order: 2;
    display: flex;
    gap: 1.25rem;
    align-items: baseline;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 0.25rem;
  }
  .hist-years::-webkit-scrollbar { display: none; }
  .hist-years button { min-block-size: 40px; }
  .hist-panel { order: 3; margin-block-start: 0.5rem; }
}

/* ---------- DepthCarousel (ported component CSS) ---------- */
.depth-carousel {
  position: relative;
  width: 100%;
  height: 500px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: var(--dc-perspective, 1400px);
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.depth-carousel:active { cursor: grabbing; }
.depth-carousel:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 4px;
  border-radius: 12px;
}

.depth-carousel__stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.depth-carousel__card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  overflow: hidden;
  background: #0b0d12;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.65),
    0 8px 20px -10px rgba(0, 0, 0, 0.5);
  will-change: transform, opacity, filter;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.depth-carousel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: grayscale(1);
  transition: filter 0.5s linear;
}
.depth-carousel__card:hover .depth-carousel__img { filter: none; }

.depth-carousel__tint {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.depth-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3000;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.depth-carousel__arrow:hover {
  background: rgba(28, 31, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}
.depth-carousel__arrow:active { transform: translateY(-50%) scale(0.94); }
.depth-carousel__arrow--prev { left: 16px; }
.depth-carousel__arrow--next { right: 16px; }

.depth-carousel__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 16, 22, 0.4);
  backdrop-filter: blur(6px);
}

.depth-carousel__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}
.depth-carousel__dot.is-active { width: 20px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  .depth-carousel__card { will-change: auto; }
  .depth-carousel__arrow,
  .depth-carousel__dot { transition: none; }
}


.history {
  position: relative;
  isolation: isolate;
}
.rays-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.rays-layer canvas {
  position: absolute;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100%;
}
.history > .hist-head,
.history > .hist-body {
  position: relative;
  z-index: 1;
}

/* ---------- timeline typography: the exact draft-02 type system, scoped ---------- */
@font-face { font-family: "Estedad"; src: url("../fonts/Estedad-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

.timeline-stage {
  --bg: #000;
  --ink: #f4f2ee;
  --font-display: "Estedad", "Vazirmatn", sans-serif;
  --font-text: "Vazirmatn", sans-serif;

  /* one ladder, five steps in use: 12 / 13 / 15 / 16 / 22-28 / display */
  --fs-micro: 0.75rem;
  --fs-meta: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-body: 1rem;
  --fs-lead: 1.125rem;
  --fs-title: clamp(1.35rem, 1.9vw, 1.7rem);
  --fs-display: clamp(2.2rem, 4.4vw, 3.6rem);

  --lh-body: 1.95;
  --lh-title: 1.6;
  --lh-display: 1.22;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: normal;
  color: var(--ink);
}

.timeline-stage h1, .timeline-stage h2,
.timeline-stage h3, .timeline-stage h4 { text-wrap: balance; }
.timeline-stage p, .timeline-stage li { text-wrap: pretty; }

/* the one display step: section titles */
.timeline-stage .section-title {
  margin: 0;
  text-align: start;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: normal;
}

.timeline-stage .hist-title {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: var(--fs-lead);
  line-height: var(--lh-title);
  letter-spacing: normal;
}

/* running copy */
.timeline-stage .hist-sub { font-size: var(--fs-body); line-height: var(--lh-body); }
.timeline-stage .hist-points li { font-size: var(--fs-sm); line-height: var(--lh-body); }

/* the year rail */
.timeline-stage .hist-years button {
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  font-weight: 500;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
}
.timeline-stage .hist-years button[aria-selected="true"] { color: #ffffff; font-weight: 700; }
.timeline-stage .hist-years button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -3px;
  block-size: 1px;
  background: currentColor;
  opacity: 0.65;
}

/* outlined numerals */
.timeline-stage .hy-base,
.timeline-stage .hy-fill {
  font-family: var(--font-text);
  font-weight: 900;
  font-size: 104px;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
}
.timeline-stage .hy-base { stroke-width: 1.4; }

/* ===================================================================
   Timeline type system — desktop (≥1024px)
   One gutter, one display step, one numeral scale; everything below
   reads from these tokens.
   =================================================================== */
:root{
  --tl-gutter: clamp(22px, 6vw, 96px);   /* nav, H1 and the year rail share it */
  --tl-nav: clamp(.9375rem, calc(.8125rem + .156vw), 1rem);
  --tl-num: clamp(6rem, calc(2rem + 5vw), 8rem);          /* rendered digit height */
  /* the SVG draws its digits 1.577em tall in a 300-unit box, so the box that
     yields a --tl-num-px numeral is num × 300/164 = num × 1.829 */
  --tl-num-box: calc(var(--tl-num) * 1.829);
  --tl-title: clamp(1.5rem, calc(1rem + .625vw), 1.75rem);
  --tl-lead: clamp(1.0625rem, calc(.8125rem + .3125vw), 1.1875rem);
  --tl-year: clamp(1.25rem, calc(.75rem + .625vw), 1.5rem);
  --tl-row: 48px;
  --tl-ink: rgba(240,236,255,.78);
  --tl-year-off: rgba(255,255,255,.72);
  --tl-year-hover: rgba(255,255,255,.95);
  --tl-year-active: #fff;
  --tl-num-fill: rgba(255,255,255,.03);
  --tl-num-stroke: rgba(255,255,255,.26);
}

@media (min-width:1024px){
  /* one inline-start edge for nav, H1 and the year rail */
  .timeline-stage .tl-content{padding-inline:0}
  .timeline-stage .hist-years{justify-items:start}
  .timeline-stage .hist-panel{max-width:none;justify-self:stretch}
  .timeline-stage .hist-num{margin-inline-start:calc(var(--tl-num-box) * -0.0333)}
  .timeline-stage .hist-head,
  .timeline-stage .hist-body{
    max-inline-size:none; margin-inline:0;
    padding-inline:var(--tl-gutter);
  }

  /* the page label, not a display line: the brands beat dropped its title, so this one
     shrinks to an eyebrow and lets the year rail start the composition */
  .timeline-stage .section-title{
    font-size:var(--t-crumb); font-weight:500; line-height:1.4;
    color:rgba(255,255,255,.55); letter-spacing:0; text-wrap:balance;
    text-shadow:0 1px 16px rgba(6,3,18,.55);
  }
  .timeline-stage .hist-head{margin-block-end:0;block-size:0;overflow:hidden}

  /* outlined ghost numeral */
  .timeline-stage .hist-num{margin-block-end:16px}
  .timeline-stage .hist-num svg{width:var(--tl-num-box)}
  .timeline-stage .hy-base,
  .timeline-stage .hy-fill{
    font-family:var(--font-text); font-weight:700; font-size:104px;
    letter-spacing:.04em; font-variant-numeric:tabular-nums;
  }
  .timeline-stage .hy-base{fill:var(--tl-num-fill); stroke:var(--tl-num-stroke); stroke-width:1.5}

  /* panel */
  .timeline-stage .hist-title{
    font-family:var(--font-text); font-weight:700;
    font-size:var(--tl-title); line-height:1.4;
    color:#fff; letter-spacing:0; margin-block-end:12px;
  }
  .timeline-stage .hist-sub{
    font-size:var(--tl-lead); font-weight:400; line-height:2;
    color:var(--tl-ink); max-inline-size:42ch; text-wrap:balance;
    letter-spacing:0; overflow-wrap:break-word;
  }
  .timeline-stage .hist-copy{min-block-size:9.5rem}   /* longest entry: no jump between years */

  /* year rail: fixed 48px pitch, colour-only states, no shift on select */
  .timeline-stage .hist-years{gap:0}
  .timeline-stage .hist-years button{
    font-size:var(--tl-year); font-weight:600; line-height:1; letter-spacing:0;
    font-variant-numeric:tabular-nums; padding-block:12px; padding-inline:0;
    min-block-size:var(--tl-row); display:inline-flex; align-items:center;
    justify-content:flex-end; color:var(--tl-year-off);
    text-shadow:0 1px 16px rgba(6,3,18,.55);
    transition:color .22s ease;
  }
  .timeline-stage .hist-years button:hover{color:var(--tl-year-hover)}
  .timeline-stage .hist-years button[aria-selected="true"]{color:var(--tl-year-active); font-weight:600}
  .timeline-stage .hist-years button[aria-selected="true"]::after{
    inset-block-end:8px; block-size:2px; opacity:1;
  }
  .timeline-stage .hist-years button:focus-visible{
    outline:2px solid rgba(255,255,255,.8); outline-offset:6px;
  }
}

/* nav shares the same gutter so the logo edge meets the H1 edge */
nav{padding-inline:var(--tl-gutter)}
nav a{font-size:var(--tl-nav)}
