/* ================= ACHIEVEMENTS — FOCUS YEAR + KEYWORD ONLY ================= */
:root {
  /* existing palette */
  --ach-bg: linear-gradient(135deg, #000428, #004e92);
  --ach-fg: #fff;
  --ach-div: rgba(255, 255, 255, 0.12);

  /* highlight accents */
  --ach-accent-1: #ffffff;
  --ach-accent-2: #ffd166;
  --ach-accent-3: #ff7b7b;

  /* focus tuning */
  --ach-dim: 0.30;           /* how dim non-active items appear */
  --active-scale: 1.14;      /* how much year/keyword scales up */
  --shine-duration: 1s;
  --glow-color: rgba(255, 215, 102, 0.12); /* soft halo */
}

/* container */
.achievements {
  background: var(--ach-bg);
  color: var(--ach-fg);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Title (unchanged) */
.achievements-title {
  font-family: 'Six Caps', sans-serif;
  letter-spacing: 0.18em;
  font-size: clamp(40px, 4.5vw, 72px);
  text-align: center;
  padding: 36px 0 20px;
}

/* layout */
.timeline { width: 100%; margin: 0; padding: 0; }
.timeline-row { position: relative; width: 100%; overflow: visible; }
.timeline-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.28s ease, backdrop-filter 0.28s ease;
  z-index: 0;
}

/* row inner */
.row-inner {
  display: grid;
  grid-template-columns: 18% 1fr 18%;
  align-items: center;
  padding: 20px 8vw;
  border-top: 1px solid var(--ach-div);
  position: relative;
  z-index: 1;
  min-height: 140px;
  box-sizing: border-box;
}
.timeline-row:last-child .row-inner { border-bottom: 1px solid var(--ach-div); }

/* year / keyword / desc base */
.year,
.keyword {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  font-size: clamp(38px, 4.5vw, 40px);
  position: relative;
  z-index: 1;
  transition: transform 0.36s cubic-bezier(.2,.9,.3,1), opacity 0.32s ease, text-shadow 0.36s;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
}
.year { text-align: left; }
.keyword { text-align: right; }

.desc {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(18px, 0.4vw, 22px);
  font-family: 'Poppins', sans-serif;
  line-height: 1.75;
  opacity: 0.95;             /* keep middle copy readable — do NOT animate */
  position: relative;
  z-index: 1;
  transition: opacity 0.28s ease; /* gentle fade when row not active */
}

/* ====== FOCUS RULES: only YEAR + KEYWORD should pop ====== */

/* make all non-active rows dim strongly (so the active row stands out) */
.achievements .timeline-row:not(.active) {
  opacity: 0.78; /* slight overall dim for context */
}
.achievements .timeline-row:not(.active) .year,
.achievements .timeline-row:not(.active) .keyword {
  opacity: var(--ach-dim);
  transform: none;
  filter: none;
  -webkit-text-fill-color: initial;
  color: rgba(255,255,255,0.60);
  background: none;
  text-shadow: none;
}

/* keep description neutral for active state — do NOT animate or push up */
.timeline-row .desc {
  /* remain calm — not part of the highlight */
  transform: none !important;
  color: rgba(255,255,255,0.92);
  opacity: 0.95;
}

/* active row: subtle glass background to separate from page */
.timeline-row.active::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  backdrop-filter: blur(6px) saturate(110%);
}

/* YEAR & KEYWORD: dramatic highlight when active (or hovered) */
.timeline-row.active .year,
.timeline-row.active .keyword,
.timeline-row:hover .year,
.timeline-row:hover .keyword {
  /* animated gradient text */
  background: linear-gradient(90deg, var(--ach-accent-1), var(--ach-accent-2), var(--ach-accent-3));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0px transparent;
  color: transparent;
  animation: gradientShift 3.6s linear infinite;
  transform: translateY(-4px) scale(var(--active-scale));
  opacity: 1;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-shadow:
    0 18px 50px rgba(1,10,30,0.6),
    0 6px 18px rgba(0,0,0,0.35);
  position: relative;
  z-index: 4;
}

/* add a soft glowing halo behind the active year/keyword to direct focus */
.timeline-row.active .year::before,
.timeline-row.active .keyword::before,
.timeline-row:hover .year::before,
.timeline-row:hover .keyword::before {
  content: "";
  position: absolute;
  inset: -14px -18px -14px -18px; /* expand behind text */
  border-radius: 10px;
  background: radial-gradient(closest-side, var(--glow-color), transparent 60%);
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.36s ease, transform 0.36s ease;
}

/* sweeping underline/shine for added polish (subtle) */
.timeline-row.active .keyword::after,
.timeline-row.active .year::after,
.timeline-row:hover .keyword::after,
.timeline-row:hover .year::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  height: 3px;
  bottom: -8px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  transform: translateX(-120%);
  animation: shine var(--shine-duration) ease forwards;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.95;
  z-index: 3;
}

/* remove any previous rule that made .desc lift on hover/active */
.timeline-row:hover .desc,
.timeline-row.active .desc {
  /* intentionally left neutral — no transform, no color change */
  transform: none;
  color: rgba(255,255,255,0.92);
  opacity: 0.95;
}

/* keyboard focus accessibility (show same as active) */
.timeline-row:focus-within,
.timeline-row:focus {
  outline: none;
}
.timeline-row:focus-within::before,
.timeline-row:focus::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  backdrop-filter: blur(4px) saturate(110%);
}

/* reduced distractions on smaller screens while keeping focus behavior */
@media (max-width: 992px) {
  .row-inner { grid-template-columns: 22% 1fr 22%; padding: 24px 3vw; }
  .year, .keyword { font-size: clamp(28px, 4vw, 38px); }
  .timeline-row.active .year,
  .timeline-row.active .keyword,
  .timeline-row:hover .year,
  .timeline-row:hover .keyword { transform: translateY(-3px) scale(1.08); text-shadow: 0 8px 24px rgba(0,0,0,0.36); }
}

/* mobile layout */
@media (max-width: 768px) {
  .row-inner { grid-template-columns: 1fr; gap: 12px; padding: 22px 3vw; text-align: center; }
  .year, .desc, .keyword { text-align: center; }
  .year, .keyword { font-size: 28px; }
  .desc { font-size: 16px; line-height: 1.6; }

  /* make glow/shine smaller on mobile */
  .timeline-row .keyword::after,
  .timeline-row .year::after { bottom: -6px; height: 2.6px; left: -6%; right: -6%; }
  .timeline-row .year::before,
  .timeline-row .keyword::before { inset: -10px -10px -10px -10px; filter: blur(10px); }
}

/* keyframes */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shine {
  0% { transform: translateX(-120%); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* end of file */
