:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #191c1f;
  --surface-2: #202428;
  --line: #32373c;
  --text: #f4f5f1;
  --muted: #a8afb4;
  --green: #5dd39e;
  --green-dark: #123d2e;
  --orange: #ff8b5b;
  --yellow: #f0cb67;
  --red: #ff6961;
  --shell: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}
button, a { font: inherit; }
button { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 21, .94);
  backdrop-filter: blur(12px);
}
.header-inner { min-height: 66px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; }
.brand-mark { width: 27px; height: 27px; display: flex; align-items: end; gap: 3px; padding: 5px; border: 1px solid #497663; border-radius: 5px; background: var(--green-dark); }
.brand-mark span { width: 4px; border-radius: 1px; background: var(--green); animation: meter 1.8s ease-in-out infinite; }
.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 15px; animation-delay: -.6s; }
.brand-mark span:nth-child(3) { height: 11px; animation-delay: -1.1s; }
@keyframes meter { 0%, 100% { transform: scaleY(.7); } 50% { transform: scaleY(1); } }
.nav { display: flex; gap: 25px; margin-left: 18px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); }
.live-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #d6dbd8; font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(93, 211, 158, .12); }
.live-pill.paused .live-dot { background: var(--yellow); box-shadow: 0 0 0 4px rgba(240, 203, 103, .12); }

.monitor-section { padding: 54px 0 62px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 32px; }
.eyebrow, .panel-kicker { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { max-width: 760px; margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.06; font-weight: 780; }
.intro { max-width: 690px; margin: 17px 0 0; color: var(--muted); font-size: 17px; }
.actions { display: flex; gap: 9px; flex: 0 0 auto; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.button-primary { color: #0e1a15; border-color: var(--green); background: var(--green); font-weight: 700; }
.button-secondary { color: var(--text); background: var(--surface); }
.button:hover { filter: brightness(1.07); }

.target-row { display: flex; align-items: center; gap: 15px; min-height: 56px; padding: 8px 12px 8px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.target-label { color: var(--muted); font-size: 13px; }
.segmented { display: inline-grid; grid-template-columns: repeat(4, minmax(48px, 1fr)); padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #121416; }
.segmented button { min-height: 31px; padding: 0 12px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; cursor: pointer; }
.segmented button.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px #3d444a; }
.test-time { margin-left: auto; color: var(--muted); font-size: 13px; }
.test-time strong { color: var(--text); font-variant-numeric: tabular-nums; }

.metrics { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.metric { min-width: 0; min-height: 148px; padding: 19px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.metric-main { border-color: #3b6755; background: #17231e; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin-top: 9px; }
.metric-value span { font-size: 42px; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.metric-main .metric-value span { color: var(--green); }
.metric-value small { color: var(--muted); font-size: 12px; }
.metric-note { margin-top: 14px; color: var(--muted); font-size: 12px; white-space: normal; }
.metric-note.good { color: var(--green); }
.metric-note.warning { color: var(--yellow); }
.metric-note.bad { color: var(--red); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 10px; margin-top: 10px; }
.chart-panel, .scene-panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.chart-panel { padding: 21px 21px 15px; }
.scene-panel { padding: 21px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.panel-kicker { color: var(--muted); font-size: 11px; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.legend-live, .legend-target { width: 18px; height: 2px; display: inline-block; background: var(--green); }
.legend-target { margin-left: 7px; background: var(--orange); }
.chart-wrap { position: relative; width: 100%; height: 290px; margin-top: 16px; }
#fpsChart { display: block; width: 100%; height: 260px; }
.chart-axis { display: flex; justify-content: space-between; color: #737b80; font-size: 10px; }

.scene { position: relative; height: 185px; margin-top: 17px; overflow: hidden; border: 1px solid #394047; border-radius: 5px; background-color: #101315; background-image: linear-gradient(#20262a 1px, transparent 1px), linear-gradient(90deg, #20262a 1px, transparent 1px); background-size: 24px 24px; }
.scene-dot { position: absolute; width: 12px; height: 12px; border-radius: 2px; background: var(--green); will-change: transform; }
.scene-dot:nth-child(3n) { background: var(--orange); }
.scene-dot:nth-child(4n) { border-radius: 50%; background: var(--yellow); }
.load-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.compact-control { grid-template-columns: repeat(2, minmax(70px, 1fr)); }
.compact-control button { padding-inline: 9px; font-size: 11px; }
.scene-copy { margin: 15px 0 0; color: var(--muted); font-size: 12px; }

.method-section { padding: 64px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #15181a; }
.method-grid, .questions-grid { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr); gap: 80px; }
.method-grid h2, .questions-grid h2 { margin: 0; font-size: 30px; line-height: 1.15; }
.method-list { display: grid; }
.method-list article { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.method-list article:first-child { padding-top: 0; border-top: 0; }
.method-list article > span { color: var(--orange); font-size: 12px; font-variant-numeric: tabular-nums; }
.method-list h3 { margin: 0 0 6px; font-size: 16px; }
.method-list p { margin: 0; color: var(--muted); font-size: 14px; }

.questions-section { padding: 64px 0 72px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; padding: 20px 36px 20px 0; cursor: pointer; list-style: none; font-weight: 650; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; top: 18px; right: 4px; color: var(--green); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "-"; }
.faq p { max-width: 680px; margin: -5px 0 20px; color: var(--muted); font-size: 14px; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.footer-inner span:first-child { color: var(--text); font-weight: 700; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .scene-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .scene-panel .panel-heading, .scene-panel .scene-copy { grid-column: 1 / -1; }
  .scene { margin-top: 17px; }
  .load-control { align-self: center; flex-direction: column; align-items: stretch; }
  .method-grid, .questions-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 680px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .header-inner { min-height: 58px; gap: 14px; }
  .nav { display: none; }
  .live-pill { font-size: 0; }
  .monitor-section { padding: 34px 0 48px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 22px; }
  h1 { font-size: 36px; }
  .intro { font-size: 15px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .target-row { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .target-label { width: 100%; }
  .segmented { width: 100%; }
  .test-time { width: 100%; margin: 2px 0 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 128px; padding: 15px; }
  .metric-value { align-items: end; flex-direction: column; gap: 2px; }
  .metric-value span { align-self: start; font-size: 34px; }
  .metric-value small { align-self: start; }
  .chart-panel, .scene-panel { padding: 16px; }
  .chart-wrap { height: 250px; }
  #fpsChart { height: 220px; }
  .legend { display: none; }
  .scene-panel { display: block; }
  .load-control { flex-direction: row; align-items: center; }
  .compact-control { width: auto; }
  .method-section, .questions-section { padding: 48px 0; }
  .method-grid h2, .questions-grid h2 { font-size: 26px; }
  .footer-inner { align-items: start; flex-direction: column; justify-content: center; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-mark span { animation: none; }
}
