/* Section 4 — Travel Through Time */

.time {
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(163, 230, 53, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 20% 10%, rgba(37, 99, 235, 0.12), transparent 55%);
}

.time .section__head {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.time-shell {
  margin-top: 40px;
  padding: 28px clamp(16px, 3vw, 28px) 24px;
  border-radius: 28px;
  background: rgba(10, 18, 40, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.time-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.time-tab {
  font-family: var(--font-display, Inter, sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(248, 250, 252, 0.55);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.time-tab:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.time-tab.is-active {
  color: #041018;
  background: linear-gradient(135deg, #67E8F9 0%, #22D3EE 55%, #A3E635 100%);
  border-color: transparent;
  font-weight: 600;
}

.time-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(12px, 2vw, 20px);
  align-items: stretch;
}

.time-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.time-panel__label {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-display, Inter, sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(103, 232, 249, 0.9);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(5, 10, 24, 0.55);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.time-panel__label--then {
  color: #BEF264;
  border-color: rgba(163, 230, 53, 0.28);
}

.time-panel__frame {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 18px;
  overflow: hidden;
  background: #050A18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.time-panel--then .time-panel__frame {
  border-color: rgba(163, 230, 53, 0.18);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(163, 230, 53, 0.08);
}

.time-panel__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.time-stage.is-switching .time-panel__frame img {
  opacity: 0.35;
  transform: scale(1.03);
}

.time-panel__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 10, 24, 0.45) 100%);
  pointer-events: none;
}

.time-panel__sheen--then {
  background:
    linear-gradient(180deg, transparent 40%, rgba(5, 10, 24, 0.4) 100%),
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(163, 230, 53, 0.1), transparent 55%);
}

.time-panel__scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(163, 230, 53, 0.08) 48%,
    transparent 52%
  );
  background-size: 100% 220%;
  animation: timeScan 4.5s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes timeScan {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 120%; }
}

.time-panel__caption {
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.95);
  min-height: 2.8em;
}

.time-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 36px;
}

.time-bridge__line {
  width: 1px;
  flex: 1;
  min-height: 40px;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.35), rgba(163, 230, 53, 0.45), transparent);
}

.time-bridge__badge {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display, Inter, sans-serif);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(190, 242, 100, 0.9);
  padding: 14px 8px;
  border-radius: 999px;
  border: 1px solid rgba(163, 230, 53, 0.25);
  background: rgba(5, 10, 24, 0.65);
  white-space: nowrap;
}

.time-footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.85);
}

@media (max-width: 860px) {
  .time-stage {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .time-bridge {
    flex-direction: row;
    padding-top: 0;
    min-height: auto;
  }

  .time-bridge__line {
    width: auto;
    flex: 1;
    min-height: 1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.35), rgba(163, 230, 53, 0.45), transparent);
  }

  .time-bridge__badge {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 8px 14px;
  }

  .time-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .time-tabs::-webkit-scrollbar {
    display: none;
  }

  .time-tab {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .time-panel__scan,
  .time-panel__frame img {
    animation: none !important;
    transition: none !important;
  }
}
