<style>
:root {
    --bg: #0d0d0d;
    --text: #e0e0e0;
    --accent: #e67e22;
    --accent2: #3498db;
    --code-bg: #1a1a1a;
    --border: #2a2a2a;
    --h1: #f39c12;
    --h2: #e67e22;
    --h3: #d35400;
    --blockquote: #2c3e50;
    --table-stripe: #151515;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px 80px;
}
h1 {
    color: var(--h1);
    font-size: clamp(1.6em, 4vw, 2.2em);
    margin: 50px 0 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    text-align: center;
    word-break: break-word;
}
h2 {
    color: var(--h2);
    font-size: clamp(1.3em, 3.2vw, 1.6em);
    margin: 40px 0 18px;
    padding-left: 10px;
    border-left: 4px solid var(--accent);
    word-break: break-word;
}
h3 {
    color: var(--h3);
    font-size: clamp(1.1em, 2.6vw, 1.25em);
    margin: 25px 0 12px;
    word-break: break-word;
}
p { margin: 12px 0; word-break: break-word; hyphens: auto; }
a { color: var(--accent2); text-decoration: none; padding: 2px 0; }
a:hover, a:active { text-decoration: underline; }
code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Menlo, Monaco, monospace;
    font-size: .88em;
    color: #e74c3c;
    word-break: break-all;
}
pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 18px 0;
    border: 1px solid var(--border);
    font-size: .85em;
}
pre code { background: none; color: #a5d6a7; padding: 0; word-break: normal; white-space: pre; }
blockquote {
    background: var(--blockquote);
    border-left: 4px solid var(--accent);
    padding: 14px 18px;
    margin: 20px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
blockquote p { margin: 5px 0; }
table { width: 100%; min-width: 400px; border-collapse: collapse; font-size: .9em; margin: 15px 0; }
th { background: var(--accent); color: #000; padding: 10px; text-align: left; font-weight: bold; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--table-stripe); }
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
ul, ol { margin: 12px 0 12px 24px; padding-left: 0; }
li { margin: 6px 0; }
em { color: #f0c674; }
strong { color: #e67e22; }
img { max-width: 100%; height: auto; border-radius: 8px; }
h1:first-child {
    margin-top: 80px;
    font-size: clamp(2em, 5vw, 3em);
    border-bottom: 3px solid var(--accent);
    padding-bottom: 20px;
}

/* ── Heading permalink: chain icon on hover ── */
a.headerlink {
    visibility: hidden;
    text-decoration: none;
    font-size: .7em;
    margin-left: 4px;
    opacity: 0;
    transition: opacity .2s;
}
a.headerlink::after {
    content: '🔗';
    visibility: visible;
}
h1:hover a.headerlink,
h2:hover a.headerlink,
h3:hover a.headerlink {
    opacity: .5;
}
a.headerlink:hover {
    opacity: 1 !important;
}

/* ── Terminal block (AI dialogue) ── */
.terminal-block {
    background: #0a0f0a;
    border: 1px solid #2a2a2a;
    border-left: 3px solid #27ae60;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 6px;
    font-family: 'Consolas', 'Menlo', 'Monaco', monospace;
    font-size: .88em;
    color: #a5d6a7;
    font-style: normal;
}
.terminal-block em { color: #66bb6a; }
.terminal-block strong { color: #81c784; }

/* ── Block type variations ── */
.protocol-block {
    background: #0d1a0d;
    border-left: 4px solid #27ae60;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: normal;
}
.protocol-block strong { color: #27ae60; }
.hypothesis-block {
    background: #1a1a2e;
    border-left: 4px solid #3498db;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: normal;
}
.hypothesis-block strong { color: #3498db; }
.personal-block {
    background: #1a1510;
    border-left: 4px solid #e67e22;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.warning-block {
    background: #1a1010;
    border-left: 4px solid #e74c3c;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: normal;
}
@media (max-width: 600px) {
    body { padding: 16px 12px 60px; line-height: 1.55; }
    h1 { margin: 35px 0 20px; padding-bottom: 8px; }
    h2 { margin: 30px 0 14px; padding-left: 8px; }
    h3 { margin: 20px 0 10px; }
    h1:first-child { margin-top: 40px; }
    p { margin: 10px 0; }
    blockquote { padding: 12px 14px; margin: 16px 0; border-radius: 0 6px 6px 0; }
    pre { padding: 12px; font-size: .78em; border-radius: 6px; margin: 14px 0; }
    table { font-size: .78em; min-width: 300px; }
    th, td { padding: 7px 8px; }
    ul, ol { margin-left: 18px; }
    li { margin: 4px 0; }
    hr { margin: 30px 0; }
    code { padding: 1px 4px; font-size: .85em; }
}

/* ── Tiny phones: ≤ 380px ── */
@media (max-width: 380px) {
    body { padding: 12px 8px 50px; }
    h1 { font-size: 1.35em; }
    h2 { font-size: 1.15em; }
    h3 { font-size: 1.05em; }
    pre { padding: 10px; font-size: .72em; }
    blockquote { padding: 10px 12px; }
    table { font-size: .7em; }
}

/* ── Print ── */
@media print {
    body {
        background: #fff;
        color: #000;
        max-width: 100%;
        padding: 0 20px;
        font-size: 11pt;
        line-height: 1.5;
    }
    :root {
        --bg: #fff; --text: #000; --accent: #c0392b;
        --code-bg: #f5f5f5; --border: #ccc; --blockquote: #f0f0f0;
        --h1: #000; --h2: #333; --h3: #555;
    }
    pre { border: 1px solid #ccc; page-break-inside: avoid; }
    blockquote { page-break-inside: avoid; }
    table { page-break-inside: avoid; }
}
</style>
