:root {
    --paper: #f4f1e9;
    --ink: #292e2b;
    --muted: #6b7069;
    --orange: #d34c2a;
    --orange-dark: #ad371a;
    --blue: #3e5b9c;
    --line: #d8d7ca;
    --green: #47604b;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: 'Segoe UI', Arial, sans-serif;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.65;
}
button,
input,
select {
    font: inherit;
}
button,
a,
input,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}
button,
a {
    touch-action: manipulation;
}
a {
    color: inherit;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: default;
    opacity: 0.4;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 5px;
}
button {
    color: var(--ink);
}
a {
    text-decoration: none;
}
h1,
h2,
h3,
p {
    margin: 0;
}
h1,
h2 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 1.08;
}
em {
    font-weight: 400;
}
h2 em {
    color: var(--orange);
}
code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.9em;
}
p code {
    background: #e8e5da;
    padding: 2px 4px;
    border-radius: 3px;
}
input[type='range'] {
    width: 100%;
    height: 22px;
    accent-color: var(--orange);
    cursor: pointer;
    margin: 12px 0 0;
}
input[type='range']::-webkit-slider-runnable-track {
    height: 3px;
    background: #c9c8bd;
    border-radius: 2px;
}
input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    margin-top: -6px;
}
button {
    border: 0;
}
.skip-link {
    position: fixed;
    left: 16px;
    top: -100px;
    padding: 10px 18px;
    background: var(--ink);
    color: white;
    z-index: 50;
}
.skip-link:focus {
    top: 12px;
}
.site-header {
    max-width: 1440px;
    margin: auto;
    padding: 24px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    gap: 20px;
}
.brand {
    font-size: 29px;
    letter-spacing: -1.6px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    line-height: 1;
}
.brand svg {
    width: 25px;
    height: 27px;
    color: var(--orange);
}
.brand-dot {
    color: var(--orange);
    margin-left: -8px;
}
.site-header nav {
    display: flex;
    gap: 34px;
    font-size: 13px;
}
.site-header nav a {
    padding: 6px 0;
}
.site-header nav a:hover {
    color: var(--orange);
}
.site-header nav span {
    font-size: 10px;
    color: var(--orange);
    vertical-align: super;
    margin-left: 3px;
}
.header-note,
.eyebrow {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 1.65px;
    line-height: 1.5;
}
.header-note {
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
}
main {
    max-width: 1440px;
    margin: auto;
}
.hero {
    padding: 66px 5% 60px;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 40px;
    align-items: center;
    min-height: 690px;
}
.eyebrow {
    color: var(--muted);
}
.hero .eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
}
.live-dot {
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
}
.hero h1 {
    font-size: clamp(64px, 6.8vw, 98px);
    margin: 28px 0 25px;
    line-height: 1.025;
    letter-spacing: -5px;
}
.hero h1 em {
    color: var(--orange);
}
.hero-description {
    max-width: 380px;
    color: #63685f;
    font-size: 15px;
    line-height: 1.85;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    min-height: 46px;
    padding: 11px 22px;
    border: 1px solid var(--line);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    transition:
        background 0.18s,
        transform 0.18s;
}
.button:hover {
    background: #e8e5da;
    transform: translateY(-1px);
}
.button.primary {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}
.button.primary:hover {
    background: var(--orange-dark);
}
.hero .button {
    margin-top: 29px;
    min-height: 50px;
    gap: 40px;
}
.hero-footnote {
    display: flex;
    gap: 23px;
    font-size: 10px;
    color: var(--muted);
    margin-top: 36px;
}
.hero-footnote span + span {
    border-left: 1px solid var(--line);
    padding-left: 23px;
}
.hero-art {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    background-image:
        linear-gradient(#dcdbd144 1px, transparent 1px),
        linear-gradient(90deg, #dcdbd144 1px, transparent 1px);
    background-size: 29px 29px;
    border: 1px solid var(--line);
    min-width: 0;
    height: 560px;
    min-height: 0;
}
.art-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 18px 0;
    font-family: Consolas, monospace;
    font-size: 8px;
    letter-spacing: 0.8px;
    color: var(--muted);
}
#hero-canvas {
    display: block;
    width: 100%;
    height: 0;
    flex: 1 1 0;
    min-height: 0;
}
.art-annotation {
    position: absolute;
    right: 5%;
    top: 100px;
    font-family: var(--serif);
    font-size: 15px;
    font-style: italic;
    color: var(--blue);
    line-height: 1.3;
    transform: rotate(-8deg);
}
.art-annotation span {
    font-size: 26px;
    display: inline-block;
    margin-left: 4px;
}
.hero-art-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 15px;
    margin: 0 24px 20px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    font-size: 11px;
}
.hero-art-bottom label {
    display: flex;
    align-items: center;
    gap: 20px;
}
.hero-art-bottom output {
    font-family: Consolas, monospace;
    color: var(--orange);
}
.hero-art-bottom input {
    margin: 0;
}
.drag-note {
    grid-column: 2;
    text-align: right;
    color: var(--muted);
    font-size: 9px;
}
.idea-section {
    border-top: 1px solid var(--line);
    margin: 0 5%;
    padding: 58px 0 0;
}
.idea-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin: 27px 0 42px;
}
.idea-grid h2 {
    font-size: clamp(36px, 4vw, 55px);
}
.idea-grid p {
    font-size: 14px;
    color: #62675e;
    line-height: 1.85;
}
.idea-grid p + p {
    margin-top: 15px;
}
.idea-grid strong {
    color: var(--ink);
    font-weight: 600;
}
.concept-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 28px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.concept-strip > div {
    position: relative;
    padding: 0 28px 0 57px;
}
.concept-strip > div:first-child {
    padding-left: 38px;
}
.concept-strip > div + div {
    border-left: 1px solid var(--line);
}
.concept-symbol {
    position: absolute;
    left: 23px;
    top: -5px;
    font-family: var(--serif);
    font-size: 31px;
    color: var(--orange);
}
.concept-strip > div:first-child .concept-symbol {
    left: 0;
}
.concept-symbol .sup {
    font-size: 17px;
    vertical-align: super;
}
.concept-strip h3 {
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 5px;
}
.concept-strip p {
    max-width: 270px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
.lab-intro {
    padding: 84px 5% 35px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}
.lab-intro h2 {
    font-size: clamp(44px, 5vw, 68px);
    margin-top: 20px;
}
.lab-intro > p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.9;
    padding-bottom: 4px;
}
.experiment-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: rgba(244, 241, 233, 0.97);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 17px 5%;
    backdrop-filter: blur(12px);
}
.experiment-nav a {
    font-size: 12px;
    white-space: nowrap;
}
.experiment-nav a span {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--muted);
    margin-right: 10px;
}
.experiment-nav a:hover,
.experiment-nav a.active {
    color: var(--orange);
}
.experiment-nav a.active span {
    color: var(--orange);
}
.experiment {
    margin: 0 5%;
    padding: 66px 0 48px;
    border-bottom: 1px solid var(--line);
}
.experiment-heading {
    display: flex;
    gap: 22px;
    align-items: center;
}
.chapter-number {
    font-family: var(--serif);
    font-size: 52px;
    color: var(--orange);
    line-height: 1;
    letter-spacing: -4px;
    white-space: nowrap;
}
.chapter-number > span {
    font-family: var(--sans);
    font-size: 10px;
    color: #939587;
    letter-spacing: 0;
    margin-left: 5px;
}
.experiment-heading h2 {
    font-size: clamp(27px, 3.1vw, 42px);
    letter-spacing: -1.5px;
    margin-top: 6px;
}
.experiment-heading .eyebrow {
    font-size: 9px;
    letter-spacing: 1.4px;
}
.tag {
    margin-left: auto;
    border: 1px solid var(--line);
    padding: 5px 10px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    white-space: nowrap;
}
.experiment-lead {
    max-width: 760px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.9;
    margin: 23px 0 27px;
}
.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
    border: 1px solid var(--line);
}
.canvas-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #eae9e0;
}
.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 19px;
    font-family: Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.65px;
    gap: 8px;
}
.text-button {
    background: none;
    padding: 0;
    border: 0;
    text-decoration: none;
    font-size: 11px;
    line-height: 1.7;
    color: var(--ink);
    display: inline-block;
}
.text-button:hover {
    color: var(--orange);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.canvas-toolbar .text-button {
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0;
}
.canvas-panel > canvas {
    display: block;
    width: 100%;
    height: 0;
    flex: 1 1 0;
    min-height: 340px;
    max-height: none;
}
.canvas-caption {
    margin-top: auto;
    padding: 13px 19px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-family: Consolas, monospace;
    font-size: 9px;
    color: #6c7166;
    border-top: 1px solid #d8d7ca;
}
.control-panel {
    border-left: 1px solid var(--line);
    padding: 26px;
    min-width: 0;
}
.control-title {
    font-family: var(--serif);
    font-size: 23px;
    letter-spacing: -0.7px;
    margin-bottom: 25px;
    line-height: 1.2;
}
.range-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    align-items: center;
}
.range-label output {
    font-family: Consolas, monospace;
    color: var(--orange);
    font-size: 15px;
    line-height: 1.2;
}
.range-limits {
    display: flex;
    justify-content: space-between;
    font-family: Consolas, monospace;
    font-size: 9px;
    color: var(--muted);
    margin: 3px 0 19px;
}
.button-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 20px;
}
.button.small {
    min-height: 36px;
    padding: 8px 13px;
    font-size: 11px;
    gap: 8px;
}
.icon-button {
    background: transparent;
    border: 1px solid var(--line);
    width: 36px;
    height: 36px;
    font-size: 18px;
}
.icon-button:hover {
    background: #e6e3d9;
}
.metric {
    margin: 26px 0 18px;
    display: flex;
    flex-direction: column;
}
.metric > strong {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 48px;
    line-height: 1;
    letter-spacing: -2px;
}
.metric > span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 8px;
}
.metric code {
    margin-left: 8px;
    color: var(--orange);
}
.explain {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.85;
}
.explain strong {
    font-weight: 650;
}
.code-details {
    margin-top: 21px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
summary {
    cursor: pointer;
    font-size: 11px;
}
.code-details summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
}
.code-details summary::-webkit-details-marker {
    display: none;
}
pre {
    font-family: Consolas, monospace;
    font-size: 10px;
    line-height: 1.85;
    margin: 14px 0 0;
    padding: 14px 16px;
    overflow-x: auto;
    tab-size: 4;
    white-space: pre;
}
pre code {
    display: block;
    font-size: inherit;
    white-space: pre;
}
pre code > span {
    display: inline;
    padding: 0;
    white-space: inherit;
}
pre code .highlight {
    background: #e7dfd1;
    color: #aa3e22;
}
.code-note {
    font-size: 9px;
    line-height: 1.7;
    color: var(--muted);
    margin-top: 9px;
}
.connection {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 25px;
    padding: 22px 0 0;
}
.connection-label {
    font-size: 8px;
    letter-spacing: 1.3px;
    color: var(--orange);
    font-weight: 650;
    padding-top: 4px;
}
.connection p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.85;
}
.connection strong {
    color: var(--ink);
    font-weight: 600;
}
.koch-panel {
    background: #e5e9ed;
}
.segmented {
    border: 0;
    padding: 0;
    margin: 21px 0;
    display: flex;
    gap: 0;
}
.segmented legend {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 8px;
}
.segmented label {
    position: relative;
    flex: 1;
    cursor: pointer;
}
.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.segmented span {
    display: block;
    text-align: center;
    border: 1px solid var(--line);
    font-size: 10px;
    padding: 9px 4px;
}
.segmented input:checked + span {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.segmented input:focus-visible + span {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}
.metrics-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.metrics-pair .metric {
    margin: 10px 0 20px;
}
.metrics-pair .metric strong {
    font-size: 38px;
}
.growth-bars {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    height: 90px;
    margin: 10px 0 22px;
    border-bottom: 1px solid var(--line);
    padding-top: 10px;
}
.growth-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    height: 100%;
    gap: 5px;
}
.growth-column i {
    display: block;
    width: 100%;
    max-width: 30px;
    background: #cfcec4;
    min-height: 2px;
}
.growth-column.current i {
    background: var(--blue);
}
.growth-column span {
    font-family: Consolas, monospace;
    font-size: 8px;
    color: var(--muted);
    padding-bottom: 3px;
}
.tree-panel {
    background: #e6e9df;
}
.spaced {
    margin-top: 23px;
}
.formula-box {
    padding: 17px 18px;
    background: #eae7dc;
    margin: 22px 0 18px;
}
.formula-box > span {
    display: block;
    font-size: 8px;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin-bottom: 10px;
}
.formula-box code {
    font-size: 11px;
    line-height: 1.9;
}
.mandelbrot-panel {
    background: #e6e4da;
}
.mandelbrot-viewport {
    position: relative;
    flex: 1;
    min-height: 420px;
    overflow: hidden;
}
.mandelbrot-viewport canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}
.mandelbrot-viewport canvas:active {
    cursor: grabbing;
}
.zoom-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    background: var(--paper);
    box-shadow: 0 2px 10px #1d251920;
}
.zoom-controls button {
    background: transparent;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    font-size: 18px;
}
.zoom-controls button:hover {
    background: #dedacb;
}
.select-label {
    display: block;
    margin: 23px 0 8px;
    font-size: 11px;
}
select {
    max-width: 100%;
    width: 100%;
    padding: 9px 8px;
    background: transparent;
    border: 1px solid #bfc1b4;
    color: var(--ink);
    font-size: 11px;
    border-radius: 0;
}
.mandelbrot-formula > div {
    font-family: var(--serif);
    font-size: 30px;
    letter-spacing: -1px;
}
.mandelbrot-formula > p {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--muted);
    margin-top: 9px;
}
.math-details {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 12px;
    font-size: 11px;
}
.math-details p {
    margin: 13px 0;
    color: var(--muted);
    line-height: 1.8;
}
.math-details > code {
    font-size: 10px;
}
.chaos-panel {
    background: #e4e7e9;
}
.algorithm-steps {
    padding-left: 18px;
    margin: 23px 0;
    font-size: 12px;
    color: var(--muted);
}
.algorithm-steps li {
    padding-left: 5px;
    margin: 6px 0;
}
.algorithm-steps li::marker {
    color: var(--orange);
    font-family: Consolas, monospace;
    font-size: 10px;
}
.chaos-experiment .explain {
    margin-top: 24px;
}
.quiz-section {
    background: #e7e6dc;
    margin-top: 70px;
    padding: 53px 5%;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 65px;
    border-block: 1px solid var(--line);
}
.quiz-intro h2 {
    font-size: 66px;
    margin: 20px 0;
}
.quiz-intro > p:not(.eyebrow) {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.9;
}
.quiz-score {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 25px 0 12px;
}
.quiz-score strong {
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 400;
    letter-spacing: -1.5px;
}
.quiz-score span {
    font-size: 10px;
    color: var(--muted);
}
.quiz-question {
    border: 0;
    border-bottom: 1px solid #cacdbf;
    margin: 0 0 23px;
    padding: 0 0 16px;
    min-width: 0;
}
.quiz-question:last-child {
    margin-bottom: 0;
    border: 0;
}
.quiz-question legend {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 13px;
    display: block;
    width: 100%;
    padding: 0;
}
.quiz-question legend > span {
    font-family: Consolas, monospace;
    font-size: 10px;
    color: var(--orange);
    margin-right: 10px;
}
.quiz-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.quiz-options button {
    background: transparent;
    border: 1px solid #bfc2b3;
    font-size: 11px;
    padding: 8px 16px;
    transition: background 0.15s;
}
.quiz-options button:hover {
    background: #d9dccf;
}
.quiz-options button.correct {
    background: #d2ddcd;
    border-color: #73896d;
    color: #30482c;
}
.quiz-options button.wrong {
    background: #ecd5ca;
    border-color: #c8785e;
    color: #863b24;
}
.quiz-options button.selected {
    box-shadow: inset 0 0 0 1px currentColor;
}
.quiz-feedback {
    font-size: 11px;
    color: var(--green);
    min-height: 18px;
    line-height: 1.7;
    margin-top: 10px;
}
.closing {
    text-align: center;
    padding: 75px 5%;
}
.closing > p:not(.eyebrow) {
    font-family: var(--serif);
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1.3;
    letter-spacing: -1px;
    margin: 24px 0;
}
.closing em {
    color: var(--orange);
}
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    padding: 27px 5%;
    border-top: 1px solid var(--line);
}
footer .brand {
    font-size: 24px;
}
footer p,
footer > a:last-child {
    font-size: 10px;
    color: var(--muted);
}
.sources {
    padding: 0 5% 24px;
    color: var(--muted);
}
.sources summary {
    font-size: 10px;
}
.sources > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    margin-top: 20px;
    font-size: 11px;
    line-height: 1.85;
}
.sources a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
@media (min-width: 1500px) {
    .hero h1 {
        font-size: 98px;
    }
    .hero {
        min-height: 740px;
    }
    .hero-art {
        height: 590px;
    }
}
@media (max-width: 1050px) {
    .header-note {
        display: none;
    }
    .hero {
        gap: 24px;
        min-height: 610px;
        padding-top: 48px;
    }
    .hero h1 {
        font-size: 75px;
    }
    .hero-description {
        font-size: 13px;
    }
    .art-label {
        font-size: 7px;
    }
    .hero-footnote {
        gap: 12px;
        font-size: 9px;
    }
    .hero-footnote span + span {
        padding-left: 12px;
    }
    .workbench {
        grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr);
    }
    .control-panel {
        padding: 22px;
    }
    .tag {
        display: none;
    }
    .concept-strip > div {
        padding-right: 15px;
    }
    .connection {
        grid-template-columns: 150px 1fr;
    }
    .experiment-nav {
        gap: 8px;
    }
    .experiment-nav a {
        font-size: 11px;
    }
    .experiment-nav a span {
        margin-right: 4px;
    }
    .quiz-section {
        gap: 35px;
    }
}
@media (max-width: 760px) {
    html {
        scroll-padding-top: 85px;
    }
    .site-header {
        padding-block: 20px;
    }
    .site-header nav {
        gap: 18px;
        font-size: 11px;
    }
    .brand {
        font-size: 25px;
    }
    .brand svg {
        width: 22px;
    }
    .hero {
        grid-template-columns: 1fr;
        padding-top: 37px;
        gap: 35px;
        padding-bottom: 40px;
    }
    .hero h1 {
        font-size: clamp(62px, 11vw, 86px);
        margin-top: 23px;
        letter-spacing: -3.5px;
    }
    .hero-description {
        max-width: 480px;
        font-size: 14px;
    }
    .hero-footnote {
        margin-top: 24px;
    }
    .hero-art {
        height: 440px;
        min-height: 0;
    }
    #hero-canvas {
        height: 0;
        min-height: 0;
        flex: 1 1 0;
    }
    .hero-art-bottom {
        margin-bottom: 18px;
    }
    .art-annotation {
        top: 72px;
        right: 6%;
    }
    .idea-section {
        padding-top: 38px;
    }
    .idea-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 20px;
    }
    .idea-grid h2 {
        font-size: 42px;
    }
    .concept-strip {
        gap: 0;
    }
    .concept-strip > div,
    .concept-strip > div:first-child {
        padding: 38px 12px 0;
    }
    .concept-strip > div:first-child {
        padding-left: 0;
    }
    .concept-strip .concept-symbol {
        left: 12px;
        top: -6px;
    }
    .concept-strip > div:first-child .concept-symbol {
        left: 0;
    }
    .concept-strip h3 {
        font-size: 12px;
    }
    .concept-strip p {
        font-size: 10px;
    }
    .lab-intro {
        padding-top: 51px;
        display: block;
    }
    .lab-intro h2 {
        font-size: 50px;
    }
    .lab-intro > p {
        margin-top: 22px;
    }
    .experiment-nav {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 24px;
        padding-block: 15px;
        scrollbar-width: none;
    }
    .experiment-nav a {
        font-size: 11px;
    }
    .experiment {
        padding-top: 44px;
        padding-bottom: 33px;
    }
    .experiment-heading {
        gap: 15px;
        align-items: flex-start;
    }
    .experiment-heading .eyebrow {
        font-size: 8px;
    }
    .chapter-number {
        font-size: 42px;
        letter-spacing: -2px;
    }
    .experiment-heading h2 {
        font-size: 31px;
        line-height: 1.1;
    }
    .experiment-lead {
        font-size: 13px;
        margin-top: 20px;
    }
    .workbench {
        grid-template-columns: 1fr;
    }
    .control-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 25px;
    }
    .control-title {
        font-size: 24px;
    }
    .canvas-panel > canvas {
        height: 320px;
        min-height: 300px;
        max-height: none;
        flex: none;
    }
    .canvas-toolbar {
        padding: 13px 15px;
    }
    .canvas-caption {
        padding: 12px 15px;
        font-size: 8px;
    }
    .mandelbrot-viewport {
        min-height: 350px;
    }
    .connection {
        grid-template-columns: 1fr;
        gap: 9px;
        padding-top: 20px;
    }
    .connection p {
        font-size: 11px;
    }
    .connection-label {
        font-size: 8px;
    }
    .metrics-pair .metric strong {
        font-size: 44px;
    }
    .growth-bars {
        height: 80px;
    }
    .quiz-section {
        grid-template-columns: 1fr;
        gap: 38px;
        margin-top: 45px;
        padding-top: 40px;
        padding-bottom: 35px;
    }
    .quiz-intro h2 {
        font-size: 55px;
    }
    .quiz-intro h2 br {
        display: none;
    }
    .quiz-score {
        margin-top: 18px;
    }
    .quiz-question legend {
        font-size: 13px;
    }
    .quiz-options button {
        font-size: 10px;
        padding: 9px 12px;
    }
    .closing {
        padding-block: 50px;
    }
    .closing > p:not(.eyebrow) {
        font-size: 29px;
    }
    .closing br {
        display: none;
    }
    footer {
        flex-wrap: wrap;
        gap: 15px;
    }
    footer p {
        order: 3;
        width: 100%;
    }
    .sources > div {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .hero-art-bottom {
        grid-template-columns: 1fr 1.4fr;
    }
    .sources {
        padding-top: 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
@media print {
    .site-header,
    .experiment-nav,
    .button,
    .text-button,
    .zoom-controls,
    .hero-art-bottom,
    input,
    select,
    .quiz-section,
    .toast {
        display: none !important;
    }
    .hero {
        min-height: 0;
        padding-top: 25px;
    }
    .hero h1 {
        font-size: 60px;
    }
    .experiment {
        break-inside: avoid;
        padding-top: 30px;
    }
    .workbench {
        grid-template-columns: 1.4fr 1fr;
    }
    .control-panel {
        border-left: 1px solid var(--line);
        border-top: 0;
    }
    body {
        font-size: 11px;
    }
    .canvas-panel > canvas {
        min-height: 240px;
    }
    .sources > div {
        display: block;
    }
    .hero-art canvas {
        min-height: 250px;
    }
}

.experiment-nav::-webkit-scrollbar {
    display: none;
}

/* Antet și introducere compacte. */
.hero {
    min-height: 0;
    padding-top: 46px;
    padding-bottom: 46px;
}
.hero h1 {
    margin: 0 0 20px;
}
.hero-art {
    height: 420px;
}
.art-label {
    font: 12px var(--sans);
    letter-spacing: 0;
}
.idea-section {
    padding-top: 35px;
}
.idea-grid {
    margin-top: 0;
    margin-bottom: 30px;
}
.idea-grid h2 {
    font-size: clamp(32px, 3.5vw, 46px);
}
.lab-intro {
    padding-top: 48px;
    padding-bottom: 26px;
}
.lab-intro h2 {
    font-size: clamp(36px, 4vw, 52px);
    margin: 0;
}
.control-panel > .button-row:first-child {
    margin-top: 0;
}
.quiz-intro h2 {
    font-size: 48px;
    margin: 0 0 24px;
}
footer {
    display: block;
    padding-top: 20px;
    padding-bottom: 20px;
}
footer .sources {
    padding: 0;
}
.sources summary {
    font-size: 12px;
}
.sources > div {
    margin-top: 14px;
}
@media (max-width: 760px) {
    .hero {
        padding-top: 32px;
        padding-bottom: 32px;
        gap: 28px;
    }
    .hero h1 {
        font-size: 64px;
    }
    .hero-art {
        height: 360px;
    }
    .idea-section {
        padding-top: 28px;
    }
    .lab-intro {
        padding-top: 34px;
    }
    .quiz-intro h2 {
        font-size: 42px;
    }
}

.sierpinski-code {
    padding: 18px 20px;
    border: 1px solid var(--line);
    margin-top: 20px;
}
.sierpinski-code pre {
    font-size: 12px;
    line-height: 1.7;
    margin-top: 16px;
}
.sierpinski-code .code-note {
    font-size: 11px;
    max-width: 720px;
}
.sierpinski-code summary {
    font-size: 12px;
}
@media (max-width: 760px) {
    .sierpinski-code {
        padding: 16px;
    }
    .sierpinski-code pre {
        font-size: 10px;
    }
}

/* Text mai lizibil în demonstrații și în navigare. */
:root {
    --muted: #555c53;
}
body {
    font-size: 17px;
}
.site-header nav {
    font-size: 16px;
}
.hero-description {
    font-size: 18px;
    color: var(--muted);
}
.hero .button {
    font-size: 17px;
    min-height: 54px;
}
.art-label {
    font-size: 14px;
    color: var(--ink);
}
.hero-art-bottom {
    font-size: 15px;
    grid-template-columns: 1fr 1fr;
}
.hero-art-bottom output {
    font-size: 17px;
}
.idea-grid p {
    font-size: 17px;
    color: var(--muted);
}
.concept-strip h3 {
    font-size: 17px;
}
.concept-strip p {
    font-size: 15px;
    max-width: none;
}
.experiment-nav {
    gap: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.experiment-nav a {
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}
.experiment-nav a span {
    font-size: 12px;
}
.experiment-heading .eyebrow {
    font-size: 12px;
    letter-spacing: 1px;
}
.chapter-number > span {
    font-size: 13px;
}
.experiment-lead {
    font-size: 17px;
    color: var(--muted);
    max-width: 900px;
}
.canvas-toolbar {
    font-size: 12px;
}
.canvas-caption {
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}
.range-label {
    font-size: 16px;
    font-weight: 500;
}
.range-label output {
    font-size: 20px;
}
.range-limits {
    font-size: 12px;
    gap: 12px;
}
.button.small {
    font-size: 15px;
    min-height: 44px;
    padding: 10px 14px;
}
.icon-button {
    width: 44px;
    height: 44px;
    font-size: 22px;
}
.metric > strong {
    font-size: 58px;
}
.metric > span {
    font-size: 14px;
}
.explain {
    font-size: 16px;
    line-height: 1.8;
}
.text-button,
summary {
    font-size: 15px;
}
.sierpinski-code summary {
    font-size: 16px;
}
.sierpinski-code pre {
    font-size: 15px;
}
.sierpinski-code .code-note {
    font-size: 15px;
}
.connection {
    grid-template-columns: 220px 1fr;
}
.connection-label {
    font-size: 12px;
    letter-spacing: 0.8px;
}
.connection p {
    font-size: 16px;
    line-height: 1.8;
}
.segmented legend {
    font-size: 15px;
}
.segmented span {
    font-size: 15px;
    padding: 10px 5px;
}
.growth-column span {
    font-size: 12px;
}
.formula-box > span {
    font-size: 12px;
}
.formula-box code {
    font-size: 15px;
}
.select-label,
select {
    font-size: 16px;
}
select {
    padding: 10px;
}
.mandelbrot-formula > p {
    font-size: 14px;
}
.math-details,
.math-details > code {
    font-size: 15px;
}
.zoom-controls button {
    width: 44px;
    height: 44px;
}
.quiz-score span {
    font-size: 15px;
}
.quiz-question legend {
    font-size: 17px;
}
.quiz-question legend > span {
    font-size: 13px;
}
.quiz-options button {
    font-size: 15px;
    min-height: 44px;
}
.quiz-feedback {
    font-size: 15px;
}
.sources summary,
.sources > div {
    font-size: 14px;
}
@media (max-width: 1050px) {
    .experiment-nav {
        justify-content: flex-start;
    }
    .concept-strip > div {
        padding-right: 16px;
    }
}
@media (max-width: 760px) {
    .site-header nav {
        font-size: 14px;
        gap: 16px;
    }
    .hero-description,
    .idea-grid p,
    .experiment-lead {
        font-size: 16px;
    }
    .concept-strip {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .concept-strip > div,
    .concept-strip > div:first-child {
        padding: 0 0 0 42px;
        border-left: 0;
    }
    .concept-strip .concept-symbol,
    .concept-strip > div:first-child .concept-symbol {
        left: 0;
        top: -5px;
    }
    .concept-strip p {
        font-size: 15px;
    }
    .experiment-nav {
        gap: 24px;
    }
    .experiment-nav a {
        font-size: 15px;
    }
    .experiment-heading .eyebrow {
        font-size: 11px;
    }
    .canvas-caption {
        font-size: 12px;
    }
    .range-label {
        font-size: 15px;
    }
    .range-limits {
        font-size: 11px;
    }
    .connection {
        grid-template-columns: 1fr;
    }
    .connection p {
        font-size: 16px;
    }
    .sierpinski-code pre {
        font-size: 13px;
    }
    .quiz-question legend {
        font-size: 16px;
    }
    .hero-art-bottom {
        grid-template-columns: 1fr;
        font-size: 15px;
        gap: 8px;
    }
}
@media (max-width: 360px) {
    .site-header {
        gap: 12px;
    }
    .site-header nav {
        gap: 10px;
        font-size: 13px;
    }
    .button-row {
        flex-wrap: wrap;
    }
}

.concept-symbol {
    font-size: 28px;
}
.concept-symbol .sup {
    font-size: 15px;
}

footer .project-credit {
    margin-top: 22px;
    font-size: 16px;
    color: var(--ink);
    line-height: 1.7;
}

/* MODIFICARE 7 — textul „Proiect informatică · Clasa XI-C” de deasupra titlului. */
.project-badge {
    margin: 0 0 22px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.3;
}
.project-badge .badge-sep {
    margin: 0 6px;
    color: var(--orange);
    font-weight: 700;
}
@media (max-width: 760px) {
    .project-badge {
        font-size: 12px;
        letter-spacing: 1px;
        margin-bottom: 18px;
    }
}

/* MODIFICARE 12: iconițele butoanelor (redare, pauză, modificare, gata, din nou).
   Sunt desenate ca imagini SVG mici, colorate cu culoarea textului butonului.
   Înainte erau caractere ca ▶, pe care telefoanele le afișau ca emoji. */
[data-icon]::before {
    content: '';
    display: inline-block;
    flex: none;
    width: 0.95em;
    height: 0.95em;
    margin-right: 0.45em;
    vertical-align: -0.12em;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
.button[data-icon]::before,
[data-icon]:empty::before {
    margin-right: 0;
}
[data-icon='play'] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2.2v11.6L13.5 8z'/%3E%3C/svg%3E");
}
[data-icon='pause'] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 2.5h3.2v11H3.5zM9.3 2.5h3.2v11H9.3z'/%3E%3C/svg%3E");
}
[data-icon='edit'] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.2 1.6l3.2 3.2-8.7 8.7-4 .8.8-4z'/%3E%3C/svg%3E");
}
[data-icon='check'] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.6l3.6 3.6L13.6 4.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
[data-icon='reset'] {
    --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.1 4.6A5 5 0 1 1 3 8' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3Cpath d='M1.6 2.2l.6 4.4 4.3-1.1z'/%3E%3C/svg%3E");
}
