/* ════════════════════════════════════════════════════════════════
   v5 — wow: split hero · live terminal · scroll progress ·
   status ticker · floating nav
   ════════════════════════════════════════════════════════════════ */

/* ── Scroll progress bar ─────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 200; pointer-events: none;
  background: rgba(255,255,255,0.04);
}
.scroll-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ABAAB 0%, #5FE3D2 60%, #FFBB34 100%);
  box-shadow: 0 0 12px rgba(42,186,171,0.7);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .12s linear;
}

/* ── Hero rebuilt as split layout when wide ───────────────── */
@media (min-width: 1100px) {
  .hero { padding-top: 132px; padding-bottom: 84px; min-height: 100vh; align-items: center; }
  .hero-inner {
    max-width: 1360px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(400px, 460px);
    grid-template-rows: auto auto auto auto auto;
    column-gap: 40px;
    align-items: start;
    text-align: left;
  }
  /* Text column = grid column 1, items stack */
  .hero-inner > .reveal:nth-child(1) { grid-column: 1; grid-row: 1; }
  .hero-inner > .reveal:nth-child(2) { grid-column: 1; grid-row: 2; margin-top: 8px; }
  .hero-inner > .reveal:nth-child(3) { grid-column: 1; grid-row: 3; margin-top: 12px; }
  .hero-inner > .reveal:nth-child(4) { grid-column: 1; grid-row: 4; margin-top: 28px; }
  /* Terminal column = grid column 2, spans all rows */
  .hero-inner > .hero-side {
    grid-column: 2; grid-row: 1 / span 5;
    align-self: center; justify-self: end;
    max-width: 460px; width: 100%;
  }

  .hero-h1   { text-align: left; font-size: clamp(38px, 4.6vw, 64px); letter-spacing: -2.5px; margin-bottom: 0; line-height: 1.06; word-break: normal; overflow-wrap: break-word; }
  .hero-desc { text-align: left; margin-left: 0; max-width: 520px; margin-bottom: 0; font-size: 15px; }
  .hero-cta  { justify-content: flex-start; }
  .hero-badge{ align-self: flex-start; margin-bottom: 0; }
}

/* hero side wrapper - holds the LiveTerminal */
.hero-side { position: relative; z-index: 3; min-width: 0; }

/* ── Live terminal widget ─────────────────────────────────── */
.lt-shell {
  position: relative;
  background: linear-gradient(180deg, rgba(15,19,24,0.95), rgba(10,12,16,0.95));
  border: 1px solid rgba(42,186,171,0.22);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 60px rgba(42,186,171,0.10),
    0 0 0 1px rgba(42,186,171,0.06) inset;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  isolation: isolate;
}
.lt-shell::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% -20%, rgba(42,186,171,0.18), transparent 60%);
  pointer-events: none; z-index: 0;
}
.lt-shell::after {
  content: ''; position: absolute; left: 0; right: 0; top: 38px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(42,186,171,0.45), transparent);
  background-size: 30% 100%;
  animation: ddc-scan 4s ease-in-out infinite;
  pointer-events: none; z-index: 1;
}

.lt-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  position: relative; z-index: 2;
}
.lt-dot { width: 10px; height: 10px; border-radius: 50%; }
.lt-dot--red    { background: #FF5C5C; box-shadow: 0 0 6px rgba(255,92,92,0.6); }
.lt-dot--amber  { background: #FFBB34; box-shadow: 0 0 6px rgba(255,187,52,0.6); }
.lt-dot--green  { background: #2ABAAB; box-shadow: 0 0 6px rgba(42,186,171,0.6); }
.lt-title {
  margin-left: 8px; font-family: var(--font-mono); font-size: 11px;
  color: rgba(255,255,255,0.55); letter-spacing: 1.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.lt-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  color: #5FE3D2; letter-spacing: 2px;
  padding: 3px 9px; border-radius: 100px;
  background: rgba(42,186,171,0.10); border: 1px solid rgba(42,186,171,0.30);
}
.lt-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5FE3D2; box-shadow: 0 0 10px #5FE3D2;
  animation: ddc-pulse 1.5s ease-in-out infinite;
}

.lt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(255,255,255,0.06);
  position: relative; z-index: 2;
}
.lt-tile {
  background: rgba(10,12,16,0.7);
  padding: 16px 18px 12px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; min-width: 0;
}
.lt-tile-label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 2px;
  color: rgba(255,255,255,0.4); text-transform: uppercase;
}
.lt-tile-value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -1px;
  color: #fff;
  line-height: 1;
}
.lt-tile-value small {
  font-size: 12px; color: rgba(255,255,255,0.4); margin-left: 4px; font-weight: 400; letter-spacing: 0;
}
.lt-tile-value.warn { color: #FFBB34; }
.lt-spark { width: 100%; height: 24px; margin-top: 4px; display: block; }
.lt-bar-meter {
  width: 100%; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 14px;
}
.lt-bar-meter > div {
  height: 100%; background: linear-gradient(90deg, #2ABAAB, #FFBB34);
  border-radius: 2px;
  transition: width .6s var(--ease-out-expo);
}

.lt-feed {
  position: relative; z-index: 2;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 6px;
  min-height: 260px; max-height: 320px; overflow: hidden;
}
.lt-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  grid-template-areas:
    "time verb code lat"
    "target target target target";
  gap: 3px 10px;
  align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
  animation: lt-row-in .35s ease;
}
@keyframes lt-row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.lt-time { grid-area: time; color: rgba(255,255,255,0.35); }
.lt-verb {
  grid-area: verb;
  font-weight: 700; letter-spacing: 1px;
  padding: 1px 7px; border-radius: 4px;
  background: rgba(42,186,171,0.10); color: #5FE3D2;
  width: fit-content;
}
.lt-verb.v-AUTH, .lt-verb.v-ТЕК { background: rgba(255,187,52,0.10); color: #FFBB34; }
.lt-target {
  grid-area: target;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .2px;
  font-size: 11.5px;
  padding-left: 2px;
}
.lt-code {
  grid-area: code;
  color: #5FE3D2;
  letter-spacing: 1px;
  justify-self: end;
}
.lt-code.c3 { color: #FFBB34; }
.lt-lat {
  grid-area: lat;
  color: rgba(255,255,255,0.45);
  letter-spacing: .5px;
  justify-self: end;
}

/* ── Hero 3D emblem (Three.js) ─────────────────────────────── */
.hero-emblem-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  mask-image: radial-gradient(ellipse at 50% 46%, #000 18%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 46%, #000 18%, transparent 72%);
}
.hero-emblem-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-emblem-ready .hero-emblem-canvas { opacity: 0.42; }
.hero-emblem-ready .hero-monogram { opacity: 0; }
.hero-emblem-fallback .hero-monogram { opacity: 1; }
.hero-emblem-wrap .hero-monogram {
  transition: opacity 0.5s ease;
}

/* ── Status ticker — data ribbon ───────────────────────────── */
.status-ticker {
  position: relative; z-index: 3;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,12,16,0.62);
  backdrop-filter: blur(12px);
  overflow: hidden;
  padding: 15px 0;
}
.status-ticker-track {
  display: inline-flex;
  animation: marquee 42s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.status-ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
}
.st-label {
  color: var(--ddc-teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}
.st-val { color: rgba(255,255,255,0.82); }
.st-val--up { color: #5fe3d2; }
.st-val--down { color: #e08a7a; }
.st-val--flat { color: rgba(255,255,255,0.65); }

@media (prefers-reduced-motion: reduce) {
  .status-ticker-track { animation: none; }
}

/* ── Floating nav (right edge) ────────────────────────────── */
.floating-nav {
  position: fixed; top: 50%; right: 24px;
  transform: translateY(-50%);
  z-index: 99;
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px 8px;
  border-radius: 100px;
  background: rgba(10,12,16,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
}
.fn-dot {
  position: relative;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  height: 12px;
}
.fn-pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.20);
  transition: background .25s, transform .25s, box-shadow .25s;
}
.fn-dot:hover .fn-pip,
.fn-dot.active .fn-pip {
  background: var(--ddc-teal);
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(42,186,171,0.7);
}
.fn-label {
  position: absolute;
  right: 18px; top: 50%; transform: translateY(-50%) translateX(8px);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--ddc-teal); white-space: nowrap;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(10,12,16,0.95);
  border: 1px solid rgba(42,186,171,0.3);
  opacity: 0; pointer-events: none;
  visibility: hidden;
  transition: opacity .2s, transform .25s, visibility .2s;
}
.fn-dot:hover .fn-label,
.fn-dot:focus-visible .fn-label {
  opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0);
}
@media (max-width: 900px) {
  .floating-nav { display: none; }
}

/* ── Mobile hero / terminal ───────────────────────────────── */
@media (max-width: 768px) {
  .hero-side { margin-top: 24px; }
  .lt-shell {
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  }
  .lt-bar { padding: 10px 12px; }
  .lt-title { font-size: 10px; }
  .lt-tile { padding: 12px; }
  .lt-val { font-size: 18px; }
  .lt-feed { max-height: 140px; padding: 10px 12px; }
  .status-ticker { display: none; }
}

/* ── Tighten hero badge so it fits split layout ───────────── */
@media (min-width: 1100px) {
  .hero-badge { font-size: 10px; padding: 7px 18px 7px 12px; }
}

/* ── Hide hero scroll indicator on split layout (terminal owns space) */
@media (min-width: 1100px) {
  .hero-scroll { display: none; }
}

/* ── Soften hero monogram on split layout ─────────────────── */
@media (min-width: 1100px) {
  .hero-monogram { font-size: clamp(280px, 28vw, 460px); left: 30%; opacity: .55; }
}
