:root {
  color-scheme: light;
  --ink: #10222a;
  --muted: #52646a;
  --paper: #eef5f3;
  --surface: #ffffff;
  --line: #cbdad7;
  --blue: #2566a8;
  --teal: #0d7f74;
  --yellow: #f0bd45;
  --coral: #d85d4d;
  --violet: #6657a8;
  --shadow: 0 18px 42px rgba(16, 34, 42, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 189, 69, .20), transparent 28%),
    linear-gradient(135deg, #eef5f3 0%, #f8fbfd 48%, #f5f1e8 100%);
}
a { color: inherit; }
button, input, select { font: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(238, 245, 243, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 850;
  text-decoration: none;
}
.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-size: .82rem;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a, .lang button, .small {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  text-decoration: none;
  cursor: pointer;
}
.lang {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.lang button {
  border: 0;
  border-radius: 0;
  min-width: 42px;
  background: transparent;
}
.lang button.active { background: var(--ink); color: white; }
.hero {
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 560px);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  padding: clamp(28px, 6vw, 68px) clamp(16px, 4vw, 40px) 28px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.5rem, 7vw, 6.4rem);
  line-height: .9;
  letter-spacing: 0;
}
.hero p {
  max-width: 740px;
  margin: 18px 0 0;
  color: #34484d;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.58;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 850;
  color: var(--teal);
}
.hero-actions, .button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.primary, .secondary {
  border-radius: 7px;
  min-height: 44px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.primary { background: var(--teal); color: white; }
.secondary { background: #fff7df; color: #322411; border-color: #deb95e; }
.hero-board {
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
canvas { display: block; width: 100%; }
#previewCanvas { height: 340px; }
.app {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 40px) 36px;
}
.panel, .stage, .brief-card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 34, 42, .08);
}
.panel { padding: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
h2, h3 { letter-spacing: 0; }
.panel h2, .telemetry h3 {
  margin: 0;
  font-size: 1.05rem;
}
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  font-weight: 750;
}
select, input[type="range"] { width: 100%; }
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfefd;
  padding: 8px 10px;
}
input[type="range"] { accent-color: var(--teal); }
.slider div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.slider b { color: var(--muted); }
.scorebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  border-bottom: 1px solid var(--line);
}
.scorebar div {
  min-height: 64px;
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.scorebar div:last-child { border-right: 0; }
.scorebar span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}
.scorebar strong { font-size: 1.28rem; }
#flightCanvas {
  height: min(58vh, 560px);
  min-height: 360px;
  background: #fafdff;
}
.telemetry {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(240px, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px;
}
.telemetry p { margin: 8px 0 0; color: var(--muted); line-height: 1.48; }
#eventLog {
  margin: 0;
  padding-left: 20px;
  color: #273a40;
  line-height: 1.48;
}
.brief {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 18px;
  padding: 8px clamp(16px, 4vw, 40px) 42px;
}
.brief h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 3rem); }
.brief p { color: var(--muted); line-height: 1.6; }
.brief-card { padding: 16px; }
pre {
  min-height: 220px;
  margin: 0;
  padding: 14px;
  border-radius: 7px;
  border: 1px dashed #b7c6c3;
  background: #fbfefd;
  white-space: pre-wrap;
  color: #24383f;
  line-height: 1.45;
}
footer {
  padding: 18px clamp(16px, 4vw, 40px) 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
@media (max-width: 920px) {
  .hero, .app, .brief { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  #flightCanvas { height: 420px; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .scorebar { grid-template-columns: repeat(2, 1fr); }
  .scorebar div:nth-child(2) { border-right: 0; }
  .telemetry { grid-template-columns: 1fr; }
}
