:root {
  --bg: #0b0d10;
  --bg-soft: #10141a;
  --panel: #141922;
  --panel-2: #191f29;
  --panel-3: #0f1319;
  --line: #28313d;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f2eadf;
  --muted: #9ea4ad;
  --muted-2: #6f7782;
  --orange: #e96f21;
  --orange-2: #ff9b42;
  --green: #4fd18b;
  --blue: #5fa8ff;
  --yellow: #efbd4d;
  --danger: #ee645d;
  --radius: 18px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(180deg, #0b0d10 0%, #10141a 54%, #0b0d10 100%);
  background-size: 64px 64px, 64px 64px, auto;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, rgba(233,111,33,0.12), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(95,168,255,0.09), transparent 30rem);
  z-index: -1;
}

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

button {
  font: inherit;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr) minmax(210px, 0.7fr);
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 0 max(18px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #70451e;
  background: linear-gradient(180deg, #24170e, #15100c);
}

.brand-box::before,
.brand-box::after,
.brand-box span {
  content: "";
  position: absolute;
  display: block;
  background: rgba(233,111,33,0.18);
  border: 1px solid var(--orange);
}

.brand-box::before {
  width: 19px;
  height: 13px;
  left: 8px;
  bottom: 8px;
}

.brand-box::after {
  width: 14px;
  height: 18px;
  right: 8px;
  top: 8px;
}

.brand-box span:nth-child(1) {
  width: 26px;
  height: 25px;
  background: transparent;
  border-color: rgba(255,155,66,0.45);
}

.brand-box span:nth-child(2),
.brand-box span:nth-child(3) {
  display: none;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  line-height: 1;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.main-nav a {
  padding: 10px 13px;
  color: #c5c9d0;
  font-size: 0.9rem;
  font-weight: 650;
  border: 1px solid transparent;
}

.main-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,0.04);
}

.header-status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: #cdd3dc;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: #10151c;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(79,209,139,0.13);
}

.section-code {
  margin: 0 0 12px;
  color: var(--orange-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

h2 {
  max-width: 860px;
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4.5vw, 4.5rem);
  line-height: 0.97;
  letter-spacing: -0.06em;
}

h3 {
  margin-bottom: 10px;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 660px;
  color: #c5c9d0;
  font-size: clamp(1.03rem, 1.4vw, 1.2rem);
  line-height: 1.72;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(540px, 1.1fr);
  gap: 54px;
  align-items: center;
  min-height: calc(100vh - 74px);
  padding-top: 74px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.btn.primary {
  color: #140a03;
  border-color: #f59a45;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
}

.btn.secondary {
  color: #d9dde3;
  background: #121821;
}

.btn:hover {
  filter: brightness(1.08);
}

.spec-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 660px;
}

.spec-row span {
  padding: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(20,25,34,0.74);
  font-size: 0.88rem;
}

.spec-row b {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.packing-console,
.solver-screen,
.mode-panel,
.batch-panel,
.chart-panel,
.analysis-copy,
.module-card,
.system-grid article {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(25,31,41,0.96), rgba(15,19,25,0.96));
  box-shadow: 0 26px 80px rgba(0,0,0,0.28);
}

.packing-console {
  overflow: hidden;
}

.console-top,
.screen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #10151c;
}

.console-top strong,
.console-top span,
.screen-top span,
.screen-top b {
  display: block;
}

.console-top strong {
  font-size: 0.98rem;
}

.console-top span,
.screen-top span {
  color: var(--muted);
  font-size: 0.78rem;
}

.screen-top b {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.console-lights {
  display: flex;
  gap: 7px;
}

.console-lights i {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: var(--line);
}

.console-lights i:nth-child(1) { background: var(--green); }
.console-lights i:nth-child(2) { background: var(--yellow); }
.console-lights i:nth-child(3) { background: var(--orange); }

.console-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  min-height: 500px;
}

.canvas-wrap {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    #0d1117;
  background-size: 36px 36px;
}

#packingCanvas,
#solverCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: 58%;
  background: linear-gradient(180deg, transparent, rgba(79,209,139,0.85), transparent);
  box-shadow: 0 0 28px rgba(79,209,139,0.55);
  animation: scanX 4.2s ease-in-out infinite;
}

.telemetry {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #10151c;
}

.telemetry-card {
  padding: 13px;
  border: 1px solid var(--line);
  background: #151b24;
}

.telemetry-card span,
.telemetry-card strong {
  display: block;
}

.telemetry-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.telemetry-card strong {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.12rem;
}

.queue {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 8px;
}

.queue-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
}

.queue i {
  height: 36px;
  border: 1px solid rgba(233,111,33,0.45);
  background: rgba(233,111,33,0.15);
  animation: queuePulse 2.6s ease-in-out infinite;
  animation-delay: var(--delay);
}

.section-head {
  margin-bottom: 32px;
}

.section-head.compact {
  margin-bottom: 20px;
}

.belt-section {
  padding-top: 34px;
}

.belt-demo {
  border: 1px solid var(--line);
  background: #111720;
}

.belt-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.belt-labels span {
  padding: 15px 16px;
  color: #d5dae0;
  font-size: 0.86rem;
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.belt-labels span:last-child {
  border-right: 0;
}

.belt-track {
  position: relative;
  height: 160px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.035), transparent),
    #0f141b;
}

.belt-lines {
  position: absolute;
  inset: auto 0 36px;
  height: 48px;
  border-top: 2px solid #323b49;
  border-bottom: 2px solid #323b49;
  background: repeating-linear-gradient(90deg, #202834 0 18px, #151b24 18px 36px);
  animation: beltMove 0.9s linear infinite;
}

.parcel {
  position: absolute;
  bottom: 54px;
  width: 54px;
  height: 34px;
  border: 1px solid #a35d28;
  background: linear-gradient(180deg, #c67835, #8d4a1f);
  animation: parcelMove 6.5s linear infinite;
}

.parcel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(30,14,3,0.35);
}

.p1 { left: -80px; animation-delay: 0s; }
.p2 { left: -80px; animation-delay: 1.8s; width: 42px; height: 42px; }
.p3 { left: -80px; animation-delay: 3.6s; width: 68px; }

.scanner {
  position: absolute;
  left: 49%;
  top: 24px;
  width: 66px;
  height: 104px;
  border: 2px solid #3c4654;
  border-bottom: 0;
}

.scanner::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: -20px;
  width: 2px;
  translate: -50% 0;
  background: rgba(79,209,139,0.85);
  box-shadow: 0 0 28px rgba(79,209,139,0.55);
}

.sorter {
  position: absolute;
  right: 18%;
  bottom: 50px;
  width: 120px;
  height: 8px;
  background: var(--orange);
  transform: rotate(-16deg);
  transform-origin: right center;
  animation: sorterTilt 3.2s ease-in-out infinite;
}

.module-grid,
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.module-card,
.system-grid article {
  min-height: 230px;
  padding: 22px;
}

.module-card {
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}

.module-card:hover::before {
  transform: scaleX(1);
}

.module-index {
  display: block;
  margin-bottom: 46px;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
}

.module-card p,
.system-grid p,
.analysis-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.solver-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1fr);
  gap: 16px;
}

.mode-panel {
  padding: 22px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 30px;
}

.mode-button {
  min-height: 42px;
  color: #cbd0d7;
  border: 1px solid var(--line);
  background: #10151c;
  cursor: pointer;
  font-weight: 800;
}

.mode-button.active {
  color: #130902;
  border-color: #ef9b4e;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
}

.mode-panel h3 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.mode-panel p {
  color: #c6cad0;
  line-height: 1.68;
}

.mode-bars {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.mode-bars div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.mode-bars b {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mode-bars i {
  display: block;
  height: 10px;
  border: 1px solid var(--line);
  background: #0d1117;
}

.mode-bars em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  transition: width 260ms ease;
}

.solver-screen {
  overflow: hidden;
  min-height: 480px;
}

#solverCanvas {
  height: 420px;
  background: #0d1117;
}

.batch-panel {
  padding: 28px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.batch-stat {
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #10151c;
}

.batch-stat span,
.batch-stat strong {
  display: block;
}

.batch-stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.batch-stat strong {
  margin-top: 24px;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  letter-spacing: -0.05em;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 16px;
}

.chart-panel,
.analysis-copy {
  padding: 24px;
}

.chart-title {
  color: #d8dde4;
  font-weight: 850;
}

.histogram {
  display: flex;
  align-items: end;
  gap: 18px;
  height: 340px;
  margin-top: 34px;
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 100% 58px;
}

.histogram span {
  flex: 1;
  min-width: 18px;
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  animation: barRead 3.6s ease-in-out infinite;
}

.histogram span:nth-child(2n) {
  animation-delay: -0.9s;
}

.histogram span:nth-child(3n) {
  animation-delay: -1.8s;
}

.analysis-copy h3 {
  font-size: clamp(1.5rem, 3vw, 2.45rem);
}

.analysis-copy ul {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.analysis-copy li {
  position: relative;
  padding-left: 22px;
  color: #d7dbe1;
}

.analysis-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.63em;
  width: 8px;
  height: 8px;
  background: var(--orange);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: var(--text);
}

.footer-credit {
  margin-top: 8px;
  color: #7f8792;
  font-size: 0.86rem;
}

.site-footer a {
  color: var(--orange-2);
  font-weight: 800;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes scanX {
  0%, 100% { left: 18%; opacity: 0.25; }
  50% { left: 76%; opacity: 1; }
}

@keyframes queuePulse {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes beltMove {
  to { background-position-x: 36px; }
}

@keyframes parcelMove {
  0% { transform: translateX(0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateX(calc(100vw + 240px)); opacity: 0; }
}

@keyframes sorterTilt {
  0%, 100% { transform: rotate(-16deg); }
  45% { transform: rotate(11deg); }
}

@keyframes barRead {
  0%, 100% { filter: brightness(0.86); }
  50% { filter: brightness(1.22); }
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .hero,
  .solver-layout,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1220px);
    padding: 68px 0;
  }

  .site-header {
    min-height: 64px;
    padding-inline: 12px;
  }

  .header-status {
    display: none;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .spec-row,
  .module-grid,
  .system-grid,
  .batch-grid {
    grid-template-columns: 1fr;
  }

  .console-body {
    grid-template-columns: 1fr;
  }

  .telemetry {
    grid-template-columns: repeat(3, 1fr);
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .queue {
    display: none;
  }

  .canvas-wrap {
    min-height: 390px;
  }

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

  .site-footer {
    flex-direction: column;
  }
}
