/* About page, "My approach": a process line. Four stages sit on a track;
   hovering, focusing or clicking one fills the track up to it and swaps the
   card below (principle + a real example from the case studies).
   Behaviour in approach.js. Below 900px the stages become a 2x2 grid. */

.approach {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ---------- the line ---------- */
.approach__rail {
  position: relative;
  --active: 0; /* index of the active stage, set by approach.js */
}

.approach__track {
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 11px;
  height: 2px;
  border-radius: 2px;
  background: rgba(30, 30, 30, 0.1);
}

.approach__fill {
  display: block;
  height: 100%;
  width: calc(var(--active) / 3 * 100%);
  border-radius: inherit;
  /* chrome, matching the silver stars on the site */
  background: linear-gradient(90deg, #E4E4EA 0%, #B9BAC3 35%, #8A8C96 70%, #4E505A 100%);
  background-size: calc(100% / max(var(--active), 1) * 3) 100%;
  transition: width 500ms var(--ease);
}

.approach__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.approach__step {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 8px var(--space-1);
  border: 0;
  background: none;
  font: inherit;
  text-align: center;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 300ms var(--ease);
}

.approach__dot {
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--color-tile);
  box-shadow: inset 0 0 0 2px rgba(30, 30, 30, 0.14);
  transition: background 300ms var(--ease), box-shadow 300ms var(--ease), transform 300ms var(--ease);
}

/* stages already passed get a filled dot, the active one a ring */
.approach__step.is-done .approach__dot {
  background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, #C9CAD1 45%, #8A8C96 100%);
  box-shadow: 0 1px 2px rgba(30, 30, 30, 0.2);
  transform: scale(0.6);
}

.approach__step.is-active .approach__dot {
  /* polished metal bead */
  background: radial-gradient(circle at 34% 28%, #FFFFFF 0%, #D6D7DD 30%, #8E9099 72%, #5A5C66 100%);
  box-shadow:
    0 0 0 6px rgba(120, 122, 135, 0.14),
    0 2px 4px rgba(30, 30, 30, 0.25);
  transform: scale(1.08);
}

.approach__num {
  font-size: 12px;
  letter-spacing: 0.12em;
}

.approach__label {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.approach__sub {
  font-size: 14px;
  line-height: 1.4;
}

.approach__step:hover,
.approach__step.is-active { color: var(--color-text-black); }

.approach__step.is-active .approach__sub { color: var(--color-desc); }

.approach__step:focus-visible { outline: none; }
.approach__step:focus-visible .approach__dot { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--color-text-black); }

/* ---------- the card ---------- */
.approach__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4);
  border-radius: 24px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(30, 30, 30, 0.04);
  animation: approach-in 420ms var(--ease);
}

.approach__panel[hidden] { display: none; }

@keyframes approach-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.approach__principle {
  margin: 0;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--color-text-black);
}

.approach__proof {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-left: var(--space-4);
  border-left: 1px solid rgba(30, 30, 30, 0.09);
}

.approach__proof-label {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-tile);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.approach__proof-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-desc);
}

.approach__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-black);
  text-decoration: none;
}

.approach__link svg { transition: transform 250ms var(--ease); }
.approach__link:hover svg { transform: translate(2px, -2px); }

@media (prefers-reduced-motion: reduce) {
  .approach__panel { animation: none; }
  .approach__fill, .approach__dot { transition: none; }
}

@media (max-width: 900px) {
  .approach__track { display: none; }
  .approach__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .approach__step {
    align-items: flex-start;
    text-align: left;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
  }
  .approach__step.is-active { background: #FFFFFF; }
  .approach__dot { width: 14px; height: 14px; margin-bottom: 4px; }
  .approach__panel { grid-template-columns: 1fr; gap: var(--space-2); padding: var(--space-3); }
  .approach__proof { padding-left: 0; padding-top: var(--space-2); border-left: 0; border-top: 1px solid rgba(30, 30, 30, 0.09); }
}

/* tiles switched off with the hidden attribute (e.g. the Stay Organized board) */
.about-block[hidden] { display: none !important; }
