/* =============================================================
   Pastile — shared design system
   =============================================================
   Every selector is scoped under `.pastila-page` so the styles
   never leak to the rest of the site. Pastila articles live
   inside a wrapper `<article class="pastila-page">…</article>`.
   ============================================================= */

.pastila-page {
    --bg:         #ffffff;
    --bg-soft:    #eaf2f8;
    --ink:        #2c3e50;
    --ink-soft:   #5a6f80;
    --rose:       #1e88c4;
    --rose-deep:  #155d8b;
    --slate:      #3f4d5e;
    --gold:       #b8946b;
    --rule:       #d5e3ec;
    --paper-line: #e2eaf0;

    background: var(--bg);
    color: var(--ink);
    font-family: "Crimson Pro", Georgia, serif;
    font-size: 19px;
    line-height: 1.65;
    font-feature-settings: "onum", "liga";
}

.pastila-page *,
.pastila-page *::before,
.pastila-page *::after {
    box-sizing: border-box;
}

.pastila-page .page {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 88px 32px 96px;
}

/* HEADER */
.pastila-page .kicker {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--rose);
    margin: 0 0 28px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.pastila-page .kicker::before,
.pastila-page .kicker::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rule), transparent);
}
.pastila-page .kicker::before {
    background: linear-gradient(90deg, var(--rule), transparent);
    flex: 0 0 28px;
}
.pastila-page .kicker::after {
    background: linear-gradient(90deg, var(--rule), transparent);
}

.pastila-page h1 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    font-size: clamp(42px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--ink);
}
.pastila-page h1 em {
    font-style: italic;
    color: var(--rose-deep);
    font-weight: 500;
}

.pastila-page .deck {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 22px;
    line-height: 1.45;
    color: var(--ink-soft);
    margin: 0 0 56px;
    max-width: 580px;
}

/* SECTIONS */
.pastila-page section { margin-bottom: 64px; }
.pastila-page section + section { padding-top: 16px; }

.pastila-page h2 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    font-size: 32px;
    letter-spacing: -0.005em;
    margin: 0 0 8px;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 18px;
}
.pastila-page h2 .num {
    display: inline-block;
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--rose);
    border: 1px solid var(--rose);
    padding: 4px 10px;
    border-radius: 2px;
    transform: translateY(-3px);
}

.pastila-page .lede {
    font-family: "Cormorant Garamond", serif;
    font-size: 21px;
    font-style: italic;
    color: var(--ink-soft);
    margin: 0 0 28px;
    border-left: 2px solid var(--rose);
    padding-left: 18px;
    max-width: 620px;
}

.pastila-page p { margin: 0 0 18px; }

.pastila-page strong {
    font-weight: 600;
    color: var(--ink);
}
.pastila-page em {
    color: var(--rose-deep);
    font-style: italic;
}

/* Math blocks */
.pastila-page .math-block {
    margin: 28px 0;
    padding: 22px 28px;
    background: var(--bg-soft);
    border-left: 3px solid var(--rose);
    border-radius: 2px 8px 8px 2px;
    font-size: 21px;
    overflow-x: auto;
}
.pastila-page .math-block.center {
    display: flex;
    justify-content: center;
    border-left: none;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background: transparent;
}

.pastila-page .derivation {
    margin: 32px 0;
    padding: 28px 32px;
    background: var(--bg-soft);
    border-radius: 6px;
    position: relative;
}
.pastila-page .derivation::before {
    content: "Derivare";
    position: absolute;
    top: -10px; left: 24px;
    background: var(--bg);
    color: var(--rose);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 0 10px;
}
.pastila-page .derivation .step {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
}
.pastila-page .derivation .step + .step {
    border-top: 1px dashed var(--rule);
}
.pastila-page .derivation .step .label {
    flex: 0 0 28px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--rose);
    letter-spacing: 0.1em;
}
.pastila-page .derivation .step .expr {
    flex: 1;
    font-size: 20px;
}
.pastila-page .derivation .step .note {
    flex: 0 0 auto;
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 15px;
    color: var(--ink-soft);
    text-align: right;
    max-width: 220px;
}

.pastila-page .final-result {
    margin: 36px 0;
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(180deg, var(--bg-soft) 0%, transparent 100%);
    border-top: 2px solid var(--rose);
    border-bottom: 2px solid var(--rose);
    position: relative;
}
.pastila-page .final-result::before,
.pastila-page .final-result::after {
    content: "✦";
    position: absolute;
    color: var(--rose);
    font-size: 12px;
}
.pastila-page .final-result::before {
    top: -8px; left: 50%; transform: translateX(-50%);
    background: var(--bg); padding: 0 10px;
}
.pastila-page .final-result::after {
    bottom: -8px; left: 50%; transform: translateX(-50%);
    background: var(--bg); padding: 0 10px;
}
.pastila-page .final-result .label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--rose);
    margin-bottom: 12px;
}
.pastila-page .final-result .formula { font-size: 32px; }

/* Figures */
.pastila-page figure { margin: 36px 0; padding: 0; }
.pastila-page figure svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.pastila-page figcaption {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 16px;
    color: var(--ink-soft);
    text-align: center;
    margin-top: 14px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}
.pastila-page figcaption .fig-num {
    font-family: "JetBrains Mono", monospace;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rose);
    margin-right: 10px;
}

/* Gold-bordered bullet list. Use for short measurement / property
   callouts inside the prose ("Înălțimea = r", "Lățimea = πr", etc.). */
.pastila-page .gold-bullets {
    list-style: none;
    padding-left: 0;
    margin: 18px 0;
}
.pastila-page .gold-bullets li {
    padding-left: 20px;
    border-left: 2px solid var(--gold);
    margin-bottom: 12px;
}
.pastila-page .gold-bullets li:last-child {
    margin-bottom: 0;
}
.pastila-page .gold-bullets .note-inline {
    color: var(--ink-soft);
    font-style: italic;
    font-size: 16px;
    display: block;
    margin-top: 2px;
}

/* Mini table of contents — injected automatically by the layout right
   below the deck. One ordered jump-link per top-level section. */
.pastila-page .pastila-toc {
    margin: 36px 0 48px;
    padding: 16px 22px;
    background: var(--bg-soft);
    border-radius: 6px;
    border-left: 2px solid var(--rose);
}
.pastila-page .pastila-toc-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--rose);
    margin: 0 0 8px;
}
.pastila-page .pastila-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pastila-page .pastila-toc-list a {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 10px;
    transition: color 0.18s ease;
}
.pastila-page .pastila-toc-list a:hover {
    color: var(--rose-deep);
}
.pastila-page .pastila-toc-list .num {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--rose);
    flex: 0 0 28px;
}

/* Share row — small intent-based share buttons after the article. */
.pastila-page .pastila-share {
    margin: 64px 0 0;
    padding: 18px 22px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.pastila-page .pastila-share-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-right: 4px;
}
.pastila-page .pastila-share a,
.pastila-page .pastila-share button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--rule);
    border-radius: 22px;
    background: transparent;
    color: var(--ink);
    font-family: "Cormorant Garamond", serif;
    font-size: 15px;
    font-style: italic;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
}
.pastila-page .pastila-share a:hover,
.pastila-page .pastila-share button:hover {
    border-color: var(--rose);
    color: var(--rose-deep);
    background: rgba(30, 136, 196, 0.04);
}
.pastila-page .pastila-share svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Aside / note */
.pastila-page .aside {
    margin: 32px 0;
    padding: 20px 24px;
    background: rgba(184, 148, 107, 0.08);
    border-left: 3px solid var(--gold);
    font-size: 17px;
    font-style: italic;
    color: var(--ink-soft);
    font-family: "Cormorant Garamond", serif;
}
.pastila-page .aside strong {
    font-style: normal;
    color: var(--gold);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

/* KaTeX colour tweak to match the page */
.pastila-page .katex { color: var(--ink); }
.pastila-page .math-block .katex,
.pastila-page .derivation .katex,
.pastila-page .final-result .katex { color: var(--ink); }
.pastila-page .accent-rose { color: var(--rose-deep); }

/* Interactive slider block */
.pastila-page .interactive {
    margin: 48px -40px;
    padding: 36px 28px 28px;
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    border-radius: 8px;
    position: relative;
}
.pastila-page .interactive::before {
    content: "Interactiv";
    position: absolute;
    top: -10px; left: 28px;
    background: var(--bg);
    color: var(--rose);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 0 12px;
}
.pastila-page .interactive h3 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 500;
    font-size: 24px;
    margin: 0 0 4px;
    color: var(--ink);
    text-align: center;
}
.pastila-page .interactive .sub {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 16px;
    color: var(--ink-soft);
    text-align: center;
    margin: 0 0 24px;
}
.pastila-page .interactive svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.pastila-page .slider-row {
    margin: 22px auto 0;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.pastila-page .slider-display {
    display: flex;
    align-items: baseline;
    gap: 18px;
    font-family: "Cormorant Garamond", serif;
}
.pastila-page .slider-N {
    font-size: 26px;
    font-style: italic;
    color: var(--ink);
}
.pastila-page .slider-N .num {
    font-weight: 500;
    color: var(--rose-deep);
    display: inline-block;
    min-width: 48px;
    text-align: right;
}
.pastila-page .slider-status {
    font-size: 16px;
    font-style: italic;
    color: var(--ink-soft);
}
.pastila-page .slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    outline: none;
    margin: 8px 0 4px;
}
.pastila-page .slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px; height: 22px;
    background: var(--rose);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(21, 93, 139, 0.35);
    transition: transform 0.18s ease;
    border: 2px solid var(--bg);
}
.pastila-page .slider-input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.pastila-page .slider-input::-webkit-slider-thumb:active { transform: scale(1.25); }
.pastila-page .slider-input::-moz-range-thumb {
    width: 22px; height: 22px;
    background: var(--rose);
    border: 2px solid var(--bg);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(21, 93, 139, 0.35);
}

.pastila-page .slider-bounds {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--ink-soft);
    letter-spacing: 0.18em;
}

.pastila-page .preset-row {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.pastila-page .preset-btn {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--rose);
    background: transparent;
    border: 1px solid var(--rule);
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.pastila-page .preset-btn:hover {
    border-color: var(--rose);
    background: rgba(30, 136, 196, 0.06);
}
.pastila-page .preset-btn.active {
    border-color: var(--rose);
    background: var(--rose);
    color: var(--bg);
}

/* Play button for animations */
.pastila-page .play-controls {
    margin: 22px auto 0;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.pastila-page .play-btn {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #ffffff;
    background: var(--rose);
    border: none;
    padding: 11px 26px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 10px rgba(30, 136, 196, 0.28);
}
.pastila-page .play-btn:hover {
    background: var(--rose-deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(30, 136, 196, 0.32);
}
.pastila-page .play-btn:active { transform: translateY(0); }

/* Footer inside article */
.pastila-page .pastila-meta {
    margin-top: 96px;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.pastila-page .pastila-meta .brand { color: var(--rose); }

/* Responsive tweaks */
@media (max-width: 600px) {
    .pastila-page .page { padding: 56px 22px 72px; }
    .pastila-page { font-size: 17px; }
    .pastila-page h1 { font-size: 38px; }
    .pastila-page .deck { font-size: 19px; }
    .pastila-page h2 { font-size: 26px; flex-wrap: wrap; }
    .pastila-page .math-block { font-size: 18px; padding: 18px 20px; }
    .pastila-page .derivation { padding: 24px 18px; }
    .pastila-page .derivation .step .note { display: none; }
    .pastila-page .final-result .formula { font-size: 26px; }
    .pastila-page .interactive { padding: 32px 18px 22px; margin: 48px 0; }
    .pastila-page .interactive h3 { font-size: 20px; }
    .pastila-page .slider-N { font-size: 22px; }
}
