/* I - main styles */
:root {
    --font-sans: 'Open Sans', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    background-color: #fefcf0;
    line-height: 1.6;
}

header {
    background-color: #fefcf0;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

nav a {
    text-decoration: none;
    color: #333;
    margin: 0 15px;
    font-weight: 600; /* Changed to slightly bold */
    transition: color 0.3s ease;
}

nav a:hover {
    color: #000; /* Brighten on hover */
    text-decoration: none; /* No underline */
}

.content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.content h2 {
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-family: var(--font-serif);
    font-weight: 600;
}

.content p {
    color: #555;
    margin-bottom: 20px;
    font-family: var(--font-serif);
}

.content a {
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    background-color: rgba(0,0,0,0.04); /* Very subtle highlight by default */
    padding: 0 2px; /* Small padding to make the highlight more visible */
    border-radius: 2px; /* Slightly rounded corners for the highlight */
}

.content a:hover {
    color: #333; /* Slightly highlighted text */
    background-color: rgba(0,0,0,0.08); /* Slightly stronger highlight on hover */
}

.about-section {
    margin-bottom: 30px;
    counter-reset: sidenote-counter;
    position: relative;
}

.research-interests-section {
    margin-bottom: 30px;
}

.interest-list {
    margin: 24px 0 0 0;
    padding-left: 22px;
    font-family: var(--font-serif);
    color: #555;
    line-height: 1.8;
}

.interest-list li {
    margin-bottom: 4px;
}


/* Story timeline */
.story-section {
    margin-bottom: 30px;
}

.story-intro {
    font-style: italic;
    color: #666;
}

.story-timeline {
    list-style: none;
    padding: 0;
    margin: 24px 0 0 0;
    position: relative;
}

.story-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background-color: #ddd;
}

.story-timeline li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 32px;
}

.story-timeline li:last-child {
    margin-bottom: 0;
}

.story-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #fefcf0;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: #666;
    z-index: 1;
}

.story-body h3 {
    margin: 2px 0 8px 0;
    font-family: var(--font-serif);
    font-size: 1.15em;
    color: #333;
}

.story-body p {
    margin: 0 0 8px 0;
}

a.story-link {
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #0066cc;
    text-decoration: none;
    background: none;
    padding: 0;
}

a.story-link:hover {
    text-decoration: underline;
    background: none;
    color: #0066cc;
}

.story-pending {
    color: #999;
    font-style: italic;
}

.now-box {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 28px 0;
    max-width: 260px;
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #666;
    line-height: 1.6;
}

.now-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75em;
    color: #aaa;
    margin-bottom: 6px;
}

.now-row {
    color: #555;
    margin-bottom: 4px;
}

.now-row:last-child {
    margin-bottom: 0;
}

.now-key {
    color: #aaa;
}

.now-box a {
    color: #888;
    background: none;
    padding: 0;
    border-bottom: 1px dotted #aaa;
}

.now-box a:hover {
    color: #333;
    background: none;
    border-bottom-color: #333;
}

.now-box .widget-toolbar {
    margin-bottom: -2px;
}

.now-box .widget-body {
    align-items: stretch;
    gap: 8px;
}

.widget-toolbar.snapshots-toolbar {
    justify-content: space-between;
    align-items: center;
}

.snapshots-label {
    margin-bottom: 0;
}

.snapshots-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.snapshots-item {
    margin: 0;
}

.snapshots-gallery img {
    display: block;
    width: 100%;
    border-radius: 6px;
}

.snapshots-caption {
    font-family: var(--font-sans);
    font-size: 0.75em;
    font-style: italic;
    color: #aaa;
    text-align: center;
    margin-top: 4px;
}

.snapshots-empty {
    font-style: italic;
    font-size: 0.85em;
    color: #bbb;
    text-align: center;
    margin: 20px 0;
}

.fisher-icon,
.reader-icon,
.writer-icon {
    display: none;
}

@media (min-width: 1400px) {
    .left-rail {
        position: fixed;
        left: calc(50% - 700px);
        top: 200px;
        width: 240px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .now-box {
        margin: 0;
    }

    .left-rail-narrow {
        width: 170px;
        left: calc(50% - 630px);
    }

    .right-rail {
        position: fixed;
        right: calc(50% - 630px);
        top: 200px;
        width: 170px;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .fisher-icon,
    .reader-icon,
    .writer-icon {
        display: flex;
        justify-content: center;
        padding: 6px 0;
    }
}

.fisher-icon img,
.reader-icon img,
.writer-icon img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
    animation: fisher-bob 4s ease-in-out infinite;
    transform-origin: 50% 85%;
}

.fisher-icon,
.reader-icon,
.writer-icon {
    cursor: grab;
    touch-action: none;
    user-select: none;
    z-index: 50;
}

.fisher-icon.is-dragging,
.reader-icon.is-dragging,
.writer-icon.is-dragging {
    cursor: grabbing;
    z-index: 999;
}

.fisher-icon img,
.reader-icon img,
.writer-icon img {
    -webkit-user-drag: none;
    user-select: none;
}

.fisher-icon img {
    width: 100px;
    height: auto;
}

.reader-icon img {
    width: 110px;
    height: auto;
}

.writer-icon img {
    width: 110px;
    height: auto;
}

.fisher-icon:hover img,
.reader-icon:hover img,
.writer-icon:hover img {
    opacity: 1;
}

.fisher-icon.is-hovering img,
.reader-icon.is-hovering img,
.writer-icon.is-hovering img {
    animation-play-state: paused;
}

@keyframes fisher-bob {
    0%, 100% { transform: rotate(-3deg) translateY(0); }
    50% { transform: rotate(3deg) translateY(-4px); }
}

footer {
    text-align: center;
    padding: 20px 0;
    background-color: #ffffff;
    border-top: 1px solid #eee;
    color: #777;
    font-family: 'Open Sans', sans-serif;
}

/* II - reading styles */
.reading-list {
    list-style: none;
    padding: 0;
}

.reading-entry {
    background: #fefcf0;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s;
    cursor: pointer;
    display: flex; /* Flexbox for the title and button */
    flex-direction: column; /* Stack the title and content vertically */
    border: 1px solid #ddd;
}

.reading-entry.hidden {
        display: none;
    }

.reading-title {
    flex-grow: 1;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-serif);
}

.expand-button {
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #007BFF;
    display: inline-block; /* Keep it next to title */
    margin-left: auto; /* Move the button to the far right */
    margin-top: -30px; /* Pull the button up to align with the title */
}

.reading-content {
    display: none;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    margin-top: 10px;
}

.reading-content.expanded {
        display: block;
    }

.reading-content a {
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    background-color: rgba(0,0,0,0.04);
    padding: 0 2px;
    border-radius: 2px;
}

.reading-content a:hover {
    color: #333;
    background-color: rgba(0,0,0,0.08);
}

.search-container {
    margin: 20px 0 16px 0;
}

.search-box {
    width: calc(100% - 32px);
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fefcf0;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #007BFF;
}

.search-box::placeholder {
    color: #999;
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 20px;
}

.filter-box-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72em;
    color: #aaa;
    font-family: var(--font-sans);
    margin-bottom: 2px;
}

.filter-btn {
    padding: 4px 10px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #fefcf0;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.filter-btn:hover {
    border-color: #007BFF;
    color: #007BFF;
}

.filter-btn.active {
    background-color: #007BFF;
    border-color: #007BFF;
    color: #fff;
}

.random-btn {
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #fefcf0;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.random-btn:hover {
    border-color: #007BFF;
    color: #007BFF;
}

.reading-entry.flash {
    animation: entry-flash 1.2s ease;
}

@keyframes entry-flash {
    0% { background-color: #fff3cd; }
    100% { background-color: #fefcf0; }
}

.search-results-info {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.no-results {
            text-align: center;
            padding: 40px 20px;
            color: #666;
            font-size: 16px;
        }

/* Reading activity streak */
.streak-container {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.streak-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 6px;
}

.streak-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75em;
    color: #aaa;
    font-family: var(--font-sans);
}

.streak-stats {
    font-size: 0.8em;
    color: #888;
    font-family: var(--font-sans);
}

.streak-scroll {
    --cell-size: 11px;
    overflow-x: auto;
    padding: 0 4px 2px;
}

.streak-months {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--cell-size, 11px);
    gap: 3px;
    margin-bottom: 4px;
}

.streak-month-label {
    font-size: 10px;
    color: #999;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.streak-grid {
    display: grid;
    grid-template-rows: repeat(7, var(--cell-size, 11px));
    grid-auto-flow: column;
    grid-auto-columns: var(--cell-size, 11px);
    gap: 3px;
}

.streak-cell {
    box-sizing: border-box;
    width: var(--cell-size, 11px);
    height: var(--cell-size, 11px);
    border-radius: 2px;
    background-color: #e8e4d6;
    transition: box-shadow 0.2s ease;
}

.streak-cell:hover {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.streak-cell.filled {
    background-color: #007BFF;
}

.streak-cell.future {
    background-color: transparent;
    border: 1px solid #e8e4d6;
}

/* Game of life styles*/
.game-of-life-intro {
    position: relative;
    counter-reset: sidenote-counter;
}

.game-of-life-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: #fefcf0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
        
.game-canvas {
    border: 2px solid #333;
    border-radius: 4px;
    background: #fff;
    cursor: crosshair;
}

.game-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.game-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.game-btn:hover {
    background: #0056b3;
}

.game-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.speed-slider {
    width: 80px;
}

.game-info {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* III - writing styles */
.reading-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.reading-link:hover {
    color: #fefcf0; 
}

.reading-entry .reading-link .expand-button {
    display: none;
}

/* Side Navigation Bars */
.section-nav {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
}

.nav-bar {
    width: 14px;
    height: 24px;
    background-color: #ccc;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-bar:hover {
    background-color: #666;
    width: 10px;
}

.nav-bar.active {
    background-color: #333;
    width: 6px;
}

/* Tooltip */
.nav-bar::after {
    content: attr(data-section);
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.nav-bar::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-bar:hover::after,
.nav-bar:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Article Content */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 40px;
    counter-reset: sidenote-counter;
}

/* Sidenotes */
.sidenote-checkbox {
    display: none;
}

.sidenote-toggle {
    counter-increment: sidenote-counter;
    cursor: pointer;
    color: #0066cc;
}

.sidenote-toggle::before {
    content: "[" counter(sidenote-counter) "]";
    font-size: 0.7em;
    vertical-align: super;
    margin: 0 1px;
}

.sidenote {
    display: none;
    font-size: 0.85em;
    line-height: 1.5;
    color: #666;
}

.sidenote::before {
    content: counter(sidenote-counter) ". ";
    font-weight: 600;
    color: #999;
}

@media (min-width: 1400px) {
    .sidenote-toggle {
        cursor: default;
    }

    .sidenote {
        display: block;
        float: right;
        clear: right;
        width: 260px;
        margin-right: -310px;
        margin-top: 0.2em;
        margin-bottom: 1em;
        position: relative;
    }
}

@media (max-width: 1399px) {
    .sidenote-checkbox:checked ~ .sidenote {
        display: block;
        margin: 8px 0 16px 0;
        padding: 8px 12px;
        border-left: 2px solid #ddd;
        background-color: #fefcf8;
    }
}

.article-content h1 {
    margin-bottom: 10px;
    font-size: 2em;
    font-family: var(--font-serif);
    font-weight: 700;
}

.article-subtitle {
    color: #666;
    font-style: italic;
    margin-bottom: 30px;
    line-height: 1.6;
    font-family: var(--font-serif);
}

.article-subtitle .sidenote {
    font-style: normal;
}

.article-section {
    margin-bottom: 50px;
    scroll-margin-top: 80px;
}

/* Make the h2 the clickable toggle handle */
.article-section > h2 {
    margin: 0 0 0 0;                 /* keeps your original spacing */
    border-bottom: 2px solid #eee;
    font-size: 1.5em;
    cursor: pointer;
    background-color: #fefcf8;         /* subtle background so it feels like a card header */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    user-select: none;
}

/* Hover feedback – makes it obvious it's clickable */
.article-section > h2:hover {
    background-color: #fefcf0;
}


.article-section h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #333;
    font-family: var(--font-serif);
    font-weight: 600;
}

.article-section p {
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Tables */
.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9em;
}

.benchmark-table th,
.benchmark-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.benchmark-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    width: 120px;
}

.benchmark-table td {
    color: #444;
}

.benchmark-table a {
    color: #0066cc;
    text-decoration: none;
}

.benchmark-table a:hover {
    text-decoration: underline;
}

/* Lists */
.article-section ul {
    margin: 16px 0;
    padding-left: 24px;
}

.article-section li {
    line-height: 1.8;
    margin-bottom: 8px;
}

/* Language flags */
.lang-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Interactive widgets embedded in posts */
.feature-demo {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 28px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.feature-demo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 28px 0;
}

.feature-demo-row .feature-demo {
    flex: 1 1 260px;
    margin: 0;
    padding: 16px;
    gap: 12px;
}

.feature-demo-row .feature-readout {
    min-width: 110px;
}

.lang-feature-demo,
.refusal-feature-demo {
    flex-direction: column;
}

.word-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.word-chip {
    font-family: var(--font-serif);
    font-size: 0.95em;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fefcf0;
    color: #555;
    cursor: pointer;
    transition: all 0.15s ease;
}

.word-chip:hover {
    border-color: #007BFF;
    color: #007BFF;
}

.word-chip.active {
    background-color: #007BFF;
    border-color: #007BFF;
    color: #fff;
}

.concept-region {
    opacity: 0.18;
}

.concept-a {
    fill: #007BFF;
}

.concept-b {
    fill: #e07856;
}

.feature-readout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 160px;
}

.feature-meter-label {
    font-family: var(--font-sans);
    font-size: 0.8em;
    color: #888;
}

.feature-meter-bar {
    width: 100%;
    height: 8px;
    background-color: #e8e4d6;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.feature-meter-fill {
    height: 100%;
    background-color: #007BFF;
    width: 0%;
}

.feature-hint {
    width: 100%;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #999;
    margin: 0;
}

.dims-demo {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.dim-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 140px;
}

.dim-track {
    position: relative;
    width: 10px;
    height: 100%;
    background-color: #f2efe4;
    border-radius: 3px;
    overflow: hidden;
}

.dim-track.dim-active {
    width: 16px;
    cursor: grab;
}

.dim-track.dim-active:active {
    cursor: grabbing;
}

.dim-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ccc;
}

.dim-track.dim-de .dim-fill {
    background-color: #007BFF;
}

.dim-track.dim-formal .dim-fill {
    background-color: #e07856;
}

.dims-sample {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05em;
    color: #333;
    margin: 0;
}

.axis-demo {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.axis-ref-line {
    stroke: #ddd;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.feature-axis-line {
    stroke: #bbb;
    stroke-width: 2;
}

.axis-ref-label {
    font-family: var(--font-sans);
    font-size: 11px;
    fill: #aaa;
}

.reading-axis-line {
    stroke: #333;
    stroke-width: 1.5;
}

.data-point {
    opacity: 0.85;
}

.point-a {
    fill: #007BFF;
}

.point-b {
    fill: #e07856;
}

#word-axis-handle {
    fill: #333;
    cursor: grab;
    touch-action: none;
}

#word-axis-handle:active {
    cursor: grabbing;
}

.projection-track-label {
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #999;
    text-align: center;
}

.projection-track-wrap {
    width: 280px;
}

.projection-track {
    position: relative;
    width: 100%;
    height: 28px;
    background-color: #f2efe4;
    border-radius: 6px;
}

.projection-dot {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.projection-word {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-serif);
    font-size: 0.78em;
    white-space: nowrap;
    padding: 1px 5px;
    border-radius: 10px;
    transition: left 0.05s linear;
}

.projection-word.point-a {
    background-color: rgba(0, 123, 255, 0.12);
    color: #0059b3;
}

.projection-word.point-b {
    background-color: rgba(224, 120, 86, 0.15);
    color: #a34d29;
}

.projection-word.point-amb {
    background-color: rgba(0, 0, 0, 0.06);
    color: #888;
    font-style: italic;
}

.word-svg-label {
    font-family: var(--font-serif);
    font-size: 11px;
}

.word-svg-label.point-a {
    fill: #007BFF;
}

.word-svg-label.point-b {
    fill: #e07856;
}

.word-svg-label.point-amb {
    fill: #999;
    font-style: italic;
}

.word-svg-label.point-active {
    font-weight: 700;
}

.direction-arrowhead {
    fill: #e07856;
}

.direction-origin {
    fill: #bbb;
}

.projection-drop-line {
    stroke: #ccc;
    stroke-width: 1;
    stroke-dasharray: 2 2;
}

.projection-drop-line.projection-drop-active {
    stroke: #333;
    stroke-width: 1.5;
    stroke-dasharray: none;
}

.separation-readout {
    font-family: var(--font-sans);
    font-size: 0.85em;
    margin: 0;
    color: #999;
}

.separation-readout.good {
    color: #1a8a4a;
}

.separation-readout.bad {
    color: #b5502e;
}

/* Superposition widget */
.capacity-ring {
    fill: none;
    stroke: #ddd;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.superposition-controls {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-count-label {
    font-family: var(--font-sans);
    font-size: 0.85em;
    color: #888;
}

.superposition-controls input[type="range"] {
    width: 100%;
}

/* Probing widget */
.probe-canvas {
    fill: #f2efe4;
    cursor: crosshair;
}

/* Steering vectors widget */
#steer-base {
    fill: #333;
    cursor: grab;
    touch-action: none;
}

#steer-base:active {
    cursor: grabbing;
}

.steer-target-dot {
    fill: #fefcf8;
    stroke: #333;
    stroke-width: 2;
}

/* Shared story-timeline widget scaffolding (toolbar + collapsible body) */
.widget-toolbar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.widget-toggle-btn {
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.widget-toggle-btn:hover {
    color: #333;
    text-decoration-color: #333;
}

.widget-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.widget-body.is-hidden {
    display: none;
}

/* Adaptation paradigms widget (story timeline) */
.adapt-widget {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 16px 14px;
    margin: 14px 0 6px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.adapt-svg {
    width: 100%;
    max-width: 420px;
    height: auto;
}

.adapt-landscape {
    fill: none;
    stroke: #8fb8ea;
    stroke-width: 1.6;
}

.adapt-landscape-2 {
    stroke-opacity: 0.75;
}

.adapt-landscape-3 {
    stroke-opacity: 0.45;
}

.adapt-traj-baseline {
    fill: none;
    stroke: #bbb;
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    opacity: 0.6;
}

.adapt-mode-group {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.adapt-mode-group.active {
    opacity: 1;
}

.adapt-traj-main {
    fill: none;
    stroke: #e07856;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.adapt-dot {
    stroke: #fefcf8;
    stroke-width: 1.5;
}

.adapt-dot-orig {
    fill: #999;
}

.adapt-dot-new {
    fill: #e07856;
}

.adapt-dot-label {
    font-family: var(--font-sans);
    font-size: 10px;
    fill: #999;
}

.adapt-dot-label-new {
    fill: #a34d29;
}

.adapt-vector-line {
    stroke: #007BFF;
    stroke-width: 2.2;
}

.adapt-vector-label {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    fill: #0059b3;
}

.adapt-modes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.adapt-mode-btn {
    font-family: var(--font-sans);
    font-size: 0.78em;
    color: #777;
    background-color: #f2efe4;
    border: 1px solid #e3ded0;
    border-radius: 14px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.adapt-mode-btn:hover {
    color: #333;
    background-color: #e8e4d6;
}

.adapt-mode-btn.active {
    color: #fefcf8;
    background-color: #333;
    border-color: #333;
}

.adapt-caption {
    font-family: var(--font-sans);
    font-size: 0.82em;
    color: #777;
    text-align: center;
    margin: 0;
    min-height: 2.6em;
    max-width: 380px;
}

/* Language neurons widget (story timeline) */
.neuron-dot {
    transition: fill 0.3s ease, fill-opacity 0.3s ease, r 0.3s ease, stroke 0.3s ease;
}

.neurons-col-label {
    transition: fill 0.3s ease;
}

.neurons-bars {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.neurons-output-label {
    margin: 4px 0 0 0;
}

.feature-meter-fill.secondary {
    background-color: #e07856;
}

.feature-meter-fill.residual {
    background-color: #ccc;
}

.neurons-footnote {
    font-family: var(--font-sans);
    font-size: 0.75em;
    font-style: italic;
    color: #999;
    text-align: center;
    margin: 0;
    max-width: 380px;
}

/* Steering-method comparison widget (story timeline) */
.method-grid {
    gap: 8px;
}

.method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px 6px;
}

.method-btn span {
    text-align: center;
}

.method-icon {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #999;
    stroke-width: 1.5;
    transition: stroke 0.2s ease;
}

.adapt-mode-btn.active .method-icon {
    stroke: #333;
}

.method-icon-strong {
    stroke: #007BFF;
    stroke-width: 2.5;
}

.method-icon-fill {
    fill: #e07856;
    stroke: none;
}

.point-a-faint {
    fill: #007BFF;
    fill-opacity: 0.25;
    stroke: #007BFF;
    stroke-width: 1;
}

.point-b-faint {
    fill: #e07856;
    fill-opacity: 0.25;
    stroke: #e07856;
    stroke-width: 1;
}

.method-svg {
    max-width: 400px;
}

.method-scatter-dot {
    fill-opacity: 0.75;
    transition: opacity 0.3s ease;
}

.method-cloud {
    touch-action: none;
}

/* Language subnetworks widget (story timeline) */
.subnet-node {
    transition: fill 0.4s ease, fill-opacity 0.4s ease, stroke 0.4s ease;
}

.subnet-edge {
    transition: stroke 0.4s ease, stroke-opacity 0.4s ease, stroke-width 0.4s ease;
}

.method-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    fill: #666;
}

.method-label {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    fill: #333;
}

.method-draw {
    transition: stroke-dashoffset 0.7s ease;
}

.method-pop {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    transform: scale(0.3);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.method-pop.is-in {
    transform: scale(1);
    opacity: 1;
}

/* Script-steering widget (story timeline) */
.script-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.script-panel.active {
    display: flex;
}

.script-word-display {
    font-family: var(--font-serif);
    font-size: 2em;
    color: #333;
    text-align: center;
    min-height: 1.4em;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.script-word-display.is-swapping {
    opacity: 0;
    transform: scale(0.92);
}

.script-name-label {
    font-family: var(--font-sans);
    font-size: 0.8em;
    color: #999;
    text-align: center;
    margin-top: -4px;
}

.script-head-cell {
    transition: fill 0.4s ease, fill-opacity 0.4s ease;
}

/* Attention widget */
.attn-sentence {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px;
}

.attn-word {
    font-family: var(--font-serif);
    font-size: 1.1em;
    padding: 5px 9px;
    border-radius: 4px;
    background-color: transparent;
    transition: background-color 0.1s ease, outline 0.1s ease;
    cursor: default;
}

.attn-head-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Circuits widget */
.circuit-node {
    fill: #333;
    transition: opacity 0.15s ease, fill 0.15s ease;
}

.circuit-node-active {
    fill: #007BFF;
}

.circuit-node-dim {
    opacity: 0.3;
}

.circuit-node-label {
    font-family: var(--font-sans);
    font-size: 9px;
    fill: #888;
}

.circuit-edge {
    stroke: #999;
    transition: opacity 0.15s ease, stroke 0.15s ease;
}

.circuit-edge-active {
    stroke: #007BFF;
}

.circuit-edge-dim {
    stroke: #ccc;
}

/* Logit lens / activation patching bar charts */
.logit-bars,
.patch-bars {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    padding: 10px 0;
}

.logit-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 48px;
}

.logit-bar-track {
    display: flex;
    align-items: flex-end;
    width: 26px;
    background-color: #f2efe4;
    border-radius: 4px;
    overflow: hidden;
}

.logit-bar-fill {
    width: 100%;
    background-color: #999;
    transition: height 0.15s ease, background-color 0.15s ease;
}

.logit-bar-top {
    background-color: #007BFF;
}

.logit-bar-label {
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #888;
    text-align: center;
}

.patch-bar-track {
    cursor: pointer;
}

/* Sparse autoencoder widget */
.sae-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.sae-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.sae-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sae-row-label {
    width: 100px;
    flex-shrink: 0;
    font-family: var(--font-sans);
    font-size: 0.8em;
    color: #888;
    text-align: right;
}

.sae-cells {
    display: flex;
    gap: 6px;
}

.sae-cell {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background-color: #f2efe4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 0.75em;
    color: #555;
}

.sae-legend {
    font-size: 0.78em;
    line-height: 1.6;
}

/* Representation similarity widget */
.sim-word-line {
    stroke: #ddd;
    stroke-width: 1;
}

.sim-word-dot {
    fill: #999;
}

.sim-word-label {
    font-family: var(--font-sans);
    font-size: 11px;
    fill: #999;
    transition: fill 0.1s ease, font-weight 0.1s ease;
}

.sim-word-label-best {
    fill: #007BFF;
    font-weight: 700;
}

#similarity-probe {
    fill: #333;
    cursor: grab;
    touch-action: none;
}

#similarity-probe:active {
    cursor: grabbing;
}

/* Linear representation hypothesis widget */
.lrh-point-label {
    font-family: var(--font-sans);
    font-size: 10px;
    fill: #fff;
    pointer-events: none;
}

/* Manifolds widget */
.manifold-path {
    fill: none;
    stroke: #ddd;
    stroke-width: 2;
}

.manifold-point {
    fill: #999;
    cursor: default;
    transition: fill 0.1s ease;
}

.manifold-point-ref {
    fill: #007BFF;
}

.manifold-connector {
    stroke: #333;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

/* Transformer primer widget */
.transformer-demo {
    overflow-x: auto;
}

.transformer-box {
    fill: #f2efe4;
    stroke: #ddd;
    stroke-width: 1;
    transition: fill 0.12s ease, stroke 0.12s ease;
}

.transformer-box-active {
    fill: #007BFF;
    stroke: #007BFF;
}

.transformer-box-label {
    font-family: var(--font-sans);
    font-size: 12px;
    fill: #555;
    pointer-events: none;
}

.transformer-arrow {
    stroke: #ccc;
    stroke-width: 1.5;
}

.transformer-stream {
    stroke: #bbb;
    stroke-width: 2;
    stroke-dasharray: 5 4;
    transition: stroke 0.12s ease;
}

.transformer-stream-active {
    stroke: #007BFF;
}

.transformer-stream-label {
    font-family: var(--font-sans);
    font-size: 10px;
    fill: #999;
    pointer-events: none;
}

.transformer-readout {
    min-height: 1.4em;
}

.transformer-readout a {
    color: #0066cc;
    background: none;
    padding: 0;
    font-weight: 600;
}

.transformer-head-box {
    fill: #ece8d9;
}

.transformer-head-label {
    font-family: var(--font-sans);
    font-size: 9px;
    fill: #666;
    pointer-events: none;
}

.transformer-layer-box {
    fill: none;
    stroke: #ddd;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.transformer-layer-label {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.04em;
    fill: #aaa;
    text-transform: uppercase;
}

/* Math reference box */
.math-box {
    background-color: #fefcf8;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0;
}

.math-box-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72em;
    color: #aaa;
    font-family: var(--font-sans);
    margin-bottom: 10px;
}

.math-line {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.85em;
    color: #444;
    line-height: 1.9;
    white-space: normal;
}

/* Series prev/next footer nav */
.series-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: #999;
}

/* Back link */
.back-link {
    display: inline-block;
    margin-top: 40px;
    margin-bottom: 40px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #333;
}

/* Divider */
hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

/* Last updated */
.last-updated {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 40px;
}

/* Hide nav on small screens */
@media (max-width: 1000px) {
    .section-nav {
        display: none;
    }
    
    .article-content {
        padding: 20px;
    }
}

sup a {
    text-decoration: none;
    color: #0066cc;
    font-size: 0.8em;
}

sup a:hover {
    text-decoration: underline;
}

.references-list {
    font-size: 0.9em;
    line-height: 1.8;
    font-family: var(--font-serif);
}

.references-list li {
    margin-bottom: 12px;
}
