:root {
  --bg: #f4efe6;
  --bg-deep: #e7dccb;
  --paper: rgba(255, 252, 246, 0.9);
  --ink: #1f2430;
  --muted: #635b52;
  --gold: #d89a2b;
  --gold-deep: #a86b12;
  --teal: #1f7a78;
  --teal-deep: #125351;
  --red: #ad4d3d;
  --navy: #21304c;
  --line: rgba(44, 33, 19, 0.12);
  --good: #277154;
  --bad: #a13e34;
  --shadow: 0 18px 40px rgba(61, 47, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 154, 43, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 122, 120, 0.2), transparent 30%),
    linear-gradient(180deg, #f9f5ee 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 88%);
  opacity: 0.3;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.panel,
.download-panel {
  backdrop-filter: blur(10px);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  border-radius: 32px;
}

.hero-copy {
  width: 100%;
}

.eyebrow,
.step,
.mini-kicker,
.visual-label,
.hero-label,
.bank-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.intro {
  max-width: none;
  width: 100%;
  margin-bottom: 22px;
  line-height: 1.65;
  color: #443b33;
}

.translator-visual {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  grid-template-areas: "flow output";
  gap: 22px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(216, 154, 43, 0.12), transparent 40%),
    linear-gradient(225deg, rgba(31, 122, 120, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.55);
}

.visual-selector,
.visual-output {
  border: 1px solid rgba(33, 48, 76, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  padding: 16px;
}

.visual-selector {
  grid-area: flow;
  display: grid;
  gap: 10px;
  align-content: start;
}

.visual-output {
  grid-area: output;
}

.visual-output .visual-label {
  margin-bottom: 10px;
}

.code-stack,
.mode-diagram {
  display: grid;
  gap: 12px;
}

.code-stack span,
.diagram-pill {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.diagram-pill {
  position: relative;
  overflow: hidden;
}

.diagram-pill::after {
  content: "";
  position: absolute;
  inset: auto 14px -10px 14px;
  height: 20px;
  border-radius: 999px;
  background: rgba(33, 48, 76, 0.08);
  filter: blur(12px);
}

.visual-flow {
  display: grid;
  gap: 10px;
}

.flow-chip,
.button,
.scenario-option,
.statement-chip,
.download-btn {
  font: inherit;
}

.flow-chip {
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(33, 48, 76, 0.08);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.flow-chip:hover,
.button:hover,
.scenario-option:hover,
.statement-chip:hover,
.download-btn:hover {
  transform: translateY(-1px);
}

.flow-chip.is-active {
  background: var(--navy);
  color: #fff9f1;
}

.mode-summary,
.panel-copy,
.sort-copy,
.feedback-line,
.scenario-response,
.download-status,
.definition-hint,
.hero-feedback {
  line-height: 1.55;
  color: #4e453c;
}

.panel,
.download-panel {
  margin-top: 22px;
  padding: 24px;
  border-radius: 28px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.panel-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.download-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button.primary,
.download-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff8ec;
}

.button.ghost {
  background: rgba(33, 48, 76, 0.08);
  color: var(--ink);
}

.definition-grid,
.revision-grid,
.diagram-grid {
  display: grid;
  gap: 18px;
}

.definition-grid,
.diagram-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.definition-card,
.sort-card,
.revision-card,
.diagram-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.definition-card,
.revision-card,
.diagram-card {
  padding: 18px;
}

.diagram-card {
  display: grid;
  grid-template-rows: minmax(4.8rem, auto) 214px 3.8rem 152px auto;
  gap: 12px;
  align-items: start;
}

.diagram-card .definition-head {
  min-height: 4.8rem;
}

.definition-head,
.scenario-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(33, 48, 76, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.secure {
  background: rgba(39, 113, 84, 0.14);
  color: var(--good);
}

textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(44, 33, 19, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  resize: vertical;
}

textarea:focus-visible,
.scenario-option:focus-visible,
.statement-chip:focus-visible,
.flow-chip:focus-visible,
.button:focus-visible,
.download-btn:focus-visible {
  outline: 3px solid rgba(31, 122, 120, 0.28);
  outline-offset: 2px;
}

.model-answer {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(216, 154, 43, 0.18), rgba(31, 122, 120, 0.12)),
    rgba(255, 252, 246, 0.96);
  border: 2px solid rgba(168, 107, 18, 0.28);
  box-shadow: 0 12px 24px rgba(77, 56, 20, 0.08);
  color: #2a302f;
  line-height: 1.55;
}

.model-answer strong {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--gold-deep);
}

.diagram-surface {
  margin: 0;
  padding: 16px;
  min-height: 214px;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(33, 48, 76, 0.1);
  background:
    linear-gradient(135deg, rgba(33, 48, 76, 0.04), rgba(216, 154, 43, 0.06)),
    rgba(255, 255, 255, 0.92);
}

.diagram-card .definition-hint {
  display: block;
  margin: 0;
  min-height: 3.8rem;
}

.diagram-card .definition-box {
  margin-top: 0;
  min-height: 152px;
  height: 152px;
}

.mini-table,
.mini-flow,
.binary-wall {
  display: grid;
  gap: 10px;
  height: 100%;
}

.mini-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-table-card,
.mini-flow-line,
.binary-strip {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(33, 48, 76, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.mini-flow-line,
.binary-strip {
  min-width: 0;
}

.mini-table-card strong,
.mini-flow-line strong {
  display: block;
  margin-bottom: 6px;
}

.mini-code {
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.statement-box .mini-code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.binary-strip {
  font-family: "Courier New", monospace;
  color: #294b49;
}

.binary-output {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.mini-flow {
  align-items: center;
  padding-block: 14px;
}

.binary-wall {
  padding-block: 14px;
}

.flow-arrow {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.concept-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.canvas-panel {
  display: grid;
  gap: 12px;
}

.canvas-key {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(33, 48, 76, 0.12);
  font-size: 0.88rem;
  font-weight: 700;
}

.key-chip-as {
  background: rgba(52, 91, 173, 0.12);
  border-color: rgba(52, 91, 173, 0.24);
  color: #243f7a;
}

.key-chip-alevel {
  background: rgba(216, 154, 43, 0.16);
  border-color: rgba(168, 107, 18, 0.24);
  color: #6f4610;
}

.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(33, 48, 76, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.canvas-help {
  margin: 0;
  color: #574e45;
  line-height: 1.5;
}

.diagram-canvas {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(33, 48, 76, 0.12);
  background:
    linear-gradient(180deg, rgba(243, 222, 206, 0.9) 0%, rgba(243, 222, 206, 0.9) 41%, rgba(251, 239, 191, 0.95) 41%, rgba(251, 239, 191, 0.95) 100%);
}

.canvas-band-title {
  position: absolute;
  left: 18px;
  z-index: 2;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(33, 48, 76, 0.14);
  background: rgba(255, 252, 246, 0.9);
  color: #233c73;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 10px 20px rgba(40, 32, 18, 0.08);
}

.canvas-band-title-top {
  top: 16px;
}

.canvas-band-title-bottom {
  top: calc(41% + 16px);
}

.diagram-canvas.is-drop-target {
  outline: 3px dashed rgba(31, 122, 120, 0.35);
  outline-offset: 6px;
}

.canvas-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.canvas-link {
  stroke: #bf1d1d;
  stroke-width: 4;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
}

.canvas-link.is-selected {
  stroke: #951515;
  stroke-width: 5;
}

.canvas-link-delete {
  cursor: pointer;
  pointer-events: all;
}

.canvas-link-delete circle {
  fill: rgba(255, 248, 240, 0.96);
  stroke: #bf1d1d;
  stroke-width: 2;
}

.canvas-link-delete text {
  fill: #9a2020;
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
}

.canvas-node {
  position: absolute;
  min-width: 126px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(33, 48, 76, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  text-align: center;
  cursor: grab;
  box-shadow: 0 14px 24px rgba(40, 32, 18, 0.1);
  user-select: none;
  padding-right: 34px;
}

.canvas-node.is-as-term {
  background: rgba(52, 91, 173, 0.14);
  border-color: rgba(52, 91, 173, 0.24);
  color: #233c73;
}

.canvas-node.is-alevel-term {
  background: rgba(216, 154, 43, 0.2);
  border-color: rgba(168, 107, 18, 0.24);
  color: #6f4610;
}


.canvas-node.is-selected {
  outline: 3px solid rgba(31, 122, 120, 0.35);
  outline-offset: 3px;
}

.canvas-node.is-connectable {
  cursor: pointer;
}

.canvas-node.is-connectable:hover {
  outline: 3px solid rgba(216, 154, 43, 0.42);
  outline-offset: 3px;
  box-shadow: 0 16px 28px rgba(40, 32, 18, 0.16);
}

.canvas-node:active {
  cursor: grabbing;
}

.canvas-node-label {
  display: block;
  pointer-events: none;
}

.canvas-node-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(191, 29, 29, 0.12);
  color: #9a2020;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

.diagram-map {
  position: relative;
  min-height: 860px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(33, 48, 76, 0.12);
  background:
    url("./assets/Diagram-slide.png") center top/contain no-repeat,
    linear-gradient(180deg, #f3dece 0%, #f3dece 47%, #fbefbf 47%, #fbefbf 100%);
  aspect-ratio: 2048 / 1025;
  min-height: 0;
}

.diagram-band {
  display: none;
}

.label-mask {
  position: absolute;
  border-radius: 14px;
  z-index: 1;
}

.mask-low-language,
.mask-assembly,
.mask-assembler,
.mask-machine {
  background: #f3dece;
}

.mask-high-language,
.mask-source,
.mask-top-interpreter,
.mask-library,
.mask-compiler,
.mask-object,
.mask-intermediate,
.mask-right-interpreter {
  background: #fbefbf;
}

.mask-low-language {
  top: 10px;
  left: 8px;
  width: 310px;
  height: 54px;
}

.mask-assembly {
  top: 318px;
  left: 8.5%;
  width: 235px;
  height: 72px;
}

.mask-assembler {
  top: 300px;
  left: 38%;
  width: 220px;
  height: 96px;
}

.mask-machine {
  top: 345px;
  left: 83%;
  width: 280px;
  height: 112px;
}

.mask-high-language {
  top: 420px;
  left: 8px;
  width: 350px;
  height: 58px;
}

.mask-source {
  top: 736px;
  left: 6.5%;
  width: 235px;
  height: 74px;
}

.mask-top-interpreter {
  top: 606px;
  left: 37%;
  width: 250px;
  height: 100px;
}

.mask-library {
  top: 592px;
  left: 54%;
  width: 190px;
  height: 68px;
}

.mask-compiler {
  top: 846px;
  left: 26%;
  width: 250px;
  height: 108px;
}

.mask-object {
  top: 848px;
  left: 43%;
  width: 195px;
  height: 76px;
}

.mask-intermediate {
  top: 838px;
  left: 71%;
  width: 270px;
  height: 92px;
}

.mask-right-interpreter {
  top: 736px;
  left: 82%;
  width: 205px;
  height: 82px;
}

.diagram-band-low {
  top: 0;
  height: 47%;
}

.diagram-band-high {
  top: 47%;
  height: 53%;
}

.route {
  display: none;
}

.route-low-top {
  top: 157px;
  left: 23%;
  width: 63%;
  height: 6px;
}

.route-low-right {
  top: 157px;
  right: 14%;
  width: 6px;
  height: 145px;
}

.route-high-source-to-interpreter {
  top: 523px;
  left: 23%;
  width: 17%;
  height: 6px;
}

.route-high-source-down {
  top: 523px;
  left: 23%;
  width: 6px;
  height: 164px;
}

.route-high-source-to-compiler {
  top: 683px;
  left: 23%;
  width: 16%;
  height: 6px;
}

.route-high-compiler-to-object {
  top: 683px;
  left: 45%;
  width: 9%;
  height: 6px;
}

.route-high-object-to-linker {
  top: 683px;
  left: 59%;
  width: 12%;
  height: 6px;
}

.route-high-linker-up {
  top: 473px;
  left: 70%;
  width: 6px;
  height: 216px;
}

.route-high-linker-to-machine {
  top: 473px;
  left: 70%;
  width: 12%;
  height: 6px;
}

.route-high-library-down {
  top: 615px;
  left: 61%;
  width: 6px;
  height: 72px;
}

.route-high-intermediate-to-interpreter {
  top: 785px;
  left: 82%;
  width: 6px;
  height: 70px;
}

.route-high-interpreter-to-machine {
  top: 551px;
  left: 82%;
  width: 6px;
  height: 236px;
}

.route-arrow {
  display: none;
}

.arrow-right {
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 28px solid #c41313;
}

.arrow-down {
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid #c41313;
}

.arrow-up {
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid #c41313;
}

.arrow-low-1 {
  top: 144px;
  left: 39%;
}

.arrow-low-2 {
  top: 283px;
  right: 12.6%;
}

.arrow-high-1 {
  top: 509px;
  left: 38%;
}

.arrow-high-2 {
  top: 669px;
  left: 38%;
}

.arrow-high-3 {
  top: 669px;
  left: 55.5%;
}

.arrow-high-4 {
  top: 641px;
  left: 59.6%;
}

.arrow-high-5 {
  top: 460px;
  left: 78.8%;
}

.arrow-high-6 {
  top: 773px;
  left: 80.7%;
}

.arrow-high-7 {
  top: 536px;
  left: 80.7%;
}

.concept-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 146px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(33, 48, 76, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 14px 24px rgba(40, 32, 18, 0.1);
  z-index: 2;
}

.slot-label {
  min-width: 240px;
  min-height: 62px;
  justify-content: flex-start;
  padding-inline: 18px;
  font-size: 1.1rem;
}

.slot-node {
  min-width: 170px;
}

.slot1 {
  top: 18px;
}

.slot-group .slot-label[data-slot="slot1"] {
  top: 70px;
  left: 18px;
}

.slot-group .slot-assembly {
  top: 388px;
  left: 8.5%;
}

.slot-group .slot-assembler {
  top: 394px;
  left: 38%;
}

.slot-group .slot-machine {
  top: 468px;
  left: 82.5%;
  min-width: 230px;
}

.slot-group .slot-label[data-slot="slot5"] {
  top: 482px;
  left: 18px;
}

.slot-group .slot-source {
  top: 812px;
  left: 6.5%;
}

.slot-group .slot-compiler {
  top: 956px;
  left: 25%;
}

.slot-group .slot-object {
  top: 922px;
  left: 42.5%;
}

.slot-group .slot-linker {
  top: 744px;
  left: 55%;
}

.slot-group .slot-library {
  top: 664px;
  left: 53%;
}

.slot-group .slot-translator-interpreter {
  top: 710px;
  left: 36.5%;
}

.slot-group .slot-intermediate {
  top: 918px;
  left: 71%;
}

.slot-group .slot-interpreter {
  top: 812px;
  left: 82%;
}

.concept-slot.is-filled {
  background: rgba(216, 154, 43, 0.12);
}

.concept-slot.is-drop-target {
  outline: 3px dashed rgba(31, 122, 120, 0.35);
  outline-offset: 3px;
}

.concept-slot.is-correct {
  background: rgba(39, 113, 84, 0.12);
  border-color: rgba(39, 113, 84, 0.2);
  color: var(--good);
}

.concept-slot.is-wrong {
  background: rgba(161, 62, 52, 0.1);
  border-color: rgba(161, 62, 52, 0.2);
  color: var(--bad);
}

.field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #544b42;
}

.sorting-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.statement-bank-wrap,
.sort-card {
  padding: 18px;
}

.statement-bank {
  display: grid;
  gap: 10px;
  min-height: 200px;
  align-content: start;
}

.statement-bank.is-drop-target {
  outline: 3px dashed rgba(31, 122, 120, 0.35);
  outline-offset: 6px;
  border-radius: 18px;
}

.statement-chip {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(33, 48, 76, 0.12);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.statement-chip.is-as-term {
  background: rgba(52, 91, 173, 0.12);
  border-color: rgba(52, 91, 173, 0.24);
  color: #243f7a;
}

.statement-chip.is-alevel-term {
  background: rgba(216, 154, 43, 0.16);
  border-color: rgba(168, 107, 18, 0.24);
  color: #6f4610;
}

.statement-chip.is-bank-selected,
.statement-chip.is-selected {
  border-color: var(--teal);
  background: rgba(31, 122, 120, 0.1);
}

.statement-chip.is-correct {
  border-color: rgba(39, 113, 84, 0.2);
  background: rgba(39, 113, 84, 0.1);
}

.statement-chip.is-wrong {
  border-color: rgba(161, 62, 52, 0.2);
  background: rgba(161, 62, 52, 0.1);
}

.sorting-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sort-dropzone {
  display: grid;
  gap: 10px;
  min-height: 240px;
  margin-top: 14px;
}

.panel-warm {
  background:
    linear-gradient(135deg, rgba(216, 154, 43, 0.12), transparent 36%),
    rgba(255, 252, 246, 0.9);
}

.panel-cool {
  background:
    linear-gradient(135deg, rgba(31, 122, 120, 0.11), transparent 36%),
    rgba(255, 252, 246, 0.9);
}

.panel-deep {
  background:
    linear-gradient(135deg, rgba(33, 48, 76, 0.1), transparent 36%),
    rgba(255, 252, 246, 0.9);
}

.concise-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.definition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(33, 48, 76, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.panel-dark {
  background:
    linear-gradient(180deg, rgba(33, 48, 76, 0.96), rgba(16, 26, 41, 0.98));
  color: #f4ede0;
}

.panel-dark .panel-heading h2,
.panel-dark .step,
.panel-dark .revision-card h3,
.panel-dark .revision-card p {
  color: inherit;
}

.revision-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.revision-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

@media (max-width: 1024px) {
  .hero,
  .sorting-layout,
  .concept-layout {
    grid-template-columns: 1fr;
  }

  .translator-visual {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "flow output"
    align-items: start;
  }

  .definition-grid,
  .diagram-grid,
  .sorting-columns,
  .revision-grid,
  .concise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero,
  .panel,
  .download-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .definition-grid,
  .diagram-grid,
  .sorting-columns,
  .revision-grid,
  .concise-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .download-panel,
  .definition-head,
  .scenario-top {
    flex-direction: column;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.3rem);
  }

  .translator-visual {
    grid-template-columns: 1fr;
    grid-template-areas:
      "flow"
      "output";
  }

  .slot-group .slot-label[data-slot="slot1"] {
    left: 8px;
    top: 58px;
    min-width: 220px;
  }

  .slot-group .slot-label[data-slot="slot5"] {
    left: 8px;
    top: 474px;
    min-width: 220px;
  }

  .slot-group .slot-assembly {
    left: 7%;
    top: 386px;
  }

  .slot-group .slot-assembler {
    left: 34%;
    top: 392px;
  }

  .slot-group .slot-machine {
    left: 69%;
    top: 468px;
    min-width: 160px;
  }

  .slot-group .slot-source {
    left: 5%;
    top: 812px;
  }

  .slot-group .slot-compiler {
    left: 23%;
    top: 956px;
  }

  .slot-group .slot-object {
    left: 40%;
    top: 922px;
  }

  .slot-group .slot-linker {
    left: 53%;
    top: 744px;
  }

  .slot-group .slot-library {
    left: 47%;
    top: 664px;
  }

  .slot-group .slot-translator-interpreter {
    left: 28%;
    top: 710px;
  }

  .slot-group .slot-intermediate {
    left: 61%;
    top: 918px;
  }

  .slot-group .slot-interpreter {
    left: 71%;
    top: 812px;
  }
}
