:root {
  --navy: #071426;
  --ice: #c5d0e8;
  --muted: #8b97ad;
  --line: rgba(255, 255, 255, 0.08);
  --btn: #6b8cff;
  --ink: #f5f7fb;
  --hack: #ff4892;
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}

body {
  overflow-x: hidden;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--font);
}

html.phase-glitch,
html.phase-glitch body,
html.phase-hack,
html.phase-hack body {
  overflow: hidden;
  height: 100dvh;
  touch-action: none;
}

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

/* ——— cheap AI studio ——— */

.bad {
  position: relative;
  min-height: 100dvh;
  background: var(--navy);
}

.ai-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 38, 0.92);
}

.ai-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.ai-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--btn);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.ai-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ai-nav {
  display: none;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.ai-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--btn);
  color: #071426;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-right .ai-cta {
  padding: 8px 12px;
  font-size: 12px;
}

.ai-hero {
  position: relative;
  min-height: auto;
  display: grid;
  grid-template-rows: auto auto auto;
  padding: 22px 18px 36px;
  overflow: hidden;
}

.ai-grid {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 25% 100%, 25% 100%;
  opacity: 0.9;
}

.ai-kicker,
.ai-hero h1,
.ai-hero-bot {
  position: relative;
}

.ai-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.ai-kicker span:last-child {
  display: none;
}

.ai-hero h1 {
  margin: 8vh 0 0;
  max-width: 16ch;
  font-size: clamp(2.4rem, 11vw, 6.4rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

.ai-hero h1 em {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ice);
  word-spacing: 0.12em;
}

.ai-hero-bot {
  display: grid;
  gap: 22px;
  padding-top: 28px;
}

.ai-hero-bot > p,
.ai-lead {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.ai-actions .ai-cta {
  margin: 0;
}

.ai-ghost {
  font-size: 14px;
  color: var(--muted);
}

.ai-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.ai-steps b {
  display: inline-block;
  width: 28px;
  color: var(--ice);
  font-weight: 500;
}

.ai-sec {
  padding: 64px 18px;
  border-top: 1px solid var(--line);
}

.ai-label {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.ai-sec h2,
.ai-cta-band h2 {
  margin: 0 0 14px;
  max-width: 18ch;
  font-size: clamp(1.7rem, 6vw, 3rem);
  font-weight: 520;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.ai-cards,
.ai-shots {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.ai-cards article {
  padding: 22px 18px;
  border: 1px solid var(--line);
}

.ai-cards span {
  color: var(--muted);
  font-size: 12px;
}

.ai-cards article > p:first-of-type {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.ai-cards h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.ai-cards article > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.ai-shot {
  margin: 0;
  min-height: 220px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
}

.ai-shot span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.ai-shot strong {
  margin-top: 6px;
  font-size: 1.4rem;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.s1 {
  background:
    radial-gradient(circle at 30% 20%, #8aa4ff, transparent 45%),
    linear-gradient(160deg, #1a2b4a, #0b1a33);
}

.s2 {
  background:
    radial-gradient(circle at 70% 40%, #ffb3a8, transparent 42%),
    linear-gradient(160deg, #2a2238, #0b1a33);
}

.s3 {
  background:
    radial-gradient(circle at 40% 70%, #9fe7d0, transparent 40%),
    linear-gradient(160deg, #163246, #0b1a33);
}

.ai-proc {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.ai-proc li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.ai-proc b {
  color: var(--ice);
  margin-right: 10px;
  font-weight: 500;
}

.ai-cta-band {
  padding: 72px 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.ai-cta-band p {
  margin: 0 0 8px;
  color: var(--muted);
}

.ai-cta-band h2 {
  margin-left: auto;
  margin-right: auto;
}

.ai-cta-band .ai-cta {
  margin: 8px auto 0;
}

.ai-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  padding: 22px 18px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 860px) {
  .ai-bar,
  .ai-hero,
  .ai-sec,
  .ai-cta-band,
  .ai-foot {
    padding-left: 40px;
    padding-right: 40px;
  }

  .ai-hero {
    min-height: 100dvh;
    min-height: 100svh;
    grid-template-rows: auto 1fr auto;
  }

  .ai-kicker span:last-child {
    display: inline;
  }

  .ai-nav {
    display: flex;
  }

  .ai-hero-bot {
    grid-template-columns: 1.1fr 0.8fr 0.9fr;
    align-items: end;
  }

  .ai-cards,
  .ai-shots {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .ai-shot {
    min-height: 280px;
  }
}

html.phase-glitch .bad {
  animation: shake 0.14s infinite;
  filter: contrast(1.25) saturate(1.4);
}

.fx-glitch {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
}

html.phase-glitch .fx-glitch,
html.phase-hack .fx-glitch {
  opacity: 1;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.18) 0 1px,
      transparent 1px 3px
    ),
    linear-gradient(
      90deg,
      rgba(255, 72, 146, 0.14),
      transparent 40%,
      rgba(0, 255, 255, 0.1)
    );
  mix-blend-mode: screen;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes shake {
  0% {
    transform: translate(0);
  }
  25% {
    transform: translate(-6px, 3px);
  }
  50% {
    transform: translate(5px, -4px);
  }
  75% {
    transform: translate(-3px, -2px);
  }
}

/* ——— terminal ——— */

.hack {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

html.phase-hack .hack {
  opacity: 1;
  pointer-events: auto;
}

.term {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  color: #ff4892;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.term .cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1em;
  margin-left: 1px;
  background: #ff4892;
  vertical-align: -0.12em;
  animation: blink 0.85s step-end infinite;
}

@media (min-width: 800px) {
  .term {
    font-size: 15px;
    padding: 18px 22px;
  }
}
