/* =========================================================
   WORK EXPERIENCE -- Timeline + Sticky Sidebar
   ========================================================= */

/* ---------- Section shell ---------- */
.work {
  min-height: 100vh;
  padding: clamp(48px, 6vh, 96px) 0;
  display: flex;
  align-items: center;
}

/* ---------- Section heading ---------- */
.work .section-heading {
  margin-bottom: clamp(20px, 2.5vh, 36px);
}

/* Section heading styles live in base.css - no need to duplicate */

/* ---------- Two-column layout ---------- */
.exp-layout {
  display: grid;
  grid-template-columns: 1fr clamp(200px, 22vw, 300px);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

/* =========================================================
   TIMELINE (structure preserved, restyled)
   ========================================================= */

/* Tokens */
.work {
  --rail-w: 32px;
  --date-w: clamp(130px, 14vw, 170px);
  --col-gap: clamp(12px, 1.5vw, 20px);
  --row-gap: clamp(32px, 4vh, 52px);
  --spine-w: 2px;
  --dot-size: 10px;
  --dot-ring-w: 3px;
  --bridge-w: 1px;
  --bridge-overlap: 1px;
  --logo-size: clamp(40px, 3.5vw, 52px);
  --fg: var(--exp-text);
  --dim: var(--exp-muted);
  --spine: var(--exp-spine);
  --bridge: var(--exp-bridge);
  --dot: var(--exp-dot);
  --dot-ring: var(--exp-dot-ring);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: min(900px, 100%);
  position: relative;
  display: grid;
  row-gap: var(--row-gap);
  overflow: visible;
}

/* White spine */
.timeline::before {
  content: "";
  position: absolute;
  left: calc((var(--rail-w) - var(--spine-w)) / 2);
  top: calc(var(--logo-size) / 2);
  bottom: calc(var(--logo-size) / 2);
  width: var(--spine-w);
  background: var(--spine);
  opacity: 1;
  z-index: 0;
}

/* Red progress bar */
.timeline::after {
  content: "";
  position: absolute;
  left: calc((var(--rail-w) - var(--spine-w)) / 2);
  top: calc(var(--logo-size) / 2);
  width: var(--spine-w);
  height: var(--progress-height, 0px);
  background: var(--accent);
  z-index: 1;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px 2px var(--accent-glow-strong);
}

/* Item grid */
.t-item {
  display: grid;
  grid-template-columns: var(--rail-w) var(--date-w) 1fr;
  grid-template-rows: var(--logo-size) auto;
  column-gap: var(--col-gap);
  row-gap: clamp(4px, 0.5vw, 8px);
  align-items: start;
  position: relative;
}

/* Rail */
.t-rail {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: relative;
  min-height: 100%;
}

.t-rail::after { display: none; }

/* Dot - centered vertically with the logo */
.t-dot {
  position: absolute;
  left: 50%;
  top: calc(var(--logo-size) / 2);
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 var(--dot-ring-w) var(--dot-ring);
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease, opacity 0.4s ease;
}

/* Dot states — past and active share the same style */
.t-item.is-past .t-dot,
.t-item.is-active .t-dot {
  background: var(--accent);
  box-shadow:
    0 0 0 var(--dot-ring-w) var(--accent-light),
    0 0 12px 4px var(--accent-glow);
  animation: exp-dot-pulse 2s ease-in-out infinite;
  opacity: 1;
}

@keyframes exp-dot-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 var(--dot-ring-w) var(--accent-light),
      0 0 12px 4px var(--accent-glow);
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    box-shadow:
      0 0 0 calc(var(--dot-ring-w) + 2px) var(--accent-glow-intense),
      0 0 20px 8px var(--accent-glow-strong);
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.t-item.is-future .t-dot {
  background: var(--dot);
  opacity: 1;
  box-shadow: 0 0 0 var(--dot-ring-w) var(--dot-ring);
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-item.is-active .t-dot {
    animation: none;
    transform: translate(-50%, -50%);
  }
}

/* Bridge */
.t-bridge {
  position: absolute;
  left: calc(
    (var(--rail-w) / 2) + (var(--dot-size) / 2) + var(--dot-ring-w) - var(--bridge-overlap)
  );
  top: calc(var(--logo-size) / 2 - var(--bridge-w) / 2);
  width: calc(
    (var(--rail-w) / 2) + var(--col-gap) - (var(--dot-size) / 2) - var(--dot-ring-w) + var(--bridge-overlap)
  );
  height: 0;
  border-top: var(--bridge-w) solid var(--bridge);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
  transition: border-color 0.4s ease, opacity 0.4s ease;
}

.t-item.is-past .t-bridge { border-top-color: var(--accent); opacity: 0.8; }
.t-item.is-active .t-bridge { border-top-color: var(--accent); opacity: 1; }
.t-item.is-future .t-bridge { border-top-style: dashed; border-top-color: var(--bridge); opacity: 0.25; }

/* Date */
.t-date {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: clamp(11px, 0.8vw, 13px);
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 2;
  line-height: 1.2;
  padding-left: 8px;
}

/* Header: logo + meta */
.t-head {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: var(--logo-size) 1fr;
  column-gap: clamp(12px, 1.2vw, 16px);
  align-items: center;
  align-self: center;
}

/* Logo */
.t-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--exp-logo-bg);
  border: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.t-logo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Meta */
.t-meta { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 2px; }

.t-company {
  margin: 0;
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.2;
  color: var(--fg);
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: clamp(12px, 0.85vw, 14px);
}

.t-location .t-pin {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  object-fit: contain;
}

/* Bullets */
.t-body { grid-column: 3; grid-row: 2; }

.t-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
}

.t-points li {
  position: relative;
  margin: 0;
  padding-left: 16px;
  font-size: clamp(12px, 0.9vw, 14px);
  line-height: 1.6;
  color: var(--text-secondary);
}

.t-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim);
}

.t-points li strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* =========================================================
   STICKY SIDEBAR
   ========================================================= */
.exp-sidebar {
  position: sticky;
  top: calc(var(--header-h, 56px) + 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 16px);
}

.exp-summary-card {
  background: var(--about-tile-bg, var(--bg-secondary));
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: clamp(14px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.3s ease;
}

.exp-summary-card:hover {
  border-color: var(--border-secondary);
}

.exp-summary-card__title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-weight: 700;
  font-size: clamp(13px, 1vw, 15px);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.exp-summary-card__ico {
  font-size: 16px;
}

/* Stat rows */
.exp-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: clamp(12px, 0.85vw, 14px);
}

.exp-stat-row:last-child {
  border-bottom: none;
}

.exp-stat-row__label {
  color: var(--text-muted);
}

.exp-stat-row__value {
  font-weight: 700;
  color: var(--text-primary);
}

/* Tool chips */
.exp-tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono, 'Space Mono', monospace);
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.exp-tool-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.exp-tool-chip__label {
  white-space: nowrap;
}

/* Always white icon boxes in work experience section */
.work .icon-box,
.work .icon-box.icon-box--sm {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Pin icon theming */
:root[data-theme="dark"] .t-location .t-pin {
  filter: brightness(0) invert(1);
}

:root[data-theme="light"] .t-location .t-pin {
  filter: none;
}