:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --fg: #1b1f24;
  --muted: #59636e;
  --border: #d8dee4;
  --accent: #0078d4;
  --accent-fg: #ffffff;
  --accent-soft: #e5f1fb;
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.12);
  --st-new: #8a8886;
  --st-active: #0078d4;
  --st-stopped: #c47f00;
  --st-closed: #107c10;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-alt: #161b21;
    --fg: #e6edf3;
    --muted: #9aa6b2;
    --border: #2d343c;
    --accent: #4aa3ec;
    --accent-fg: #0b1220;
    --accent-soft: #10263a;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    --st-new: #a19f9d;
    --st-active: #4aa3ec;
    --st-stopped: #e3a33b;
    --st-closed: #54b054;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.top nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--fg); }
.top nav .lang { border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; color: var(--fg); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
}
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.secondary { color: var(--accent); background: transparent; }
.btn:hover { filter: brightness(1.08); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-bottom: 16px; }
.note { font-size: 14px; color: var(--muted); margin-top: 12px; }

.shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--bg);
}

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
section h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; letter-spacing: -0.01em; }
section .sub { color: var(--muted); margin: 0 0 40px; max-width: 720px; }

/* Features */
.feature { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; margin-bottom: 64px; }
.feature:last-child { margin-bottom: 0; }
.feature.flip { grid-template-columns: 1.2fr 1fr; }
.feature.flip .text { order: 2; }
.feature h3 { font-size: 22px; margin: 0 0 10px; }
.feature p { color: var(--muted); margin: 0 0 10px; }
.feature ul { margin: 0; padding-left: 20px; color: var(--muted); }
.feature .media { display: flex; justify-content: center; }
.feature .media.small .shot { max-width: 360px; }

/* States diagram */
.diagram { overflow-x: auto; margin: 0 0 32px; }
.diagram svg { min-width: 560px; width: 100%; max-width: 820px; height: auto; display: block; margin: 0 auto; }
.diagram .node rect { fill: var(--bg); stroke-width: 2; }
.diagram .node text { font: 600 16px "Segoe UI", system-ui, sans-serif; fill: var(--fg); text-anchor: middle; dominant-baseline: middle; }
.diagram .new rect { stroke: var(--st-new); }
.diagram .active rect { stroke: var(--st-active); }
.diagram .stopped rect { stroke: var(--st-stopped); }
.diagram .closed rect { stroke: var(--st-closed); }
.diagram .edge { stroke: var(--muted); stroke-width: 1.6; fill: none; marker-end: url(#arrow); }
.diagram .label { font: 14px "Segoe UI", system-ui, sans-serif; fill: var(--muted); text-anchor: middle; }
.diagram marker path { fill: var(--muted); }

.states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.state { border: 1px solid var(--border); border-left: 4px solid; border-radius: 8px; padding: 14px 16px; background: var(--bg); }
.state b { display: block; margin-bottom: 4px; }
.state span { color: var(--muted); font-size: 15px; }
.state.active { border-left-color: var(--st-active); }
.state.stopped { border-left-color: var(--st-stopped); }
.state.closed { border-left-color: var(--st-closed); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.steps li { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg); counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; margin-bottom: 10px; }
.steps b { display: block; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* Footer */
footer { padding: 32px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 960px) {
  .hero .wrap, .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .text { order: 0; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .top nav a:not(.lang) { display: none; }
  .hero { padding: 40px 0 32px; }
  section { padding: 48px 0; }
  .states, .steps { grid-template-columns: 1fr; }
}
