@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/anton-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/courier-prime-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/courier-prime-700-latin.woff2") format("woff2");
}

:root {
  --paper: #f7f7f2;
  --white: #ffffff;
  --blue: #0018f0;
  --navy: #08133d;
  --ink: #11162d;
  --muted: #68708b;
  --line: #c9cde2;
  --soft: #eceef8;
  --green: #16a56f;
  --display: "Anton", Impact, sans-serif;
  --mono: "Courier Prime", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(0, 24, 240, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 24, 240, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 40px 40px;
  color: var(--ink);
  font-family: var(--mono);
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 242, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-glyph {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 25px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.network-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 165, 111, 0.12);
}

.credit-readout {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.btn {
  min-height: 42px;
  border: 1px solid var(--blue);
  border-radius: 0;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(0, 24, 240, 0.18);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.btn-outline {
  background: transparent;
  color: var(--blue);
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-wide {
  width: 100%;
}

.btn-compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
}

main {
  width: min(1220px, 92vw);
  max-width: 100%;
  margin: 0 auto;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: clamp(44px, 7vw, 104px);
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 64px 0 48px;
}

.hero,
.hero-copy,
.console {
  min-width: 0;
}

.hero-video {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: -1;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-video video,
.hero-video-wash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video video {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.9) contrast(0.9) brightness(1.12);
}

.hero-video-wash {
  background:
    linear-gradient(90deg, rgba(247, 247, 242, 0.86), rgba(247, 247, 242, 0.68) 50%, rgba(247, 247, 242, 0.78)),
    linear-gradient(180deg, rgba(247, 247, 242, 0.12), rgba(247, 247, 242, 0.72));
}

.eyebrow,
.field-label {
  display: block;
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-family: var(--display);
  font-size: clamp(66px, 7vw, 108px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.9;
}

h1 span {
  color: var(--blue);
}

.lede {
  max-width: 560px;
  margin: 30px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.manifesto {
  display: inline-block;
  margin: 0 0 34px;
  border-bottom: 3px solid var(--blue);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.spec-grid div {
  min-width: 0;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.spec-grid div:last-child {
  border-right: 0;
}

.spec-grid strong,
.spec-grid span {
  display: block;
}

.spec-grid strong {
  color: var(--blue);
  font-size: 19px;
}

.spec-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.route-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.route-line b {
  color: var(--blue);
}

.console {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(247, 247, 242, 0.58));
  box-shadow:
    0 28px 80px rgba(8, 19, 61, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(1.14);
  -webkit-backdrop-filter: blur(22px) saturate(1.14);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 16px;
  background: var(--blue);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.console > .window-bar {
  min-height: 50px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(0, 24, 240, 0.12);
  background: rgba(255, 255, 255, 0.26);
  color: var(--navy);
}

.console-status::before {
  content: "●";
  margin-right: 6px;
  color: #62f0b6;
  text-shadow: 0 0 10px rgba(22, 165, 111, 0.7);
}

.console-body {
  padding: 22px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
}

textarea {
  min-height: 132px;
  padding: 17px 18px;
  resize: vertical;
  border-color: rgba(0, 24, 240, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  caret-color: var(--blue);
  font-size: 14px;
  line-height: 1.55;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

input {
  min-height: 46px;
  margin-bottom: 18px;
  padding: 0 13px;
}

textarea:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

textarea:focus {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(0, 24, 240, 0.08);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.prompt-chips button {
  border: 1px solid rgba(0, 24, 240, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.prompt-chips button:hover {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.76);
  color: var(--blue);
}

.model-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 0.65fr;
  margin: 18px 0 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 24, 240, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
}

.model-row > div {
  padding: 12px 14px;
  border-right: 1px solid rgba(0, 24, 240, 0.1);
}

.model-row > div:last-child {
  border-right: 0;
}

.model-row .field-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.model-row strong {
  font-size: 12px;
}

.render-button {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  background: linear-gradient(100deg, #0018f0, #2446ff);
  box-shadow: 0 12px 28px rgba(0, 24, 240, 0.2);
  font-size: 14px;
}

.terminal {
  height: 52px;
  margin-top: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(0, 24, 240, 0.1);
  border-radius: 10px;
  background: rgba(8, 19, 61, 0.06);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.terminal p {
  margin: 0 0 5px;
}

.terminal .error {
  color: #b61f3e;
}

.terminal .accent {
  color: #08734d;
}

.progress-track {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--blue);
  font-size: 11px;
}

#progressBlocks {
  overflow: hidden;
  white-space: nowrap;
}

.output-strip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid var(--blue);
  padding: 10px;
}

.output-play {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--blue);
  color: white;
  cursor: pointer;
}

.output-strip strong,
.output-strip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-strip small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 58px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.flow article {
  display: flex;
  gap: 16px;
  min-height: 112px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.flow article:last-child {
  border-right: 0;
}

.flow article > span {
  color: var(--blue);
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
}

.flow strong {
  font-size: 12px;
  letter-spacing: 0.1em;
}

.flow p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 4vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 19, 61, 0.72);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(460px, 100%);
  border: 1px solid var(--blue);
  background: var(--white);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.2);
}

.modal-body {
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 11px/1 var(--mono);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--navy);
  color: var(--white);
}

.icon-button {
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
}

.form-note,
.form-error {
  margin: 0 0 18px;
  font-size: 11px;
}

.form-note {
  color: var(--muted);
}

.form-error {
  color: #c21638;
}

.modal-player {
  width: min(920px, 96vw);
}

.modal-player video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
}

.player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 52px;
  }

  .hero-copy {
    max-width: 720px;
  }

  h1 {
    font-size: clamp(64px, 13vw, 104px);
  }

  .console {
    max-width: 720px;
  }
}

@media (max-width: 680px) {
  .topbar {
    min-height: 60px;
    padding: 0 18px;
  }

  .brand {
    font-size: 20px;
  }

  .network-status,
  .credit-readout {
    display: none;
  }

  main {
    width: min(100% - 32px, 620px);
  }

  .hero {
    gap: 38px;
    padding: 42px 0 34px;
  }

  .hero-video video {
    object-position: 56% center;
  }

  .hero-video-wash {
    background: rgba(247, 247, 242, 0.78);
  }

  h1 {
    font-size: clamp(54px, 17vw, 78px);
  }

  .lede {
    margin-top: 22px;
    font-size: 14px;
  }

  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .spec-grid div:nth-child(2) {
    border-right: 0;
  }

  .spec-grid div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .route-line {
    font-size: 9px;
  }

  .console {
    border-radius: 16px;
    box-shadow: 0 20px 56px rgba(8, 19, 61, 0.15);
  }

  .console-body {
    padding: 16px;
  }

  .model-row {
    grid-template-columns: 1fr;
  }

  .model-row > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .model-row > div:last-child {
    border-bottom: 0;
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .flow article {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .flow article:last-child {
    border-bottom: 0;
  }

  .player-footer,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .hero-video video {
    display: none;
  }

  .hero-video {
    background: url("assets/racing-background-poster.jpg") center / cover no-repeat;
  }
}
