:root {
  --bg: #070b14;
  --bg-elev: #0d1424;
  --bg-card: #121a2c;
  --bg-card-2: #182234;
  --line: #243049;
  --line-2: #2e3d5c;
  --text: #e8eef8;
  --muted: #8b9bb8;
  --faint: #5c6d8a;
  --cyan: #00c2d8;
  --cyan-dim: #0a7a88;
  --teal: #14b8a6;
  --green: #22c55e;
  --amber: #f59e0b;
  --orange: #fb923c;
  --red: #f43f5e;
  --blue: #3b82f6;
  --siemens: #00a0a6;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.wrap-wide { width: min(1360px, calc(100% - 28px)); margin: 0 auto; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; letter-spacing: -0.03em; font-size: 1.12rem;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #00d4e8, #0d9488);
  display: grid; place-items: center;
  box-shadow: 0 0 22px rgba(0, 194, 216, 0.35);
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,0.04); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer;
  transition: 0.15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #12d4e6, #0891a8);
  color: #042028;
  box-shadow: 0 8px 20px rgba(0, 194, 216, 0.22);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-danger { background: #7f1d1d; color: #fecaca; }

/* HERO */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 56px;
}
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto;
  height: 520px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0, 194, 216, 0.16), transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(20, 184, 166, 0.12), transparent 45%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.08), transparent 50%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center;
  position: relative;
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--cyan); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 14px;
}
.kicker span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  line-height: 1.08; letter-spacing: -0.04em; font-weight: 750;
}
h1 em { font-style: normal; color: var(--cyan); }
.lede { color: var(--muted); font-size: 1.12rem; margin: 18px 0 28px; max-width: 54ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats {
  display: flex; gap: 28px; margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.stat b { display: block; font-size: 1.35rem; letter-spacing: -0.03em; }
.stat span { color: var(--faint); font-size: 0.82rem; }

.hero-card {
  background: linear-gradient(180deg, #152033, #101827);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero-card-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: var(--muted); margin-bottom: 12px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.rung-preview {
  background: #0a101c; border-radius: 10px; padding: 14px 12px;
  font-family: var(--mono); font-size: 12px;
}
.rung {
  display: flex; align-items: center; gap: 0; margin: 10px 0; color: #9fb4d4;
}
.rung .rail { width: 10px; height: 2px; background: #3d5a80; }
.contact {
  border: 2px solid #4ade80; color: #86efac; padding: 4px 8px; min-width: 54px; text-align: center;
  border-radius: 3px; background: rgba(34,197,94,0.08);
}
.contact.nc { position: relative; }
.contact.nc::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px;
  background: #4ade80; transform: rotate(18deg);
}
.coil {
  width: 46px; height: 30px; border: 2px solid var(--cyan); border-radius: 50%;
  display: grid; place-items: center; color: var(--cyan); font-size: 11px;
}
.tag-chip { color: #cbd5e1; font-size: 10px; margin: 0 4px; }

/* SECTIONS */
section { padding: 72px 0; }
.sec-h {
  display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px;
}
h2 { font-size: 1.7rem; letter-spacing: -0.03em; }
.sub { color: var(--muted); max-width: 58ch; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: 0.18s ease;
}
.card:hover { border-color: #35507a; transform: translateY(-2px); }
.icon-box {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(0,194,216,0.1); color: var(--cyan);
}
.icon-box.green { background: rgba(34,197,94,0.1); color: var(--green); }
.icon-box.amber { background: rgba(245,158,11,0.12); color: var(--amber); }
.icon-box.red { background: rgba(244,63,94,0.12); color: var(--red); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.92rem; }

/* COURSES */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 0.84rem; font-weight: 500;
}
.chip:hover, .chip.on { background: rgba(0,194,216,0.12); border-color: var(--cyan); color: var(--cyan); }

.course-card {
  display: flex; flex-direction: column; min-height: 280px;
}
.course-card .meta {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px;
  font-size: 0.75rem; color: var(--faint);
}
.badge {
  padding: 3px 8px; border-radius: 999px; font-weight: 600; letter-spacing: 0.02em;
  background: rgba(255,255,255,0.05); color: var(--muted);
}
.badge.beginner { background: rgba(34,197,94,0.12); color: #86efac; }
.badge.intermediate { background: rgba(245,158,11,0.12); color: #fcd34d; }
.badge.advanced { background: rgba(244,63,94,0.12); color: #fda4af; }
.badge.v21 { background: rgba(0,194,216,0.14); color: #67e8f9; }
.badge.lab { background: rgba(168,85,247,0.14); color: #d8b4fe; }
.course-card .grow { flex: 1; }
.course-card footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; border-top: 1px solid var(--line); margin-top: 8px;
  font-size: 0.85rem; color: var(--muted);
}

/* PATH */
.path {
  background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.path-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.path-step {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  position: relative;
}
.path-step .n {
  font-family: var(--mono); color: var(--cyan); font-size: 0.75rem; font-weight: 700;
}

/* LAB LAYOUT */
.lab-page { padding: 18px 0 40px; }
.lab-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px;
}
.tabs { display: flex; gap: 6px; background: var(--bg-card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px;
  cursor: pointer; font-weight: 600; font-size: 0.88rem;
}
.tab.on { background: #1e2c44; color: var(--text); }

.lab-grid {
  display: grid; grid-template-columns: 220px 1fr 280px; gap: 12px; min-height: 640px;
}
.panel {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
}
.panel-h {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-b { padding: 12px; flex: 1; overflow: auto; }

.palette-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; background: var(--bg-card-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  margin-bottom: 8px; cursor: grab; color: var(--text);
}
.palette-item:hover { border-color: var(--cyan); }
.palette-item .sym {
  width: 36px; height: 28px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--cyan);
  border: 1px solid var(--cyan-dim); border-radius: 4px;
}

.editor {
  background: #0a101c;
  min-height: 560px;
  border-radius: 8px;
  padding: 8px 4px 20px;
}
.rung-row {
  display: grid; grid-template-columns: 42px 1fr 36px;
  align-items: stretch; margin: 6px 0;
}
.rung-num {
  color: var(--faint); font-family: var(--mono); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.rung-body {
  display: flex; align-items: center; gap: 0;
  border-top: 2px solid #2a4060; border-bottom: 2px solid #2a4060;
  min-height: 72px; padding: 8px 4px; background: linear-gradient(180deg, rgba(20,40,70,0.15), transparent);
  overflow-x: auto;
}
.rung-acts { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.icon-btn {
  width: 26px; height: 22px; border: 1px solid var(--line); background: #152033; color: var(--muted);
  border-radius: 5px; cursor: pointer; font-size: 12px;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); }

.el {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 78px; margin: 0 2px; cursor: pointer; position: relative;
}
.el .nm {
  font-family: var(--mono); font-size: 10px; color: #93c5fd; margin-bottom: 4px; max-width: 86px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.el .box {
  border: 2px solid #64748b; padding: 6px 10px; min-width: 52px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: #cbd5e1; background: #0f172a;
}
.el.no .box { border-color: #22c55e; color: #86efac; }
.el.nc .box { border-color: #22c55e; color: #86efac; position: relative; }
.el.nc .box::after {
  content: ""; position: absolute; left: 50%; top: -5px; height: calc(100% + 10px); width: 2px;
  background: #22c55e; transform: translateX(-50%) rotate(16deg);
}
.el.coil .box {
  width: 44px; height: 34px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border-color: var(--cyan); color: var(--cyan);
}
.el.set .box, .el.reset .box {
  width: 44px; height: 34px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border-color: var(--amber); color: var(--amber);
}
.el.ton .box, .el.ctu .box {
  min-width: 92px; border-color: #a78bfa; color: #ddd6fe; text-align: left; padding: 6px 8px;
}
.el.wire {
  width: 18px; height: 2px; background: #2a4060; align-self: center; min-width: 18px; margin-top: 18px;
}
.el.on .box { box-shadow: 0 0 12px rgba(34,197,94,0.45); background: rgba(34,197,94,0.12); }
.el.coil.on .box { box-shadow: 0 0 14px rgba(0,194,216,0.55); background: rgba(0,194,216,0.12); }
.el.selected .box { outline: 2px solid var(--amber); }

.add-rung {
  width: 100%; margin-top: 8px; border: 1px dashed var(--line-2); background: transparent;
  color: var(--muted); padding: 10px; border-radius: 8px; cursor: pointer;
}
.add-rung:hover { border-color: var(--cyan); color: var(--cyan); }

.tag-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center;
  padding: 8px; border-bottom: 1px solid var(--line); font-size: 0.82rem;
}
.tag-row .tn { font-family: var(--mono); color: #93c5fd; }
.toggle {
  width: 42px; height: 22px; border-radius: 999px; border: 0; background: #334155; position: relative; cursor: pointer;
}
.toggle.on { background: #0f766e; }
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #e2e8f0; transition: 0.15s;
}
.toggle.on::after { left: 23px; background: #5eead4; }
.val { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 36px; text-align: right; }

/* F PARAMS */
.f-layout { display: grid; grid-template-columns: 280px 1fr; gap: 12px; min-height: 620px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.form-row input, .form-row select {
  width: 100%; background: #0a101c; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 10px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--cyan); }
.hint { font-size: 0.75rem; color: var(--faint); margin-top: 4px; }
.warn {
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.35);
  color: #fcd34d; padding: 10px 12px; border-radius: 10px; font-size: 0.82rem; margin: 10px 0;
}
.ok {
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  color: #86efac; padding: 10px 12px; border-radius: 10px; font-size: 0.82rem; margin: 10px 0;
}
.err {
  background: rgba(244,63,94,0.1); border: 1px solid rgba(244,63,94,0.35);
  color: #fda4af; padding: 10px 12px; border-radius: 10px; font-size: 0.82rem; margin: 10px 0;
}
.mod-card {
  background: #0a101c; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.mod-card h4 { font-size: 0.92rem; margin-bottom: 8px; display: flex; justify-content: space-between; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sig {
  font-family: var(--mono); font-size: 12px; background: #070b14; padding: 10px; border-radius: 8px;
  color: #67e8f9; border: 1px dashed var(--line-2); margin-top: 8px;
}

/* COURSE PLAYER */
.player { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 70vh; }
.lesson-list { list-style: none; }
.lesson-list li a, .lesson-list li button {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 10px;
  border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer;
}
.lesson-list li a:hover, .lesson-list li button:hover, .lesson-list li .on {
  background: #1e2c44; color: var(--text);
}
.lesson-n { font-family: var(--mono); font-size: 11px; color: var(--cyan); width: 28px; }
.article { background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; }
.article h2 { margin: 8px 0 14px; }
.article p { color: #c5d0e3; margin-bottom: 12px; }
.article ul { margin: 0 0 14px 18px; color: #c5d0e3; }
.article li { margin: 4px 0; }
.callout {
  border-left: 3px solid var(--cyan); background: rgba(0,194,216,0.06);
  padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 16px 0; color: #c5d0e3; font-size: 0.92rem;
}
.callout.safety { border-color: var(--red); background: rgba(244,63,94,0.07); }

/* FOOTER */
footer.site {
  border-top: 1px solid var(--line); padding: 36px 0 28px; color: var(--faint); font-size: 0.85rem;
}
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .hero-grid, .lab-grid, .f-layout, .player, .grid-3, .grid-4, .path-steps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .stats { flex-wrap: wrap; }
}

.nav-right { display: flex; align-items: center; gap: 8px; }
.plan-pill {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.plan-pill.pro { color: #67e8f9; border-color: var(--cyan-dim); background: rgba(0,194,216,0.1); }
.plan-pill.trial { color: #fcd34d; border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.1); }
.plan-pill.team { color: #d8b4fe; border-color: rgba(168,85,247,0.4); background: rgba(168,85,247,0.1); }

.auth-card { max-width: 440px; margin: 48px auto; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.price-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column;
}
.price-card.featured {
  border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(0,194,216,0.25), var(--shadow);
  transform: translateY(-6px);
}
.price-card .amt { font-size: 2.4rem; letter-spacing: -0.04em; font-weight: 800; }
.price-card .amt span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.price-card ul { list-style: none; margin: 16px 0 22px; color: var(--muted); font-size: 0.92rem; }
.price-card li { padding: 6px 0 6px 22px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.price-card li.off { color: var(--faint); }
.price-card li.off::before { content: "–"; color: var(--faint); }
.gate {
  position: relative;
}
.gate-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(7,11,20,0.92) 35%);
  display: flex; align-items: flex-end; justify-content: center; padding: 28px; z-index: 5;
}
.gate-box {
  background: var(--bg-card); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px;
  max-width: 480px; text-align: center;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--faint); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.banner {
  background: rgba(0,194,216,0.08); border: 1px solid rgba(0,194,216,0.25);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; color: #c5d0e3; font-size: 0.9rem;
}
@media (max-width: 980px) {
  .price-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
}
