/* ============================================================
   rironbusou.net — Isometric Technical Docs
   Palette:
     Blueprint:  #1a2744
     Paper:      #f8f9fa
     Grid Cyan:  #67c2d4
     Teal Deep:  #338090
     Teal Mid:   #4da4b3
     Step Orange:#e8741a
     Confirm:    #4caf50
     Text:       #333333
     White:      #ffffff
   Fonts: Archivo (display), Atkinson Hyperlegible (body), Fira Mono (code)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #333333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, .step-badge, .step-number-large {
    font-family: 'Archivo', sans-serif;
}

code, .notation-code, .fallacy-name, .analysis-label {
    font-family: 'Fira Mono', monospace;
}

/* --- Site Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a2744;
    border-bottom: 2px solid #67c2d4;
    height: 56px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.logo-jp {
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: #67c2d4;
    letter-spacing: 0.04em;
}

.logo-en {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: rgba(103, 194, 212, 0.6);
    letter-spacing: 0.08em;
}

.header-nav {
    display: flex;
    gap: 24px;
    margin-left: auto;
}

.header-nav a {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #67c2d4;
}

.header-badge {
    font-family: 'Fira Mono', monospace;
    font-size: 0.7rem;
    color: rgba(103, 194, 212, 0.5);
    background: rgba(103, 194, 212, 0.08);
    border: 1px solid rgba(103, 194, 212, 0.2);
    padding: 3px 8px;
    white-space: nowrap;
}

/* --- Page Wrapper: 3-Column Grid --- */
.page-wrapper {
    display: grid;
    grid-template-columns: 60px 1fr 200px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 56px);
}

/* --- Left: Progress Track --- */
.progress-track {
    position: relative;
    padding-top: 40px;
}

.progress-line-container {
    position: sticky;
    top: 80px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-line-bg {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(103, 194, 212, 0.2);
}

.progress-line-fill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 2px;
    height: 0%;
    background: #67c2d4;
    transition: height 0.15s ease-out;
    z-index: 1;
}

.step-nodes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.step-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(103, 194, 212, 0.4);
    background: #1a2744;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.step-node .node-number {
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: 0.6rem;
    color: rgba(103, 194, 212, 0.5);
    transition: color 0.3s;
}

.step-node.active {
    border-color: #e8741a;
    background: rgba(232, 116, 26, 0.15);
}

.step-node.active .node-number {
    color: #e8741a;
}

.step-node.completed {
    border-color: #67c2d4;
    background: #67c2d4;
}

.step-node.completed .node-number {
    color: #1a2744;
}

/* --- Main Content --- */
.main-content {
    padding: 40px 48px 80px 40px;
    max-width: 900px;
}

/* --- Step Sections --- */
.step-section {
    margin-bottom: 80px;
    padding-top: 20px;
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
}

.step-badge {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #67c2d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    color: #67c2d4;
    background: transparent;
    margin-top: 4px;
}

.step-title-group {
    flex: 1;
}

.step-label {
    display: block;
    font-family: 'Fira Mono', monospace;
    font-size: 0.7rem;
    color: #338090;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.step-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: #1a2744;
    line-height: 1.2;
}

.step-body {
    padding-left: 0;
}

.lead-text {
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 28px;
    max-width: 700px;
}

/* --- Blueprint Sections --- */
.blueprint-section {
    position: relative;
}

.blueprint-section .step-title {
    color: #1a2744;
}

/* --- Info Block --- */
.info-block {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(103, 194, 212, 0.06);
    border-left: 3px solid #67c2d4;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.info-block-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.info-block-content strong {
    display: block;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 4px;
}

.info-block-content p {
    font-size: 0.95rem;
    color: #555;
    margin: 0;
}

/* --- Concept Grid --- */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.concept-card {
    border: 1px solid #dde4e8;
    background: #ffffff;
    padding: 20px 16px;
    position: relative;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #4da4b3;
}

.concept-icon {
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: rgba(103, 194, 212, 0.2);
    margin-bottom: 8px;
    line-height: 1;
}

.concept-label {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #338090;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.concept-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

/* --- Tabbed Content --- */
.tabbed-content {
    margin-top: 8px;
}

.tab-list {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0;
}

.tab-btn {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 20px;
    background: #f0f4f6;
    border: 1px solid #ddd;
    border-bottom: none;
    color: #666;
    cursor: pointer;
    position: relative;
    bottom: -1px;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    background: #e6eff2;
    color: #338090;
}

.tab-btn.active {
    background: #ffffff;
    color: #1a2744;
    border-color: #ddd;
    border-bottom: 1px solid #ffffff;
    box-shadow: 0 -2px 0 #67c2d4;
}

.tab-panels {
    border: 1px solid #ddd;
    border-top: none;
    background: #ffffff;
}

.tab-panel {
    display: none;
    padding: 24px;
    animation: tab-fade-in 0.2s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Notation Block --- */
.notation-block {
    background: #f4f8fa;
    border: 1px solid #d0e4ea;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.notation-line {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid #e8f0f3;
}

.notation-line:last-child {
    border-bottom: none;
}

.notation-label {
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: #338090;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 80px;
}

.notation-code {
    font-family: 'Fira Mono', monospace;
    font-size: 0.875rem;
    color: #1a2744;
    background: transparent;
}

/* --- Type List --- */
.type-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.type-item:last-child {
    border-bottom: none;
}

.type-tag {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    margin-top: 2px;
}

.type-tag.deductive { background: rgba(103, 194, 212, 0.15); color: #338090; border: 1px solid rgba(103, 194, 212, 0.4); }
.type-tag.inductive  { background: rgba(232, 116, 26, 0.12); color: #c06010; border: 1px solid rgba(232, 116, 26, 0.35); }
.type-tag.abductive  { background: rgba(76, 175, 80, 0.1);   color: #2d8a31; border: 1px solid rgba(76, 175, 80, 0.35); }

.type-desc {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

/* --- Fallacy List --- */
.fallacy-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fallacy-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.fallacy-item:last-child {
    border-bottom: none;
}

.fallacy-name {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: #e8741a;
    white-space: nowrap;
    min-width: 180px;
    padding-top: 2px;
}

.fallacy-desc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
}

/* --- Blueprint Panel --- */
.blueprint-panel {
    background: #1a2744;
    border: 1px solid rgba(103, 194, 212, 0.3);
    padding: 0;
    margin: 28px 0;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(103, 194, 212, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 194, 212, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}

.blueprint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(103, 194, 212, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.blueprint-label {
    font-family: 'Fira Mono', monospace;
    font-size: 0.7rem;
    color: #67c2d4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blueprint-ref {
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: rgba(103, 194, 212, 0.4);
    letter-spacing: 0.1em;
}

/* --- Isometric Scene --- */
.iso-scene-wrapper {
    padding: 40px 40px 20px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.iso-scene {
    position: relative;
    width: 420px;
    height: 200px;
    transform: rotateX(60deg) rotateZ(-45deg);
    transform-style: preserve-3d;
}

/* Unit size for isometric grid */
:root {
    --unit: 36px;
}

.iso-block {
    position: absolute;
    transform-style: preserve-3d;
    /* Position on the isometric grid */
    left: calc(var(--ix) * var(--unit));
    top:  calc(var(--iy) * var(--unit));
    transform: translateZ(calc(var(--iz) * var(--unit)));
    width:  calc(var(--w) * var(--unit));
    height: calc(var(--d) * var(--unit));
}

/* Top face */
.iso-face.iso-top {
    position: absolute;
    width:  100%;
    height: 100%;
    top: 0; left: 0;
    transform: translateZ(calc(var(--h) * var(--unit)));
}

/* Left face (front-left) */
.iso-face.iso-left {
    position: absolute;
    width:  100%;
    height: calc(var(--h) * var(--unit));
    bottom: 0; left: 0;
    transform-origin: bottom left;
    transform: rotateX(90deg);
}

/* Right face (front-right) — narrower, side of the block */
.iso-face.iso-right {
    position: absolute;
    width: calc(var(--h) * var(--unit));
    height: 100%;
    top: 0; right: 0;
    transform-origin: top right;
    transform: rotateY(-90deg);
}

/* Premise blocks: teal colors */
.premise-block .iso-top   { background: #67c2d4; }
.premise-block .iso-left  { background: #4da4b3; }
.premise-block .iso-right { background: #338090; }

/* Inference block: orange */
.inference-block .iso-top   { background: rgba(232, 116, 26, 0.8); }
.inference-block .iso-left  { background: rgba(200, 90, 10, 0.8); }
.inference-block .iso-right { background: rgba(160, 70, 8, 0.8); }

/* Conclusion block: confirm green */
.conclusion-block .iso-top   { background: #4caf50; }
.conclusion-block .iso-left  { background: #3d9142; }
.conclusion-block .iso-right { background: #2d7033; }

.iso-label {
    position: absolute;
    transform: translateZ(calc((var(--h) + 0.01) * var(--unit)));
    top: 50%;
    left: 50%;
    transform: translateZ(calc(var(--h) * var(--unit) + 1px)) translate(-50%, -50%);
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.55rem;
    color: #1a2744;
    white-space: nowrap;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
}

/* Blueprint Legend */
.blueprint-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(103, 194, 212, 0.15);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: rgba(103, 194, 212, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    display: block;
}

.premise-swatch    { background: #67c2d4; }
.inference-swatch  { background: #e8741a; }
.conclusion-swatch { background: #4caf50; }

/* --- Technique List --- */
.technique-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.technique-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid #e8edf0;
}

.technique-item:last-child {
    border-bottom: none;
}

.technique-number {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: #338090;
    letter-spacing: 0.08em;
    min-width: 48px;
    padding-top: 4px;
}

.technique-name {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #1a2744;
    margin-bottom: 8px;
}

.technique-desc {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.6;
}

.technique-example {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f4f8fa;
    border: 1px solid #d4e4ea;
    padding: 12px 16px;
    border-left: 3px solid #4da4b3;
}

.technique-example code {
    font-family: 'Fira Mono', monospace;
    font-size: 0.8rem;
    color: #336675;
    display: block;
}

.technique-example .conclusion-code {
    color: #e8741a;
    font-weight: 500;
    margin-top: 4px;
}

/* --- Defense Diagram --- */
.defense-diagram {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.defense-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.defense-core {
    position: absolute;
    z-index: 2;
}

.defense-ring {
    position: absolute;
    width: 100%;
    height: 100%;
}

.defense-node {
    position: absolute;
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 8px 12px;
    border: 1px solid;
    white-space: nowrap;
}

.core-node {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.75rem;
}

.attack-node {
    background: rgba(232, 116, 26, 0.1);
    border-color: rgba(232, 116, 26, 0.4);
    color: rgba(232, 116, 26, 0.8);
}

.attack-1 { top: 12%;  left: 8%; }
.attack-2 { top: 12%;  right: 8%; }
.attack-3 { bottom: 12%; right: 8%; }
.attack-4 { bottom: 12%; left: 8%; }

.defense-responses {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(103, 194, 212, 0.2);
    padding: 0 20px 16px;
}

.response-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(103, 194, 212, 0.1);
}

.response-item:last-child {
    border-bottom: none;
}

.response-tag {
    display: inline-block;
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: #e8741a;
    border: 1px solid rgba(232, 116, 26, 0.3);
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.response-item p {
    font-size: 0.9rem;
    color: rgba(248, 249, 250, 0.7);
    margin: 0;
    line-height: 1.6;
}

/* --- Drill Items --- */
.drill-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drill-number {
    font-family: 'Fira Mono', monospace;
    font-size: 0.7rem;
    color: #338090;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 6px;
}

.drill-prompt p {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 12px;
}

.drill-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 0.95rem;
    font-style: italic;
    color: #333;
    border-left: 3px solid #67c2d4;
    padding: 10px 16px;
    background: rgba(103, 194, 212, 0.05);
    margin: 0;
}

.drill-analysis {
    background: #f9fbfc;
    border: 1px solid #dde9ed;
}

.analysis-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid #edf2f4;
}

.analysis-row:last-child {
    border-bottom: none;
}

.analysis-label {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: #338090;
    min-width: 40px;
    padding-top: 1px;
}

.conclusion-row .analysis-label {
    color: #e8741a;
}

.analysis-content {
    font-family: 'Fira Mono', monospace;
    font-size: 0.8rem;
    color: #334;
    line-height: 1.5;
}

.verdict {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 16px;
    margin: 0;
    border-top: 1px solid transparent;
}

.verdict-valid {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #2d8a31;
}

.verdict-invalid {
    background: rgba(232, 116, 26, 0.08);
    border-color: rgba(232, 116, 26, 0.3);
    color: #c06010;
}

.verdict-sound {
    background: rgba(103, 194, 212, 0.1);
    border-color: rgba(103, 194, 212, 0.3);
    color: #2a7a88;
}

/* --- Deployment Checklist --- */
.deployment-checklist {
    border: 1px solid #dde9ed;
    background: #ffffff;
    overflow: hidden;
    margin-bottom: 32px;
}

.checklist-header {
    background: #1a2744;
    color: #67c2d4;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 10px 20px;
}

.checklist-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f4f6;
    cursor: pointer;
    transition: background 0.15s;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: #f8fcfd;
}

.check-box {
    width: 20px;
    height: 20px;
    border: 2px solid #ccd6da;
    background: #fff;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.checklist-item.checked .check-box {
    border-color: #4caf50;
    background: #4caf50;
}

.checklist-item.checked .check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

.check-content strong {
    display: block;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a2744;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.check-content span {
    font-size: 0.8rem;
    color: #666;
}

.checklist-item.checked .check-content strong {
    color: #4caf50;
    text-decoration: line-through;
    text-decoration-color: rgba(76, 175, 80, 0.4);
}

/* --- Completion State --- */
.completion-state {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(76, 175, 80, 0.06);
    border: 1px solid rgba(76, 175, 80, 0.25);
    padding: 20px 24px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.completion-state.visible {
    opacity: 1;
    transform: translateY(0);
}

.completion-text strong {
    display: block;
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    color: #2d8a31;
    margin-bottom: 4px;
}

.completion-text span {
    font-size: 0.88rem;
    color: #555;
}

/* --- Right Sidebar TOC --- */
.sidebar-toc {
    padding-top: 40px;
    padding-right: 8px;
}

.toc-inner {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
}

.toc-inner::-webkit-scrollbar {
    display: none;
}

.toc-header {
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: #338090;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 10px;
    border-bottom: 1px solid #dde9ed;
    margin-bottom: 10px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.toc-item:hover {
    background: rgba(103, 194, 212, 0.06);
    border-left-color: rgba(103, 194, 212, 0.4);
}

.toc-item.active {
    border-left-color: #e8741a;
    background: rgba(232, 116, 26, 0.05);
}

.toc-num {
    font-family: 'Fira Mono', monospace;
    font-size: 0.65rem;
    color: #338090;
    min-width: 20px;
}

.toc-item.active .toc-num {
    color: #e8741a;
}

.toc-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.toc-item.active .toc-title {
    color: #1a2744;
}

.toc-progress-bar {
    margin-top: 16px;
    height: 3px;
    background: rgba(103, 194, 212, 0.15);
    border-radius: 0;
    overflow: hidden;
}

.toc-progress-fill {
    height: 100%;
    width: 0%;
    background: #67c2d4;
    transition: width 0.15s ease-out;
}

/* --- Site Footer --- */
.site-footer {
    background: #1a2744;
    border-top: 2px solid rgba(103, 194, 212, 0.25);
    padding: 40px 0;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.footer-logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.footer-jp {
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: #67c2d4;
}

.footer-net {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: rgba(103, 194, 212, 0.5);
}

.footer-tagline {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    flex: 1;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    color: rgba(103, 194, 212, 0.7);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #67c2d4;
}

.footer-sep {
    color: rgba(255, 255, 255, 0.2);
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f4f6;
}

::-webkit-scrollbar-thumb {
    background: rgba(103, 194, 212, 0.3);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(103, 194, 212, 0.6);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .progress-line-fill {
        transition: none;
    }
    .toc-progress-fill {
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* --- Responsive: hide sidebar on narrow screens --- */
@media (max-width: 900px) {
    .page-wrapper {
        grid-template-columns: 48px 1fr;
    }

    .sidebar-toc {
        display: none;
    }

    .main-content {
        padding: 32px 24px 60px 20px;
    }
}

@media (max-width: 640px) {
    .page-wrapper {
        grid-template-columns: 1fr;
    }

    .progress-track {
        display: none;
    }

    .main-content {
        padding: 24px 16px 60px;
    }

    .iso-scene-wrapper {
        padding: 20px;
        overflow-x: auto;
    }

    .concept-grid {
        grid-template-columns: 1fr 1fr;
    }

    .technique-item {
        flex-direction: column;
        gap: 8px;
    }

    .fallacy-item {
        flex-direction: column;
        gap: 4px;
    }

    .defense-diagram {
        height: 200px;
    }

    .attack-1 { font-size: 0.55rem; }
    .attack-2 { font-size: 0.55rem; }
    .attack-3 { font-size: 0.55rem; }
    .attack-4 { font-size: 0.55rem; }
}
