/* ============================================================
   hero-migrate.css — redesigned hero.
   Concept: a live "classical -> post-quantum" migration. The
   left column states the promise; the right column visualises
   it (classical algorithms struck out and re-encrypted to PQC
   under a scanning beam, with Harvest-Now-Decrypt-Later shown
   as neutralised). Uses the site theme tokens from styles.css.
   ============================================================ */

.qm { position: relative; z-index: 2; width: 100%; }

.qm__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.75rem) 0;
}
@media (max-width: 960px) {
  .qm__grid { grid-template-columns: 1fr; gap: 2.25rem; }
  /* The terminal stacks full-width below the copy here. Its desktop
     min-height (240px, sized to match the tall copy column) leaves a big
     empty void on a phone during the command-typing frames. Let it size to
     its own content instead, with just enough output floor to avoid jump. */
  .qhero__stream { max-width: 520px; }
  .qhero__terminal { min-height: auto; }
  .qhero__terminal .terminal__output { min-height: 104px; }
}

/* ---------- kicker ---------- */
.qm__kicker {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  background: rgba(255, 107, 0, 0.04);
  margin-bottom: clamp(1rem, 2.5vw, 1.6rem);
}
.qm__kicker-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-accent);
  animation: qm-pulse 2.4s ease-out infinite;
}
@keyframes qm-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

/* ---------- headline ---------- */
.qm__lead { min-width: 0; }
.qm__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--color-text);
  margin: 0 0 0.55rem;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.qm__tagline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  line-height: 1.32;
  color: var(--color-text-secondary);
  margin: 0 0 clamp(1.3rem, 2.6vw, 1.85rem);
}
.qm__hndl { color: var(--color-accent); font-weight: 700; }
.qm__was {
  position: relative; white-space: nowrap;
  color: var(--color-text-muted);
}
.qm__was::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 55%;
  height: 3px; border-radius: 2px; background: #ff3b30;
  transform: scaleX(0); transform-origin: left;
  animation: qm-strike 850ms cubic-bezier(.6, 0, .2, 1) 700ms forwards;
}
@keyframes qm-strike { to { transform: scaleX(1); } }
.qm__accent {
  color: var(--color-accent); white-space: nowrap;
  text-shadow: 0 0 34px rgba(255, 107, 0, 0.35);
}

/* ---------- lede ---------- */
.qm__lede {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  line-height: 1.62;
  color: var(--color-text-secondary);
  max-width: 46ch;
  margin: 0 0 clamp(1.5rem, 3vw, 2rem);
}
.qm__lede strong { color: var(--color-text); font-weight: 600; }

/* ---------- CTA ---------- */
.qm__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: clamp(1.4rem, 3vw, 1.9rem); }
.qm__btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.02em;
  padding: 0.8rem 1.3rem; border-radius: 10px;
  border: 1px solid var(--color-border-light);
  color: var(--color-text); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.qm__btn:hover { transform: translateY(-2px); border-color: var(--color-accent); }
.qm__btn--primary {
  background: var(--color-accent); color: #0a0a0a;
  border-color: var(--color-accent); font-weight: 600;
}
.qm__btn--primary:hover { background: #ff7d1a; box-shadow: 0 12px 34px -12px rgba(255, 107, 0, 0.65); }

/* ---------- facts ---------- */
.qm__facts { display: flex; flex-wrap: wrap; margin: 0; }
.qm__fact { padding-right: 1.5rem; margin-right: 1.5rem; border-right: 1px solid var(--color-border); }
.qm__fact:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.qm__fact dt {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 0.32rem;
}
.qm__fact dd {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--color-text); margin: 0;
}
.qm__fact a { color: inherit; text-decoration: none; }
.qm__slash { color: var(--color-accent); }

/* ============ migration visual ============ */
.qm__viz {
  position: relative;
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.92), rgba(6, 6, 6, 0.92));
  padding: 1.2rem 1.25rem 1.1rem;
  overflow: hidden;
  box-shadow: 0 34px 90px -44px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: qm-rise 700ms cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes qm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.qm__viz::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 107, 0, 0.1), transparent 58%);
}
.qm__viz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.qm__viz-title {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--color-text-secondary);
}
.qm__viz-title::before { content: "\25CF  "; color: var(--color-accent); }
.qm__viz-live {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--color-accent);
}
.qm__viz-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); animation: qm-blink 1.4s steps(1) infinite; }
@keyframes qm-blink { 50% { opacity: 0.2; } }

.qm__rail { position: relative; }
.qm__col-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 0.7rem;
}
.qm__col-label--risk { color: #ff6b6b; }
.qm__col-label--safe { color: var(--color-success); }

.qm__row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.6rem;
  padding: 0.72rem 0; border-bottom: 1px solid var(--color-border);
}
.qm__row:last-of-type { border-bottom: 0; }
.qm__from {
  font-family: var(--font-mono); font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  color: var(--color-text-muted); text-align: left;
  text-decoration: line-through; text-decoration-color: rgba(255, 59, 48, 0.65);
}
.qm__to {
  font-family: var(--font-mono); font-size: clamp(0.82rem, 1.5vw, 1rem);
  color: var(--color-accent); text-align: right; font-weight: 600;
  text-shadow: 0 0 20px rgba(255, 107, 0, 0.35);
}
.qm__to::after { content: " \2714"; color: var(--color-success); font-weight: 700; }

.qm__arrow {
  position: relative; width: clamp(30px, 6vw, 56px); height: 2px;
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.12), rgba(255, 107, 0, 0.7));
}
.qm__arrow::after {
  content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border-left: 6px solid var(--color-accent);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.qm__arrow::before {
  content: ""; position: absolute; top: 50%; left: 0;
  width: 5px; height: 5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 8px var(--color-accent); transform: translateY(-50%);
  animation: qm-flow 2.2s linear infinite;
}
.qm__row:nth-child(3) .qm__arrow::before { animation-delay: .5s; }
.qm__row:nth-child(4) .qm__arrow::before { animation-delay: 1s; }
@keyframes qm-flow {
  0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; }
}

/* scanning beam sweeping down the rail */
.qm__beam {
  position: absolute; left: -0.5rem; right: -0.5rem; top: 0; height: 46px; z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 107, 0, 0.14), transparent);
  animation: qm-scan 3.6s ease-in-out infinite;
}
@keyframes qm-scan { 0%, 100% { transform: translateY(1.4rem); } 50% { transform: translateY(10.5rem); } }

/* threat ribbon */
.qm__threat {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; padding: 0.72rem 0.9rem;
  border: 1px solid var(--color-border-light); border-radius: 10px;
  background: rgba(255, 59, 48, 0.05);
}
.qm__threat-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: #ff8f8a; }
.qm__threat-label::before { content: "\26A0  "; }
.qm__threat-status { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--color-success); font-weight: 700; }
.qm__threat-status::before { content: "\2192  "; color: var(--color-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .qm__kicker-dot, .qm__viz-dot, .qm__arrow::before, .qm__beam, .qm__viz { animation: none; }
  .qm__was::after { animation: none; transform: scaleX(1); }
}
/* On phones the 4 facts wrap 3 + 1, orphaning "Telemetry / Zero".
   Lay them out as a clean 2x2 grid and drop the vertical dividers. */
@media (max-width: 560px) {
  .qm__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
  .qm__fact { border-right: 0; padding-right: 0; margin-right: 0; }
  .qm__fact dd { font-size: 1.2rem; }
}
