/* ------------------------------------------------------------
   section-timeline.css — Advanced Monochrome Timeline with Gold Accent
   - Vertical central axis
   - Alternating cards (left/right) on desktop, stacked on mobile
   - Gold accent (subtle) for markers/underline
   - Smooth reveal animations compatible with data-animate / is-visible
   ------------------------------------------------------------ */

:root{
  --bg: #fff;
  --ink: #000;
  --muted: rgba(0,0,0,0.65);
  --gold: #b98f2b; /* touch of gold */
  --gold-weak: rgba(185,143,43,0.12);
  --card-radius: 14px;
  --t: 420ms;
  --ease: cubic-bezier(.22,.9,.32,1);
  --container-max: 1200px;
}

/* reset scope */
#timeline, #timeline * { box-sizing: border-box; }

/* Root */
#timeline {
  position: relative;
  width: 100%;
  padding: calc(env(safe-area-inset-top, 12px) + 28px) clamp(12px, 4vw, 56px);
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  overflow: visible;
}

/* Inner container to center content */
#timeline .timeline__inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
  padding-inline: clamp(8px, 3.5vw, 36px);
}

/* Header */
#timeline .timeline__header {
  text-align: center;
  margin-bottom: clamp(18px, 3vw, 36px);
}
#timeline .timeline__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
#timeline .timeline__underline {
  display: inline-block;
  height: 6px;
  width: min(280px, 28%);
  margin-top: .8rem;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold), rgba(0,0,0,0.65));
  box-shadow: 0 8px 20px var(--gold-weak);
}

/* layout: central axis */
#timeline .timeline__wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

/* central axis line */
#timeline .timeline__axis {
  grid-column: 2;
  position: relative;
  width: 6px;
  min-height: 320px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--gold), rgba(0,0,0,0.12));
  border-radius: 999px;
  box-shadow: 0 6px 18px var(--gold-weak), inset 0 2px 6px rgba(0,0,0,0.04);
}

/* axis full height bar (visually extended) */
#timeline .timeline__axis::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -50vh;
  transform: translateX(-50%);
  width: 6px;
  height: 200vh;
  background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.02));
  opacity: 0.25;
  border-radius: 999px;
}

/* items column (left/right) */
#timeline .timeline__column {
  grid-column: 1/2;
  padding-inline-end: 12px;
}
#timeline .timeline__column.right {
  grid-column: 3/4;
  padding-inline-start: 12px;
}

/* item container (position relative for connectors) */
#timeline .timeline__item {
  position: relative;
  margin-bottom: 28px;
  display: flex;
  justify-content: flex-end; /* left column items align to axis */
}

/* right column reverse alignment */
#timeline .timeline__column.right .timeline__item {
  justify-content: flex-start;
}

/* marker on the axis */
#timeline .timeline__marker {
  position: absolute;
  left: calc(100% + -38px); /* for left column markers - will be overridden for right */
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--gold);
  box-shadow: 0 6px 18px var(--gold-weak);
  z-index: 5;
  transform: translateX(0);
}

/* adjust marker for right column items */
#timeline .timeline__column.right .timeline__marker {
  left: -38px;
}

/* card content */
#timeline .timeline__card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
  border-radius: var(--card-radius);
  border: 1px solid rgba(0,0,0,0.06);
  padding: clamp(14px, 2.6vw, 24px);
  width: min(520px, 95%);
  box-shadow: 0 14px 40px rgba(0,0,0,0.06);
  transition: transform .42s var(--ease), box-shadow .42s var(--ease);
  position: relative;
  overflow: hidden;
}

/* small gold accent bar on each card */
#timeline .timeline__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 48px;
  background: linear-gradient(90deg, var(--gold), rgba(0,0,0,0.6));
  border-bottom-right-radius: 8px;
}

/* item title & meta */
#timeline .timeline__item-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 .35rem 0;
  color: var(--ink);
  text-transform: none;
}
#timeline .timeline__year {
  display: inline-block;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
  font-size: .95rem;
  margin-bottom: 6px;
}

/* description */
#timeline .timeline__desc {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  font-size: .98rem;
  padding-top: .4rem;
  border-top: 1px dashed rgba(0,0,0,0.04);
  margin-top: .6rem;
}

/* hover lift */
#timeline .timeline__card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 26px 64px rgba(0,0,0,0.12);
}

/* reveal animation for each card */
#timeline [data-animate="fade-up"], #timeline [data-animate="fade-adv"], #timeline .slide-animate {
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: var(--delay, 0ms);
}
#timeline [data-animate].is-visible, #timeline .slide-animate.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* connector line from card to axis */
#timeline .timeline__connector {
  position: absolute;
  top: 24px;
  height: 2px;
  width: calc(38px + 12px);
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.02));
  z-index: 2;
  border-radius: 2px;
}
#timeline .timeline__column.right .timeline__connector {
  left: calc(-1 * (38px + 12px));
}

/* small gold dot overlay on the marker center */
#timeline .timeline__marker::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--gold) 0%, rgba(0,0,0,0.05) 60%);
  opacity: 1;
}

/* alternate layout: left/right zigzag on desktop */
@media (min-width: 900px) {
  /* make two columns + axis in the middle */
  #timeline .timeline__wrap { grid-template-columns: 1fr 56px 1fr; }

  /* adjust card alignment per column */
  #timeline .timeline__column { display: block; }
  #timeline .timeline__item { margin-bottom: 40px; }
  #timeline .timeline__item:nth-child(odd) .timeline__card { align-self: flex-end; }
  #timeline .timeline__item:nth-child(even) .timeline__card { align-self: flex-start; }
}

/* Mobile / stacked view: single column, axis becomes top marker */
@media (max-width: 899px) {
  #timeline .timeline__wrap {
    display: block;
  }
  #timeline .timeline__axis { display: none; }
  #timeline .timeline__column, #timeline .timeline__item { width: 100%; padding: 0; margin-bottom: 18px; }
  #timeline .timeline__marker { position: relative; left: 0; margin-bottom: 10px; border-width: 2px; }
  #timeline .timeline__connector { display: none; }
  #timeline .timeline__card { width: 100%; }
}

/* accessibility focus styles */
#timeline .timeline__card:focus-within {
  outline: none;
  box-shadow: 0 0 0 8px rgba(185,143,43,0.08);
}

/* print */
@media print {
  #timeline { background: transparent; padding: 12px; height: auto; }
  #timeline .timeline__axis, #timeline .timeline__marker, #timeline .timeline__connector { display: none !important; }
  #timeline .timeline__card { box-shadow: none; background: transparent; border: none; }
}
