/* ========================================================================
   Envelop homepage v3 — Operations Clock hero + Engagement Timeline
   Loaded AFTER styles.css. Reuses v2 styles for risk snapshot + rail.
   ======================================================================== */

/* ---------- 1. Operations Clock hero ----------------------------------- */

.hero-clock {
  background:
    radial-gradient(ellipse 70% 50% at 80% 5%, rgba(42, 157, 143, 0.22), transparent 65%),
    radial-gradient(ellipse 60% 60% at 0% 100%, rgba(127, 193, 116, 0.12), transparent 65%),
    linear-gradient(160deg, #04111a 0%, #0a2024 35%, #0E4A46 100%);
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  padding: 130px 24px 72px;
  position: relative;
}

.hero-clock::before {
  background-image:
    linear-gradient(rgba(166, 230, 218, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 230, 218, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  inset: 0;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 0%, transparent 80%);
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.hero-clock-shell {
  margin: 0 auto;
  max-width: 1200px;
  position: relative;
  z-index: 2;
}

.hero-clock-meta {
  align-items: center;
  border-bottom: 1px solid rgba(166, 230, 218, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 60px;
  padding-bottom: 18px;
}

.hero-clocks {
  display: flex;
  gap: 0;
}

.hero-clock-city {
  align-items: flex-start;
  border-right: 1px solid rgba(166, 230, 218, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 22px;
  position: relative;
}

.hero-clock-city:first-child { padding-left: 0; }
.hero-clock-city:last-child { border-right: none; padding-right: 0; }

.hero-clock-city-label {
  color: rgba(238, 248, 243, 0.5);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-clock-city-time {
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  line-height: 1.1;
}

.hero-clock-city-time small {
  color: #A6E6DA;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-left: 4px;
  text-transform: uppercase;
}

.hero-clock-city-date {
  color: rgba(238, 248, 243, 0.45);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* "Active" city = the SOC region currently in business hours.
   Adds a subtle on-mark glow + bright label */
.hero-clock-city.is-on .hero-clock-city-label { color: #A6E6DA; }
.hero-clock-city.is-on::before {
  background: #7FC174;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(127, 193, 116, 0.85);
  content: "";
  height: 6px;
  position: absolute;
  right: 22px;
  top: 4px;
  width: 6px;
  animation: hero-status-pulse 2s ease-in-out infinite;
}
.hero-clock-city:last-child.is-on::before { right: 0; }

.hero-clock-live {
  align-items: center;
  background: rgba(127, 193, 116, 0.12);
  border: 1px solid rgba(127, 193, 116, 0.5);
  border-radius: 999px;
  color: #B9E5A8;
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  gap: 8px;
  letter-spacing: 0.18em;
  margin-left: auto;
  padding: 6px 14px 6px 12px;
  text-transform: uppercase;
}

.hero-clock-live-dot {
  background: #7FC174;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(127, 193, 116, 0.6);
  height: 8px;
  position: relative;
  width: 8px;
  animation: hero-live-pulse 1.8s ease-in-out infinite;
}

@keyframes hero-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(127, 193, 116, 0.6); }
  50%      { box-shadow: 0 0 0 7px rgba(127, 193, 116, 0); }
}

@keyframes hero-status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

.hero-clock-progress {
  background: rgba(166, 230, 218, 0.12);
  border-radius: 999px;
  flex: 1 1 240px;
  height: 2px;
  max-width: 280px;
  overflow: hidden;
  position: relative;
}

.hero-clock-progress::after {
  background: linear-gradient(90deg, transparent, #A6E6DA, transparent);
  content: "";
  height: 100%;
  position: absolute;
  top: 0;
  width: 40%;
  animation: clock-sweep 6s linear infinite;
}

@keyframes clock-sweep {
  from { left: -40%; }
  to   { left: 100%; }
}

.hero-clock-eyebrow {
  color: #A6E6DA;
  margin-bottom: 28px;
}

.hero-clock h1 {
  font-size: clamp(40px, 6.4vw, 88px);
  font-weight: 800;
  letter-spacing: -0.026em;
  line-height: 0.98;
  margin: 0 0 28px;
  max-width: 14ch;
}

.hero-clock h1 em {
  color: transparent;
  background: linear-gradient(135deg, #A6E6DA 0%, #7FC174 80%);
  -webkit-background-clip: text;
  background-clip: text;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

.hero-clock-lede {
  color: rgba(238, 248, 243, 0.78);
  font-size: 19px;
  line-height: 1.55;
  margin: 0 0 36px;
  max-width: 580px;
}

/* The spotlight card — rotates every 6s */
.hero-spotlight {
  background:
    linear-gradient(135deg, rgba(18, 58, 60, 0.45) 0%, rgba(8, 22, 26, 0.6) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(166, 230, 218, 0.18);
  border-radius: 18px;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 0 44px;
  max-width: 720px;
  overflow: hidden;
  padding: 26px 28px;
  position: relative;
}

.hero-spotlight::before {
  background: linear-gradient(90deg, transparent, #A6E6DA, transparent);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  animation: clock-sweep 6s linear infinite;
}

.hero-spotlight-status {
  align-items: center;
  color: rgba(238, 248, 243, 0.5);
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0.22em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.hero-spotlight-tag {
  background: rgba(166, 230, 218, 0.14);
  border-radius: 999px;
  color: #A6E6DA;
  padding: 3px 10px;
}

.hero-spotlight-context {
  color: rgba(238, 248, 243, 0.55);
}

.hero-spotlight-frames {
  position: relative;
  min-height: 60px;
}

.hero-spotlight-frame {
  inset: 0;
  opacity: 0;
  position: absolute;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-spotlight-frame.is-active {
  opacity: 1;
  transform: translateY(0);
}

.hero-spotlight h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
  margin: 0 0 6px;
  text-wrap: pretty;
}

.hero-spotlight h2 .acc { color: #A6E6DA; font-weight: 600; }

.hero-spotlight p {
  color: rgba(238, 248, 243, 0.7);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.hero-spotlight-pills {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  padding-left: 24px;
}

.hero-spotlight-pill {
  background: rgba(166, 230, 218, 0.06);
  border: 1px solid rgba(166, 230, 218, 0.16);
  border-radius: 999px;
  color: rgba(238, 248, 243, 0.55);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 5px 12px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.hero-spotlight-pill.is-active {
  background: rgba(166, 230, 218, 0.16);
  border-color: rgba(166, 230, 218, 0.42);
  color: #A6E6DA;
}

.hero-clock-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-clock-actions .button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Mini KPI strip at the bottom */
.hero-clock-kpis {
  border-top: 1px solid rgba(166, 230, 218, 0.14);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 56px;
  padding-top: 24px;
}

.hero-kpi {
  border-right: 1px solid rgba(166, 230, 218, 0.1);
  padding: 4px 24px 4px 0;
}

.hero-kpi:last-child { border-right: none; }

.hero-kpi-label {
  color: rgba(238, 248, 243, 0.5);
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero-kpi-value {
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1;
}

.hero-kpi-value small {
  color: #A6E6DA;
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

@media (max-width: 900px) {
  .hero-clock-kpis { grid-template-columns: repeat(2, 1fr); gap: 18px 0; }
  .hero-kpi:nth-child(2) { border-right: none; }
  .hero-spotlight { grid-template-columns: 1fr; gap: 16px; }
  .hero-spotlight-pills { flex-direction: row; padding-left: 0; flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .hero-clock { padding: 110px 18px 54px; min-height: auto; }
  .hero-clock-meta { gap: 14px; margin-bottom: 36px; }
  .hero-clock-progress { display: none; }
  .hero-clock-live { margin-left: 0; }
  .hero-clocks { flex-wrap: wrap; gap: 12px 0; }
  .hero-clock-city { padding: 0 14px 0 0; border-right: none; }
  .hero-clock-city + .hero-clock-city { border-left: 1px solid rgba(166, 230, 218, 0.14); padding-left: 14px; }
  .hero-clock-kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- 2. Engagement Timeline ------------------------------------- */

.timeline-section {
  background: linear-gradient(180deg, #f7faf8 0%, #ffffff 100%);
  padding: 96px 24px;
  position: relative;
}

.timeline-head {
  margin: 0 auto 56px;
  max-width: var(--max);
}

.timeline-head h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.08;
  margin: 0 0 16px;
  max-width: 18ch;
}

.timeline-head h2 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

.timeline-head-row {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}

.timeline-head p {
  font-size: 17px;
  margin: 0;
  max-width: 480px;
}

.timeline-frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 26, 26, 0.08);
  margin: 0 auto;
  max-width: var(--max);
  overflow: hidden;
}

.timeline-axis {
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 200px 1fr;
}

.timeline-axis-label {
  align-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 14px 20px;
  text-transform: uppercase;
}

.timeline-axis-weeks {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
}

.timeline-axis-week {
  border-right: 1px solid rgba(216, 226, 220, 0.6);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 14px 0 14px 8px;
  text-align: left;
}

.timeline-axis-week:last-child { border-right: none; }

.timeline-rows {
  position: relative;
}

/* Sweep line that animates across on intersect */
.timeline-sweep {
  background: linear-gradient(180deg, transparent 0%, rgba(42, 157, 143, 0.5) 20%, rgba(42, 157, 143, 0.5) 80%, transparent 100%);
  bottom: 0;
  left: 200px;
  position: absolute;
  top: 0;
  transform: translateX(-100%);
  width: 2px;
  z-index: 3;
  pointer-events: none;
}

.timeline-frame.is-revealed .timeline-sweep {
  animation: timeline-sweep 1.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes timeline-sweep {
  0%   { transform: translateX(-100%); opacity: 0; }
  20%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(calc(100vw - 200px)); opacity: 0; }
}

.timeline-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 200px 1fr;
  position: relative;
  transition: background 0.3s ease;
}

.timeline-row:last-child { border-bottom: none; }

.timeline-row:hover { background: rgba(42, 157, 143, 0.025); }

.timeline-row.is-active { background: rgba(42, 157, 143, 0.05); }

.timeline-row-label {
  align-items: flex-start;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  padding: 22px 20px;
}

.timeline-row-label strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.timeline-row-label small {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline-row-track {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  min-height: 80px;
  padding: 14px 0;
  position: relative;
}

/* Gridlines behind tracks */
.timeline-row-track::before {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc((100% - 1px) / 13),
    rgba(216, 226, 220, 0.5) calc((100% - 1px) / 13),
    rgba(216, 226, 220, 0.5) calc(100% / 13)
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

/* The bar */
.timeline-bar {
  align-items: center;
  background: var(--gradient-brand);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(42, 157, 143, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  grid-column: var(--start) / span var(--span);
  height: 44px;
  letter-spacing: -0.005em;
  margin: 0 4px;
  opacity: 0;
  overflow: hidden;
  padding: 0 16px;
  position: relative;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease, box-shadow 0.3s ease;
  z-index: 2;
}

.timeline-frame.is-revealed .timeline-bar {
  animation: timeline-bar-in 0.7s cubic-bezier(0.34, 1.4, 0.52, 1) forwards;
}

.timeline-row:nth-child(1) .timeline-bar { animation-delay: 0.1s; }
.timeline-row:nth-child(2) .timeline-bar { animation-delay: 0.25s; }
.timeline-row:nth-child(3) .timeline-bar { animation-delay: 0.4s; }
.timeline-row:nth-child(4) .timeline-bar { animation-delay: 0.55s; }
.timeline-row:nth-child(5) .timeline-bar { animation-delay: 0.7s; }

@keyframes timeline-bar-in {
  0%   { opacity: 0; transform: scaleX(0); }
  100% { opacity: 1; transform: scaleX(1); }
}

.timeline-bar:hover {
  box-shadow: 0 14px 30px rgba(42, 157, 143, 0.36);
}

.timeline-bar.is-active {
  box-shadow: 0 14px 30px rgba(42, 157, 143, 0.36), 0 0 0 3px rgba(166, 230, 218, 0.6);
}

.timeline-bar-text {
  position: relative;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-bar.alt {
  background: linear-gradient(135deg, #1D6D68 0%, #0E4A46 100%);
}

.timeline-bar.warm {
  background: linear-gradient(135deg, #2A9D8F 0%, #7FC174 100%);
}

.timeline-bar.deep {
  background: linear-gradient(135deg, #0E4A46 0%, #1D6D68 100%);
}

/* Detail drawer */
.timeline-detail {
  background: linear-gradient(180deg, #f7faf8, #fff);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: 200px 1fr;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease;
}

.timeline-detail.is-open {
  max-height: 320px;
  opacity: 1;
}

.timeline-detail-meta {
  border-right: 1px solid var(--line);
  padding: 24px 20px;
}

.timeline-detail-meta .eyebrow {
  margin-bottom: 8px;
}

.timeline-detail-meta strong {
  color: var(--ink);
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-detail-meta small {
  color: var(--muted);
  font-size: 13px;
}

.timeline-detail-body {
  padding: 24px 28px;
}

.timeline-detail-body h4 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.timeline-detail-body > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
  max-width: 580px;
}

.timeline-detail-deliv {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}

.timeline-detail-deliv li {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
  padding: 10px 14px;
}

.timeline-detail-deliv li::before {
  background: var(--gradient-brand);
  border-radius: 50%;
  content: "";
  flex-shrink: 0;
  height: 6px;
  width: 6px;
}

.timeline-legend {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  gap: 18px;
  letter-spacing: 0.04em;
  padding: 14px 20px;
}

.timeline-legend-item {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.timeline-legend-item::before {
  border-radius: 3px;
  content: "";
  height: 10px;
  width: 14px;
}

.timeline-legend-item.assess::before { background: linear-gradient(135deg, #2A9D8F, #7FC174); }
.timeline-legend-item.foundation::before { background: linear-gradient(135deg, #1D6D68, #0E4A46); }
.timeline-legend-item.optimize::before { background: linear-gradient(135deg, #0E4A46, #1D6D68); }

@media (max-width: 900px) {
  .timeline-axis,
  .timeline-row { grid-template-columns: 130px 1fr; }
  .timeline-sweep { left: 130px; }
  .timeline-detail { grid-template-columns: 130px 1fr; }
  .timeline-axis-week:nth-child(odd) { color: transparent; }
  .timeline-bar { padding: 0 8px; font-size: 12px; }
  .timeline-detail-deliv { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .timeline-section { padding: 64px 16px; }
  .timeline-axis-weeks { display: none; }
  .timeline-axis,
  .timeline-row { grid-template-columns: 1fr; }
  .timeline-row-label { border-right: none; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .timeline-row-track { display: block; padding: 12px 16px; min-height: 0; }
  .timeline-row-track::before { display: none; }
  .timeline-bar { grid-column: auto !important; height: 38px; margin: 0; transform: none !important; opacity: 1 !important; }
  .timeline-sweep { display: none; }
  .timeline-detail { grid-template-columns: 1fr; }
  .timeline-detail-meta { border-right: none; border-bottom: 1px solid var(--line); }
}
