/* AceFront public landing — hero visual prototype
   Tokens: black / silver / emerald-teal. Separable layers for future animation. */

:root {
  --bg: #050607;
  --ink: #e8ecf1;
  --muted: #8b95a5;
  --silver: #c5ccd6;
  --teal: #12c4a3;
  --teal-deep: #0a8f78;
  --teal-glow: rgba(18, 196, 163, 0.35);
  --line: rgba(197, 204, 214, 0.14);
  --panel: rgba(8, 12, 16, 0.55);
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Shell —— */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
  pointer-events: none;
}

.brand {
  order: 1;
}

.site-header__nav {
  order: 2;
  margin-left: auto;
}

.nav-cta--bar {
  order: 3;
}

.nav-menu,
.nav-menu__login {
  display: none;
}

.site-header a,
.site-header button {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.brand img {
  height: clamp(36px, 4.2vw, 44px);
  width: auto;
}

.brand-cross {
  flex: none;
  color: var(--silver);
  font-size: 1.05rem;
  line-height: 1;
}

.nav-cta__short {
  display: none;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

.brand-word span {
  color: var(--teal);
}

.nav-cta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver);
  border: 1px solid var(--line);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.nav-cta:hover {
  border-color: var(--teal);
  color: var(--ink);
}

/* —— Hero stage —— */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 22% 55%, rgba(18, 196, 163, 0.12), transparent 60%),
    radial-gradient(ellipse 40% 50% at 85% 40%, rgba(0, 0, 0, 0.2), transparent 55%),
    #020304;
}

.hero-scene {
  position: absolute;
  inset: 0;
  /* Bias scene to left/centre; preserve right negative space */
  background-image: url("../assets/hero-cockpit.jpg?v=20261021b");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% auto;
  transform-origin: 30% 55%;
  transition: transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Separable Ace layer — keeps the cat in-scene even if the plate crop shifts */
.hero-ace {
  position: absolute;
  left: clamp(3%, 9vw, 14%);
  bottom: clamp(9%, 12vh, 16%);
  width: min(16vw, 200px);
  height: auto;
  opacity: 0.92;
  /* Plate is black-backed JPG — lighten keeps Ace visible on the dark desk */
  mix-blend-mode: lighten;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  z-index: 1;
  transition: transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Ace stays static — transform + mix-blend:lighten reads as a ghost when moving */
.hero[data-robot-state="looking"] .hero-ace {
  transform: none;
}

.hero[data-robot-state="looking"] .hero-scene {
  transform: translateX(-1.2%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(90deg, transparent 0%, transparent 52%, rgba(5, 6, 7, 0.45) 72%, rgba(5, 6, 7, 0.9) 100%),
    linear-gradient(180deg, rgba(5, 6, 7, 0.4) 0%, transparent 20%, transparent 70%, rgba(5, 6, 7, 0.7) 100%);
}

.hero-glow {
  position: absolute;
  inset: 8% 38% 18% 4%;
  pointer-events: none;
  background: radial-gradient(ellipse at 45% 40%, var(--teal-glow), transparent 62%);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: glowPulse 5.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(1);
  }
  50% {
    opacity: 0.42;
    transform: scale(1.03);
  }
}

/* Floating monitor HUD overlays (simulated live ops) */
.hud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hud-panel {
  position: absolute;
  border: 1px solid rgba(18, 196, 163, 0.22);
  background: rgba(4, 10, 12, 0.42);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--silver);
  box-shadow: 0 0 24px rgba(18, 196, 163, 0.08);
  opacity: 0.9;
}

.hud-panel strong {
  color: var(--teal);
  font-weight: 500;
}

.hud-pnl {
  left: 9%;
  top: 16%;
  width: 9.5rem;
  min-width: 9.5rem;
  max-width: 9.5rem;
}

.hud-sim-label {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.5rem;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
}

.hud-status {
  left: 22%;
  top: 18%;
  min-width: 8rem;
}

.hud-illust {
  color: var(--muted);
}

.hud-alert {
  left: 14%;
  bottom: 22%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hud-alert.is-visible {
  opacity: 0.95;
  transform: translateY(0);
}

.hud-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 0.35rem;
  box-shadow: 0 0 8px var(--teal);
  animation: statusPulse 2.2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.candle-strip {
  position: absolute;
  left: 8%;
  top: 28%;
  width: min(28vw, 320px);
  height: 56px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.candle {
  width: 4px;
  border-radius: 1px;
  background: var(--teal);
  opacity: 0.85;
  transform-origin: bottom center;
  animation: candleBreath 3.2s ease-in-out infinite;
}

.candle:nth-child(odd) {
  background: var(--silver);
  opacity: 0.55;
}

@keyframes candleBreath {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.18);
  }
}

/* Copy column — HTML, not baked into art */
.hero-content {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr minmax(280px, 0.85fr);
  align-items: center;
  padding: clamp(5.5rem, 12vh, 7rem) clamp(1rem, 4vw, 3.5rem) 2.5rem;
  gap: 1.5rem;
}

.hero-spacer {
  /* Keeps left/centre for the scene; content sits on right */
  min-height: 40vh;
}

.hero-copy {
  max-width: 28rem;
  justify-self: end;
  margin-right: clamp(0rem, 2vw, 1.5rem);
  padding: 1.25rem 1.35rem 1.4rem;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(8, 12, 16, 0.55), rgba(5, 6, 7, 0.28));
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.85rem;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--teal);
}

.lede {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.55;
  max-width: 34ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: #04120f;
  box-shadow: 0 0 28px rgba(18, 196, 163, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--silver);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.meta-line span::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 0.4rem;
  vertical-align: middle;
  opacity: 0.8;
}

/* Dialogue architecture (hidden until enabled) */
.dialogue {
  position: absolute;
  left: clamp(8%, 12vw, 18%);
  bottom: 12%;
  z-index: 12;
  max-width: 22rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(18, 196, 163, 0.28);
  background: rgba(6, 10, 12, 0.72);
  backdrop-filter: blur(8px);
  font-size: 0.92rem;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.dialogue[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.dialogue small {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer {
  position: relative;
  z-index: 20;
  padding: 1rem clamp(1rem, 3vw, 2.5rem) 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  background: #050607;
}

/* Portrait uses a square crop of the same scene (robot, cat, monitors).
   The file is already 1:1, so the frame matches it without stretching.
   The card overlaps the desk so the screen reads as one composition. */
@media (orientation: portrait) and (max-width: 1024px) {
  .hero {
    min-height: 0;
    overflow: visible;
    isolation: auto;
    background: #050607;
  }

  .hero-stage {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #020304;
  }

  .hero-stage::before {
    content: "";
    display: block;
    padding-top: 100%;
  }

  .hero-scene {
    background-image: url("../assets/hero-cockpit-portrait.jpg?v=20261024c");
    background-position: center center;
    background-size: 100% 100%;
    transform: none;
  }

  .hero-vignette {
    background: linear-gradient(
      180deg,
      rgba(5, 6, 7, 0.42) 0%,
      rgba(5, 6, 7, 0) 22%,
      rgba(5, 6, 7, 0) 62%,
      rgba(5, 6, 7, 0.78) 100%
    );
  }

  .hero-glow,
  .candle-strip,
  .hud-alert,
  .dialogue {
    display: none;
  }

  .hud-layer {
    display: block;
    inset: 0;
    width: auto;
    height: auto;
  }

  .hud-pnl,
  .hud-status {
    position: absolute;
    width: auto;
    min-width: 0;
    background: rgba(8, 12, 16, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    hyphens: none;
    overflow-wrap: normal;
  }

  .hud-status {
    top: 0.7rem;
    right: 0.7rem;
    left: auto;
    bottom: auto;
    width: min(10.4rem, 46%);
    max-width: 46%;
  }

  .hud-pnl {
    top: 0.7rem;
    left: 0.7rem;
    right: auto;
    bottom: auto;
    width: min(8.6rem, 42%);
    max-width: 42%;
  }

  .hero-content {
    position: relative;
    z-index: 10;
    min-height: 0;
    display: block;
    margin-top: -7.25rem;
    padding: 1.4rem 0.85rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
      180deg,
      rgba(5, 6, 7, 0) 0%,
      rgba(5, 6, 7, 0.55) 22%,
      #050607 48%
    );
  }

  .hero-spacer {
    display: none;
  }

  .hero-copy {
    justify-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
    background: #10181f;
    color: var(--ink);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (orientation: portrait) and (min-width: 700px) and (max-width: 1024px) and (max-height: 1100px) {
  .hero-content {
    margin-top: -10.75rem;
  }
}

@media (max-width: 560px) {
  .brand-word {
    display: none;
  }

  .hero-copy h1 {
    font-size: 1.7rem;
  }

  .cta-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow,
  .candle,
  .hud-dot,
  .hero-scene {
    animation: none !important;
    transition: none !important;
  }
}
