/* ============================================================
   HSEI.IO — technology.css
   /technology: engine aesthetic — terminals, signal flow, labs
   ============================================================ */

.tech-page .toc-content {
  position: relative;
  overflow-x: clip;
}

.tech-page .page-title {
  animation: none;
}

/* ---------- DIRECTIONAL ENTRANCE ---------- */
.tech-enter {
  opacity: 0;
  filter: blur(8px);
  transition:
    opacity 2.1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2.25s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.95s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}
.tech-enter--from-left { transform: translateX(-64px); }
.tech-enter--from-right { transform: translateX(64px); }
.tech-enter--from-up { transform: translateY(48px) scale(0.96); }
.tech-enter--from-center {
  transform: scaleX(0);
  transform-origin: center center;
  filter: none;
}
.tech-enter.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}
.tech-enter--from-center.is-visible {
  transform: scaleX(1);
}

.tech-converge-rail {
  height: 2px;
  margin: 10px 0 22px;
  overflow: hidden;
  border-radius: 999px;
}
.tech-converge-rail span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--teal-accent) 20%,
    var(--gold) 50%,
    rgba(14, 207, 180, 0.5) 80%,
    transparent 100%
  );
  opacity: 0.75;
}

/* ---------- HERO · ENGINE GRID ---------- */
#s-engine {
  position: relative;
  padding-bottom: 8px;
}
.tech-hero-bg {
  position: absolute;
  inset: -20px -40px 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 207, 180, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(14, 207, 180, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
  opacity: 0.9;
}
.tech-hero-bg::after {
  content: "";
  position: absolute;
  top: 12%;
  right: 8%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 0.5px solid rgba(14, 207, 180, 0.2);
  box-shadow: 0 0 40px rgba(14, 207, 180, 0.08);
  animation: tech-orbit 8s ease-in-out infinite;
}
@keyframes tech-orbit {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

/* ---------- MAC WINDOW (architecture) ---------- */
.mac-window {
  background: rgba(4, 22, 20, 0.92);
  border: 0.5px solid rgba(14, 207, 180, 0.22);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.mac-window__titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(14, 207, 180, 0.06);
  border-bottom: 0.5px solid rgba(14, 207, 180, 0.15);
}
.mac-window__controls {
  display: flex;
  gap: 6px;
}
.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}
.mac-dot--close { background: #ff5f57; }
.mac-dot--minimize { background: #febc2e; }
.mac-dot--maximize { background: #28c840; }
.mac-window__title {
  color: rgba(14, 207, 180, 0.65);
  letter-spacing: 0.08em;
  font-size: 11px;
}
.tech-arch-body.mac-window__body {
  padding: 4px;
  background: rgba(1, 18, 16, 0.95);
}

/* ---------- SECTIONS ---------- */
.tp-sec {
  margin-bottom: 52px;
  padding-bottom: 52px;
  border-bottom: 0.5px solid var(--border-neutral);
  position: relative;
}
.tp-sec:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.sec-label {
  color: var(--teal-accent);
  margin-bottom: 14px;
  display: block;
  letter-spacing: 0.12em;
}
.sec-title {
  color: var(--text-main);
  margin-bottom: 16px;
}
.tp-body {
  color: var(--text-muted);
  margin-bottom: 14px;
}
.tp-body strong {
  color: var(--text-main);
  font-weight: 500;
}
.tp-body em {
  color: var(--teal-accent);
  font-style: normal;
}

/* Architecture diagram */
.arch-svg-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 2px;
  margin: 0;
  overflow: hidden;
}
.tech-arch-mac {
  margin: 24px 0;
}
.tech-arch-mac.is-flowing line {
  stroke-dasharray: 6 8;
  animation: tech-signal-flow 1.4s linear infinite;
}
.tech-arch-mac.is-flowing line:nth-child(2) {
  animation-delay: 0.35s;
}
@keyframes tech-signal-flow {
  to { stroke-dashoffset: -28; }
}

/* Formula blocks · terminal */
.formula-block {
  background: rgba(4, 18, 16, 0.85);
  border: 0.5px solid rgba(14, 207, 180, 0.2);
  border-radius: 6px;
  padding: 16px 20px 16px 28px;
  margin: 16px 0;
  color: var(--teal-accent);
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.formula-block::before {
  content: ">";
  position: absolute;
  left: 12px;
  top: 16px;
  color: rgba(14, 207, 180, 0.45);
  font-family: var(--font-tech);
  font-size: 12px;
}
.formula-block:hover {
  border-color: rgba(14, 207, 180, 0.4);
  box-shadow: 0 0 24px rgba(14, 207, 180, 0.06);
}
.formula-block--teal {
  border-color: rgba(14, 207, 180, 0.45);
  background: linear-gradient(135deg, rgba(14, 207, 180, 0.08), rgba(4, 18, 16, 0.9));
  box-shadow: 0 0 30px rgba(14, 207, 180, 0.08);
}
.fb-label {
  color: var(--text-ghost);
  margin-bottom: 8px;
  display: block;
}
.fb-label--teal {
  color: var(--teal-accent);
}
.fb-note {
  color: var(--text-ghost);
  margin-top: 8px;
}

/* Layer cards */
.layer-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.layer-card {
  padding: 18px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-neutral);
  border-radius: var(--radius-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.layer-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 207, 180, 0.25);
}
.layer-card--gold {
  border-color: rgba(228, 184, 174, 0.35);
  background: linear-gradient(160deg, rgba(228, 184, 174, 0.08), var(--bg-surface));
  box-shadow: 0 12px 40px rgba(228, 184, 174, 0.1);
  transform: scale(1.02);
  z-index: 1;
}
.layer-card--gold:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: 0 16px 48px rgba(228, 184, 174, 0.15);
}
.lc-num {
  color: var(--teal-accent);
  margin-bottom: 8px;
  opacity: 0.8;
}
.layer-card--gold .lc-num {
  color: var(--gold);
}
.lc-title {
  color: var(--text-main);
  margin-bottom: 6px;
}
.lc-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.li {
  color: var(--text-ghost);
  display: flex;
  gap: 5px;
}
.li.active::before {
  content: "→";
  color: var(--teal-accent);
  flex-shrink: 0;
}
.li.future::before {
  content: "◦";
  color: var(--text-ghost);
  flex-shrink: 0;
}

/* AI box */
.ai-box {
  background: linear-gradient(135deg, var(--gold-dim2), rgba(14, 207, 180, 0.04));
  border: 0.5px solid var(--border-gold);
  border-radius: 8px;
  padding: 22px 24px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}
.ai-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--teal-accent));
  opacity: 0.6;
}
.ai-label {
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}
.ai-text {
  color: var(--text-muted);
}
.ai-text strong {
  color: var(--text-main);
  font-weight: 500;
}

/* Research centres */
.centres-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.centre-card {
  padding: 20px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-neutral);
  border-radius: var(--radius-card);
  transition: border-color 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}
.centre-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--teal-accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.centre-card:hover {
  border-color: rgba(14, 207, 180, 0.35);
  transform: translateY(-2px);
}
.centre-card:hover::before {
  opacity: 1;
}
.cc-badge {
  color: var(--teal-accent);
  margin-bottom: 8px;
  display: block;
  opacity: 0.8;
}
.cc-name {
  color: var(--text-main);
  margin-bottom: 6px;
}
.cc-desc {
  color: var(--text-ghost);
}

/* Privacy */
.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}
.priv-item {
  padding: 14px 16px 14px 18px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-neutral);
  border-radius: var(--radius-card);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-left: 2px solid rgba(14, 207, 180, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.priv-item:hover {
  background: var(--bg-surface-light);
  border-left-color: var(--teal-accent);
}
.priv-icon {
  color: var(--teal-accent);
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
}
.priv-title {
  color: var(--text-main);
  margin-bottom: 3px;
  font-weight: 500;
}
.priv-desc {
  color: var(--text-ghost);
}

/* Roadmap */
.roadmap {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-neutral);
  border-radius: 8px;
  overflow: hidden;
}
.rm-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  border-bottom: 0.5px solid var(--border-neutral);
  transition: background 0.25s ease;
}
.rm-row:last-child {
  border-bottom: none;
}
.rm-row.is-live {
  background: rgba(14, 207, 180, 0.04);
}
.rm-row.is-live .rm-phase {
  box-shadow: inset 3px 0 0 var(--teal-accent);
}
.rm-phase {
  padding: 16px;
  background: var(--bg-surface-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 0.5px solid var(--border-neutral);
  transition: box-shadow 0.3s ease;
}
.rmp-label {
  color: var(--text-ghost);
  margin-bottom: 3px;
}
.rmp-name {
  color: var(--teal-accent);
  font-weight: 500;
}
.rm-content {
  padding: 14px 18px;
}
.rmc-title {
  color: var(--text-main);
  margin-bottom: 4px;
}
.rmc-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rmi {
  padding: 3px 9px;
  border-radius: 20px;
}
.rmi.live {
  border: 0.5px solid rgba(14, 207, 180, 0.35);
  color: var(--teal-accent);
  background: var(--teal-dim2);
}
.rmi.next {
  border: 0.5px solid rgba(228, 184, 174, 0.3);
  color: var(--gold);
  background: var(--gold-dim2);
}
.rmi.future {
  border: 0.5px solid var(--border-neutral-md);
  color: var(--text-ghost);
}

.tech-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 0.5px solid var(--border-neutral);
}

@media (max-width: 1023px) {
  .layer-row,
  .centres-grid {
    grid-template-columns: 1fr;
  }
  .layer-card--gold {
    transform: none;
  }
  .layer-card--gold:hover {
    transform: translateY(-3px);
  }
  .privacy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .rm-row {
    grid-template-columns: 1fr;
  }
  .rm-phase {
    border-right: none;
    border-bottom: 0.5px solid var(--border-neutral);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-enter {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
  .tech-hero-bg::after,
  .tech-arch-mac.is-flowing line {
    animation: none;
  }
}
