:root {
  color-scheme: light;
  --ink: #17223d;
  --muted: #69758e;
  --blue: #335cff;
  --purple: #8b5cf6;
  --mint: #55d8bb;
  --orange: #ff9f43;
  --pink: #ff6f91;
  --line: rgba(24, 35, 61, 0.12);
  --surface: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(49, 66, 122, 0.13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, color-mix(in srgb, var(--accent, var(--blue)) 13%, transparent), transparent 25rem),
    radial-gradient(circle at 92% 42%, rgba(139, 92, 246, .1), transparent 29rem),
    #f6f8fc;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.fq-header, .module-main, .fq-footer { width: min(1220px, calc(100% - 48px)); margin-inline: auto; }
.fq-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 78px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-size: 17px; font-weight: 780; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; }
.brand-mark::after { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 14px rgba(51,92,255,.7); content: ""; }
.brand-mark span { position: absolute; width: 28px; height: 10px; border: 1px solid rgba(51,92,255,.7); border-radius: 50%; }
.brand-mark span:nth-child(2) { transform: rotate(60deg); }.brand-mark span:nth-child(3) { transform: rotate(-60deg); }
.back-link { color: #56627a; font-size: 12px; font-weight: 750; }
.back-link span { margin-right: 7px; color: var(--blue); }
.header-tools { display: flex; justify-self: end; align-items: center; gap: 10px; }
.lesson-chip { padding: 8px 11px; border: 1px solid rgba(51,92,255,.16); border-radius: 999px; color: var(--blue); background: rgba(255,255,255,.6); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.75); }
.language-switch button { min-width: 37px; padding: 5px 8px; border: 0; border-radius: 999px; color: #7a8499; background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; }
.language-switch button.active { color: #fff; background: var(--blue); }

.module-intro { display: grid; grid-template-columns: 1fr minmax(320px, 470px); align-items: end; gap: 50px; padding: 64px 0 42px; }
.eyebrow, .panel-kicker { display: block; margin: 0 0 10px; color: var(--accent, var(--blue)); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(3.2rem, 6.7vw, 6.2rem); font-weight: 720; letter-spacing: -.072em; line-height: .95; }
h1 em { display: block; color: var(--accent, var(--blue)); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.intro-copy > p { margin-bottom: 22px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.learning-path { display: flex; align-items: center; gap: 9px; }
.learning-path span { display: flex; align-items: center; gap: 7px; color: #536078; font-size: 10px; font-weight: 750; }
.learning-path em { font-style: normal; }
.learning-path b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--accent, var(--blue)); font-size: 9px; }
.learning-path i { width: 22px; height: 1px; background: color-mix(in srgb, var(--accent, var(--blue)) 30%, transparent); }

.module-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .82fr); gap: 18px; }
.visual-panel, .control-panel, .concept-card, .challenge-card { border: 1px solid rgba(255,255,255,.92); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.visual-panel { overflow: hidden; color: #fff; background: #0d1428; }
.panel-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 0 23px; border-bottom: 1px solid rgba(255,255,255,.09); }
.panel-topbar > div { display: flex; flex-direction: column; gap: 3px; }
.panel-topbar .panel-kicker { margin: 0; color: color-mix(in srgb, var(--accent, #91a6ff) 65%, white); }
.panel-topbar strong { font-size: 15px; }
.scene-button { padding: 8px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #d8dff5; background: rgba(255,255,255,.06); cursor: pointer; font-size: 9px; font-weight: 750; }
.scene-button:hover { background: rgba(255,255,255,.12); }
.canvas-shell { position: relative; height: 500px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #283566, #151e3b 34%, #0b1122 76%); }
.canvas-shell::before { position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px); background-size: 34px 34px; content: ""; pointer-events: none; }
.lab-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.draggable { cursor: grab; }.draggable:active { cursor: grabbing; }
.scene-badge { position: absolute; top: 18px; left: 18px; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; color: #fff; background: rgba(11,17,35,.58); backdrop-filter: blur(13px); font-size: 10px; }
.scene-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent, var(--mint)); box-shadow: 0 0 10px var(--accent, var(--mint)); }
.scene-caption { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 17px 23px 19px; border-top: 1px solid rgba(255,255,255,.08); }
.scene-caption span { color: color-mix(in srgb, var(--accent, #91a6ff) 65%, white); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.scene-caption p { margin: -3px 0 0; color: rgba(226,232,255,.72); font-size: 10px; line-height: 1.55; }

.control-panel { padding: 27px; }
.control-panel h2, .concept-card h2, .challenge-card h2 { margin-bottom: 8px; font-size: 23px; letter-spacing: -.035em; }
.control-panel > p, .concept-card p, .challenge-card p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.control-group { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.control-group:first-of-type { margin-top: 20px; padding-top: 0; border-top: 0; }
.control-title { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 11px; }
.control-title div { display: flex; flex-direction: column; gap: 3px; }
.control-title strong { font-size: 12px; }.control-title span { color: var(--muted); font-size: 9px; }
.value-pill { min-width: 58px; padding: 5px 8px; border-radius: 9px; color: #fff; background: var(--accent, var(--blue)); font-size: 9px; font-weight: 800; text-align: center; }
input[type="range"] { width: 100%; accent-color: var(--accent, var(--blue)); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; margin-top: 3px; color: #9ba4b6; font-size: 8px; }
.segmented { display: grid; grid-template-columns: repeat(var(--segments, 2), 1fr); gap: 6px; }
.segmented button, .choice-grid button { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; color: #68738b; background: #fff; cursor: pointer; font-size: 9px; font-weight: 750; }
.segmented button.active, .choice-grid button.active { color: var(--accent, var(--blue)); border-color: color-mix(in srgb, var(--accent, var(--blue)) 50%, white); background: color-mix(in srgb, var(--accent, var(--blue)) 8%, white); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; width: 44px; height: 25px; border: 0; border-radius: 999px; background: #dfe3ed; cursor: pointer; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(20,30,60,.2); transition: transform 180ms ease; content: ""; }
.switch.active { background: var(--accent, var(--blue)); }.switch.active::after { transform: translateX(19px); }
.action-row { display: flex; gap: 8px; margin-top: 24px; }
.action-row button { flex: 1; min-height: 43px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-size: 9px; font-weight: 850; }
.primary-action { border: 0; color: #fff; background: var(--accent, var(--blue)); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent, var(--blue)) 25%, transparent); }
.primary-action:disabled { cursor: wait; opacity: .55; }
.secondary-action { border: 1px solid var(--line); color: #657087; background: #fff; }
.metric-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 18px; }
.metric { min-height: 67px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8f9fc; }
.metric span { display: block; margin-bottom: 6px; color: #8791a5; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.metric strong { font-size: 16px; letter-spacing: -.02em; }
.status-card { margin-top: 18px; padding: 13px 14px; border-radius: 13px; color: #536078; background: #f3f5fa; font-size: 10px; line-height: 1.55; }
.status-card strong { display: block; margin-bottom: 3px; color: var(--ink); }

.concept-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 18px 0; }
.concept-card { padding: 25px; }
.concept-card .number { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 18px; border-radius: 50%; color: var(--accent,var(--blue)); background: color-mix(in srgb, var(--accent,var(--blue)) 10%, white); font-size: 9px; font-weight: 850; }
.concept-card h3 { margin-bottom: 8px; font-size: 17px; }
.concept-card p { margin: 0; }
.formula { margin-top: 15px; padding: 12px; overflow-x: auto; border-radius: 11px; color: #314075; background: #f0f3ff; font-family: Georgia,serif; font-size: 14px; text-align: center; white-space: nowrap; }
.challenge-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 18px; margin: 18px 0 76px; padding: 25px 28px; }
.challenge-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: linear-gradient(145deg,var(--accent,var(--blue)),var(--purple)); font-size: 19px; }
.challenge-card h2 { margin-bottom: 5px; font-size: 17px; }.challenge-card p { margin-bottom: 0; }
.challenge-card a { color: var(--accent,var(--blue)); font-size: 10px; font-weight: 850; white-space: nowrap; }
.fq-footer { display: flex; justify-content: space-between; align-items: center; min-height: 105px; border-top: 1px solid var(--line); color: #7e879b; font-size: 10px; }
.fq-footer p { margin: 0; }

@media (max-width: 940px) {
  .module-intro { grid-template-columns: 1fr; }
  .module-workspace { grid-template-columns: 1fr; }
  .canvas-shell { height: 480px; }
  .concept-grid { grid-template-columns: 1fr 1fr; }
  .concept-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .fq-header, .module-main, .fq-footer { width: min(100% - 26px,1220px); }
  .fq-header { grid-template-columns: 1fr auto; }
  .back-link { display: none; }
  .lesson-chip { display: none; }
  .module-intro { padding-top: 48px; }
  h1 { font-size: clamp(2.8rem,13vw,4rem); }
  .learning-path { gap: 5px; }.learning-path i { width: 10px; }
  .canvas-shell { height: 410px; }
  .scene-caption { grid-template-columns: 1fr; }
  .control-panel, .concept-card { padding: 22px; }
  .concept-grid { grid-template-columns: 1fr; }
  .concept-card:last-child { grid-column: auto; }
  .challenge-card { grid-template-columns: 44px 1fr; padding: 21px; }
  .challenge-card a { grid-column: 2; }
  .fq-footer { flex-direction: column; justify-content: center; gap: 7px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; }
}
