:root {
  color-scheme: dark;
  --bg: #030a1f;
  --bg-2: #050c27;
  --panel: #071234;
  --panel-2: #071a3d;
  --line: #29458d;
  --line-hot: #35a8ff;
  --text: #eef4ff;
  --muted: #aebbe2;
  --cyan: #78d7ff;
  --blue: #1f69ff;
  --blue-2: #1d83ff;
  --violet: #7428f0;
  --green: #6cff84;
  --amber: #ffe679;
  --danger: #ff6b8b;
  --max: 1220px;
  --radius: 8px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(4, 7, 24, 0.96), rgba(6, 19, 58, 0.98) 46%, rgba(3, 31, 67, 0.97)),
    #030a1f;
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(120, 215, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 215, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: calc(var(--max) + 48px);
  margin: 0 auto;
  padding: 12px 24px;
  backdrop-filter: blur(18px);
  background: rgba(3, 10, 31, 0.82);
  border-bottom: 1px solid rgba(41, 69, 141, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  color: #ffffff;
  font-size: 11px;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav-links a {
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #fff;
  border-color: var(--line);
  background: #071336;
  outline: none;
}

.section-band {
  position: relative;
  max-width: calc(var(--max) + 48px);
  margin: 0 auto;
  padding: 48px 24px;
}

.hero {
  padding-top: 34px;
  padding-bottom: 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 28px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(53, 168, 255, 0.26);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 9px;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
}

.hero-lede,
.section-heading p,
.workflow-card p,
.formula-card p,
.chat-line,
.output-card span {
  color: var(--muted);
  line-height: 1.55;
}

.hero-lede {
  max-width: 660px;
  margin-bottom: 22px;
  font-size: 16px;
}

strong {
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 11px 16px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font-weight: 400;
  font-size: 14px;
}

.button-primary {
  background: linear-gradient(90deg, var(--blue-2), #286cff 55%, var(--violet));
  border-color: #4295ff;
  color: white;
  box-shadow: 0 16px 32px rgba(31, 105, 255, 0.25);
}

.button-secondary {
  background: #071234;
  color: var(--text);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-hot);
  outline: none;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.hero-metrics div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 18, 52, 0.78);
}

.hero-metrics dt {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 400;
}

.hero-metrics dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-visual {
  min-width: 0;
}

.window-frame {
  overflow: hidden;
  border: 1px solid #1e52b6;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #071037, #031a3d);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(53, 168, 255, 0.14) inset;
}

.window-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: #030a1f;
  border-bottom: 1px solid #18346e;
  color: var(--muted);
  font-size: 12px;
}

.window-top span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line);
}

.window-top span:first-child {
  background: var(--danger);
}

.window-top span:nth-child(2) {
  background: var(--amber);
}

.window-top span:nth-child(3) {
  background: var(--green);
}

.window-top strong {
  margin-left: 4px;
  font-weight: 400;
}

.window-frame img {
  aspect-ratio: 1895 / 1032;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}

.real-app-frame {
  width: 100%;
  background: #020719;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.formula-explain-card,
.formula-card,
.chart-card,
.workflow-card,
.ai-panel,
.output-card,
.engineering-visual {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 18, 52, 0.8);
}

.formula-explain-card {
  min-height: 168px;
  padding: 12px;
}

.formula-explain-card img {
  width: 100%;
  min-height: 86px;
  padding: 10px;
  object-fit: contain;
}

.formula-explain-card p {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.workflow-card {
  min-height: 190px;
  padding: 18px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.features-section {
  padding-top: 36px;
  padding-bottom: 36px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 18, 52, 0.8);
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
  margin-bottom: 0;
}

.card-index {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--green);
  font-size: 12px;
  font-weight: 400;
}

.split-layout,
.formula-grid,
.engineering-grid,
.export-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.ai-panel {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(7, 18, 52, 0.96), rgba(3, 10, 31, 0.96)),
    var(--panel);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header small {
  margin-left: auto;
  color: var(--green);
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(108, 255, 132, 0.72);
}

.chat-line {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(41, 69, 141, 0.72);
  border-radius: var(--radius);
  background: #050c27;
}

.chat-line.user {
  color: #fff;
  border-color: #1e52b6;
}

.chat-line.ai span {
  color: var(--cyan);
  font-weight: 400;
}

.inline-formula {
  font-family: "Cambria Math", "Segoe UI Symbol", Georgia, serif;
  white-space: nowrap;
}

.tool-row,
.feature-list,
.engineering-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-row {
  margin-top: 14px;
}

.tool-row span,
.feature-list span,
.engineering-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(7, 18, 52, 0.76);
  font-size: 12px;
  font-weight: 400;
}

.formula-grid {
  align-items: stretch;
}

.chart-card {
  margin: 0;
  padding: 16px;
}

.chart-card img {
  width: 100%;
}

.chart-card figcaption {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
}

.formula-stack {
  display: grid;
  gap: 10px;
}

.formula-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px;
}

.formula-card img {
  min-height: 88px;
  width: 100%;
  object-fit: contain;
}

.formula-card p {
  margin-bottom: 0;
}

.engineering-section {
  padding-top: 36px;
}

.engineering-visual {
  overflow: hidden;
  background: #020719;
}

.engineering-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.visual-caption {
  margin: 0;
  padding: 13px 14px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.engineering-pills {
  margin-top: 14px;
}

.book-section {
  padding-top: 34px;
  padding-bottom: 36px;
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 0.62fr);
  gap: 24px;
  align-items: center;
}

.book-cover {
  max-width: 330px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #020719;
  padding: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.book-cover img {
  width: 100%;
  border-radius: 6px;
}

.output-board {
  display: grid;
  gap: 10px;
}

.output-card {
  padding: 16px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.output-card strong,
.output-card span {
  display: block;
}

.output-card strong {
  margin-bottom: 6px;
}

.output-card.active {
  border-color: var(--line-hot);
  background: linear-gradient(90deg, rgba(29, 131, 255, 0.26), rgba(116, 40, 240, 0.16));
}

.contact-section {
  padding-top: 28px;
  padding-bottom: 42px;
}

.contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(7, 18, 52, 0.94), rgba(3, 10, 31, 0.96));
  padding: 18px;
  font-weight: 400;
}

.contact-panel h2 {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 10px;
}

.contact-panel .eyebrow {
  font-weight: 400;
}

.contact-panel p {
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  padding: 10px 13px;
  border: 1px solid var(--line-hot);
  border-radius: 7px;
  background: #071234;
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  overflow-wrap: anywhere;
  user-select: text;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 90ms;
}

.delay-2 {
  transition-delay: 170ms;
}

.delay-3 {
  transition-delay: 240ms;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero-grid,
  .split-layout,
  .formula-grid,
  .engineering-grid,
  .book-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 18px;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .section-band {
    padding: 34px 16px;
  }

  .hero {
    padding-top: 22px;
  }

  .brand strong {
    font-size: 14px;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links a {
    text-align: center;
  }

  h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .hero-lede {
    font-size: 16px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .hero-metrics,
  .hero-strip,
  .workflow-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .formula-card {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    min-height: auto;
  }

  .book-cover {
    max-width: 260px;
  }
}

@media (max-width: 980px) and (min-width: 681px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
