/* MODIFICARE 1 — stiluri pentru secțiunile „Teorie” și „Curiozități”.
   Fișier nou. Folosește aceleași culori și fonturi ca styles.css. */

/* ---------- Antet: încap cinci linkuri ---------- */
@media (max-width: 760px) {
    .site-header {
        flex-wrap: wrap;
        row-gap: 10px;
    }
    .site-header nav {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 12px;
        justify-content: space-between;
        font-size: 14px;
    }
    .site-header nav::-webkit-scrollbar {
        display: none;
    }
    .site-header nav a {
        flex-shrink: 0;
    }
}

/* ---------- Structura comună ---------- */
.theory,
.curio {
    margin: 0 5%;
    padding-top: 48px;
}
.curio {
    border-top: 1px solid var(--line);
    margin-top: 40px;
}
.theory-intro h2 {
    font-size: clamp(36px, 4vw, 52px);
}
.theory-intro p {
    max-width: 820px;
    font-size: 17px;
    color: var(--muted);
    line-height: 1.8;
    margin-top: 16px;
}
.theory-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 30px 0 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.theory-toc a {
    font-size: 16px;
    font-weight: 600;
}
.theory-toc a:hover {
    color: var(--orange);
}
.theory-toc span {
    font-family: Consolas, monospace;
    font-size: 12px;
    color: var(--orange);
    margin-right: 6px;
}
.theory-block {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    gap: 40px;
    padding: 54px 0;
    border-bottom: 1px solid var(--line);
}
.theory-block:last-child {
    border-bottom: 0;
}
.theory-heading,
.curio-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.theory-heading {
    position: sticky;
    top: 24px;
    align-self: start;
}
.theory-number {
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1;
    color: var(--orange);
    letter-spacing: -2px;
}
.theory-heading .eyebrow,
.curio-heading .eyebrow {
    font-size: 11px;
    letter-spacing: 1px;
}
.theory-heading h3,
.curio-heading h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(26px, 2.6vw, 34px);
    line-height: 1.12;
    letter-spacing: -1px;
    margin-top: 6px;
}
.theory-lead,
.theory-text {
    font-size: 17px;
    color: var(--muted);
    line-height: 1.85;
    max-width: 900px;
}
.theory-lead strong,
.theory-text strong {
    color: var(--ink);
    font-weight: 600;
}
.theory-text {
    margin-top: 18px;
}
.theory-body h4,
.curio h4 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 650;
}
.lab-label {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 14px;
}

/* ---------- T1: cronologie ---------- */
.timeline {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    border-left: 1px solid var(--line);
}
.timeline li {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 14px;
    padding: 0 0 18px 22px;
    position: relative;
    font-size: 16px;
    line-height: 1.75;
    color: var(--muted);
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 9px;
    width: 9px;
    height: 9px;
    background: var(--paper);
    border: 2px solid var(--orange);
    border-radius: 50%;
}
.timeline .year {
    font-family: Consolas, monospace;
    color: var(--orange);
    font-size: 15px;
    padding-top: 1px;
}
.timeline strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- T2: proprietăți ---------- */
.property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 28px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.property-grid > div {
    position: relative;
    padding: 24px 24px 24px 66px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.property-grid p {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.75;
}
.property-grid strong {
    color: var(--ink);
    font-weight: 600;
}
.property-icon {
    position: absolute;
    left: 22px;
    top: 19px;
    font-family: var(--serif);
    font-size: 26px;
    color: var(--orange);
    line-height: 1;
}

/* ---------- T3: dimensiune ---------- */
.big-formula {
    font-family: var(--serif);
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.5px;
    margin: 24px 0 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
}
.big-formula sup {
    font-size: 0.55em;
    margin-left: 1px;
    color: var(--orange);
    vertical-align: super;
    line-height: 0;
}
.big-formula .arrow {
    color: var(--orange);
    margin: 0 14px;
}
.dim-lab {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    margin-top: 28px;
}
.dim-controls {
    padding: 24px;
    border-right: 1px solid var(--line);
}
.dim-output {
    padding: 24px;
    background: #eae9e0;
    min-width: 0;
}
.dim-output > strong {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 64px;
    line-height: 1;
    letter-spacing: -2px;
}
.dim-output > code {
    display: block;
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--orange);
    white-space: pre-wrap;
}
.dim-scale {
    position: relative;
    height: 48px;
    margin: 26px 0 12px;
    border-top: 3px solid #c9c8bd;
}
.dim-scale {
    height: 56px;
}
.dim-scale span {
    position: absolute;
    top: 10px;
    font-family: Consolas, monospace;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}
.dim-scale span:first-of-type {
    transform: none;
    text-align: left;
}
.dim-scale span::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -14px;
    width: 1px;
    height: 8px;
    background: var(--muted);
}
.dim-scale span:first-of-type::before {
    left: 0;
}
.dim-scale i {
    position: absolute;
    top: -9px;
    width: 15px;
    height: 15px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--orange);
    transition: left 0.25s;
}
.dim-presets,
.julia-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}
.dim-presets button,
.julia-presets button {
    background: transparent;
    border: 1px solid #bfc2b3;
    font-size: 14px;
    padding: 7px 12px;
    min-height: 40px;
    transition: background 0.15s;
}
.dim-presets button:hover,
.julia-presets button:hover {
    background: #e2e0d5;
}
.dim-presets button[aria-pressed='true'],
.julia-presets button[aria-pressed='true'] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}
.theory-more {
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    max-width: 900px;
}
.theory-more summary {
    font-size: 16px;
    font-weight: 600;
}
.theory-more p {
    margin-top: 14px;
    font-size: 16px;
    color: var(--muted);
    line-height: 1.8;
}
.theory-more strong {
    color: var(--ink);
}
.proof-formula {
    margin-top: 14px;
    padding: 16px 18px;
    background: #eae7dc;
    font-family: Consolas, monospace;
    font-size: 15px;
    line-height: 1.8;
    overflow-x: auto;
}
.proof-formula strong {
    color: var(--orange);
}

/* ---------- T4: limite ---------- */
.limit-lab {
    margin-top: 26px;
    border: 1px solid var(--line);
    padding: 24px;
}
.limit-lab > input {
    max-width: 520px;
}
.limit-lab > .range-label {
    max-width: 520px;
}
.limit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 22px;
    border-top: 1px solid var(--line);
}
.limit-grid > div {
    padding: 20px 18px 0 0;
}
.limit-grid > div + div {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}
.limit-grid dl {
    margin: 10px 0 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    align-items: baseline;
}
.limit-grid dt {
    font-size: 13px;
    color: var(--muted);
}
.limit-grid dd {
    margin: 0;
    text-align: right;
    font-family: var(--serif);
    font-size: 24px;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.limit-grid p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- T5: Mandelbrot și Julia ---------- */
.julia-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 26px;
}
.julia-pair figure {
    margin: 0;
    border: 1px solid var(--line);
    background: #eae9e0;
    min-width: 0;
}
.julia-pair canvas {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
}
#mini-mandelbrot {
    cursor: crosshair;
}
.julia-pair figcaption {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    font-family: Consolas, monospace;
    font-size: 13px;
    color: var(--muted);
}
.julia-pair figcaption code {
    color: var(--orange);
    font-size: 13px;
}
.julia-verdict {
    margin-top: 14px;
    padding-left: 14px;
    border-left: 3px solid var(--green);
    font-size: 16px;
    line-height: 1.7;
    min-height: 27px;
}
.julia-verdict[data-inside='false'] {
    border-left-color: var(--orange);
}
.theory-body .connection {
    margin-top: 10px;
}

/* ---------- Curiozități ---------- */
.curio-lab {
    padding: 50px 0;
    border-bottom: 1px solid var(--line);
}
.curio-lab .experiment-lead {
    margin-top: 20px;
}
.curio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    margin-top: 24px;
}
.curio-text p {
    font-size: 17px;
    color: var(--muted);
    line-height: 1.85;
    margin-bottom: 16px;
}
.curio-text strong {
    color: var(--ink);
    font-weight: 600;
}
.curio-text .button {
    margin-top: 8px;
}
.pi-table-wrap {
    border: 1px solid var(--line);
    background: #eae9e0;
    padding: 20px;
    overflow-x: auto;
}
.pi-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Consolas, monospace;
    font-size: 15px;
}
.pi-table th {
    text-align: right;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.6px;
    color: var(--muted);
    padding: 0 10px 10px;
    border-bottom: 1px solid var(--line);
}
.pi-table td {
    text-align: right;
    padding: 9px 10px;
    border-bottom: 1px solid #dddcd1;
    animation: pi-in 0.35s ease-out;
}
.pi-table td:last-child {
    color: var(--orange);
    font-weight: 600;
}
.pi-table .pi-empty td {
    text-align: left;
    font-family: var(--sans);
    color: var(--muted);
    font-weight: 400;
    animation: none;
}
@keyframes pi-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}
.pi-target {
    margin-top: 14px;
    text-align: right;
    font-family: var(--serif);
    font-size: 22px;
}
.pascal-panel {
    background: #ece8df;
}
.coast-panel {
    background: #e9ece3;
}
.fern-panel {
    background: #eef0e8;
}
.fern-panel > canvas {
    min-height: 480px;
}
.hilbert-panel {
    background: #eae9e0;
}
.hilbert-panel > canvas {
    min-height: 420px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    font-size: 15px;
    cursor: pointer;
}
.check-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
}
.fern-legend {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}
.fern-legend li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 4px 0;
}
.fern-legend i {
    flex: none;
    width: 11px;
    height: 11px;
    display: inline-block;
}
.curio-lab .sierpinski-code pre {
    font-size: 14px;
}
.fact-intro {
    padding: 48px 0 22px;
}
.fact-intro h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -1px;
}
.fact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.fact {
    padding: 22px 22px 26px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.fact-tag {
    display: block;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 1px;
    color: var(--orange);
    margin-bottom: 10px;
}
.fact p {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.75;
}

/* ---------- Ecrane mai mici ---------- */
@media (max-width: 1050px) {
    .theory-block {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .theory-heading {
        position: static;
    }
    .limit-grid {
        grid-template-columns: 1fr 1fr;
    }
    .limit-grid > div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }
    .limit-grid > div:nth-child(n + 3) {
        border-top: 1px solid var(--line);
        margin-top: 18px;
    }
    .fact-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 760px) {
    .theory,
    .curio {
        padding-top: 34px;
    }
    .theory-intro p {
        font-size: 16px;
    }
    .theory-block {
        padding: 38px 0;
    }
    .theory-number {
        font-size: 36px;
    }
    .theory-lead,
    .theory-text,
    .curio-text p {
        font-size: 16px;
    }
    .timeline li {
        grid-template-columns: 1fr;
        gap: 0;
        font-size: 15px;
    }
    .property-grid,
    .dim-lab,
    .julia-pair,
    .curio-grid {
        grid-template-columns: 1fr;
    }
    .property-grid > div {
        padding: 20px 18px 20px 56px;
    }
    .property-icon {
        left: 16px;
    }
    .dim-controls {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 20px;
    }
    .dim-output {
        padding: 20px;
    }
    .dim-output > strong {
        font-size: 54px;
    }
    .dim-scale span {
        font-size: 10px;
    }
    .big-formula .arrow {
        margin: 0 8px;
    }
    .limit-lab {
        padding: 18px;
    }
    .limit-grid {
        grid-template-columns: 1fr;
    }
    .limit-grid > div,
    .limit-grid > div + div {
        padding: 16px 0 0;
        border-left: 0;
    }
    .limit-grid > div + div {
        border-top: 1px solid var(--line);
        margin-top: 16px;
    }
    .curio-grid {
        gap: 24px;
    }
    .curio-lab {
        padding: 38px 0;
    }
    .fern-panel > canvas {
        height: 420px;
        min-height: 420px;
    }
    .hilbert-panel > canvas {
        height: 340px;
        min-height: 340px;
    }
    .fact-grid {
        grid-template-columns: 1fr;
    }
    .pi-table {
        font-size: 13px;
    }
}

@media print {
    .theory-toc,
    .dim-presets,
    .julia-presets,
    .check-label {
        display: none !important;
    }
    .theory-heading {
        position: static;
    }
    .theory-block,
    .curio-lab {
        break-inside: avoid;
    }
}

/* MODIFICARE 2 — elemente pentru textul explicativ */
.plain-list {
    margin: 18px 0 0;
    padding-left: 22px;
    max-width: 900px;
    font-size: 17px;
    color: var(--muted);
    line-height: 1.8;
}
.plain-list li {
    margin: 4px 0;
}
.plain-list li::marker {
    color: var(--orange);
}
.plain-list strong {
    color: var(--ink);
    font-weight: 600;
}
.limit-note {
    margin-top: 12px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
}
.lab-intro > p {
    max-width: 560px;
    font-size: 17px;
    line-height: 1.8;
}
@media (max-width: 760px) {
    .plain-list {
        font-size: 16px;
    }
    .lab-intro > p {
        font-size: 16px;
    }
}
