/* ============================================
   PapiAI Documentation
   Aesthetic: Refined editorial — dark chrome
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --ruby: #c62828;
    --ruby-deep: #8e0000;
    --ruby-glow: #ef5350;
    --ruby-muted: #d32f2f;
    --black: #0f0f0f;
    --black-warm: #171414;
    --black-soft: #1e1a1a;
    --black-code: #1a1520;
    --surface: #faf9f7;
    --surface-raised: #ffffff;
    --border: #e8e4df;
    --border-light: #f0ece8;
    --text: #2c2420;
    --text-secondary: #6b6058;
    --text-dim: #9c9088;
    --sidebar-width: 272px;
    --topbar-height: 52px;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--topbar-height) + 32px);
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--ruby);
    color: white;
}

/* ── Top Bar ── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--black);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 1000;
    border-bottom: 1px solid rgba(198, 40, 40, 0.4);
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--ruby-glow) 20%,
        var(--ruby) 50%,
        var(--ruby-glow) 80%,
        transparent 100%
    );
    opacity: 0.6;
}

.topbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-logo span {
    background: linear-gradient(135deg, #fff 0%, #ffcdd2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.topbar-link {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s var(--ease-out);
    letter-spacing: 0.01em;
}

.topbar-link:hover {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.06);
}

.topbar-link.active {
    color: white;
}

.topbar-dropdown { position: relative; }

.topbar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--black-soft);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 6px;
    min-width: 150px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
}

/* Invisible bridge to keep hover alive across the gap */
.topbar-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px; left: 0; right: 0;
    height: 10px;
}

.topbar-dropdown:hover .topbar-dropdown-menu { display: block; }

.topbar-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.15s;
}

.topbar-dropdown-menu a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.caret { font-size: 9px; margin-left: 3px; opacity: 0.6; }

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 12px;
}

/* ── Layout ── */
.layout {
    display: flex;
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--black-warm);
    overflow-y: auto;
    padding: 0 0 24px;
    z-index: 900;
}

/* Subtle noise texture overlay */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}

.sidebar-logo {
    padding: 20px 16px 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 2;
}

.sidebar-logo-img {
    display: block;
    width: 100%;
    height: auto;
    filter: brightness(1.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    position: relative;
    z-index: 2;
}

.sidebar-section {
    margin-bottom: 2px;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 20px;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.2s var(--ease-out);
    user-select: none;
}

.sidebar-heading:hover {
    color: rgba(255,255,255,0.7);
}

.sidebar-heading .arrow {
    font-size: 8px;
    transition: transform 0.25s var(--ease-out);
    opacity: 0.5;
}

.sidebar-heading.open .arrow {
    transform: rotate(90deg);
}

.sidebar-submenu {
    display: none;
    overflow: hidden;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-link {
    display: block;
    padding: 7px 20px 7px 24px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    transition: all 0.2s var(--ease-out);
    border-left: 2px solid transparent;
    position: relative;
}

.sidebar-link:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.03);
}

.sidebar-link.active {
    color: white;
    background: rgba(198, 40, 40, 0.15);
    border-left-color: var(--ruby-glow);
    font-weight: 500;
}

/* Top-level sidebar links */
.sidebar-section > .sidebar-link {
    padding-left: 20px;
    font-weight: 500;
    font-size: 18px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.01em;
}

.sidebar-section > .sidebar-link:hover { color: rgba(255,255,255,0.9); }
.sidebar-section > .sidebar-link.active {
    color: white;
    border-left-color: var(--ruby-glow);
    background: rgba(198, 40, 40, 0.15);
}

/* ── Main Content ── */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 840px;
    padding: 48px 56px 96px;
}

.doc-section {
    padding-bottom: 56px;
    margin-bottom: 56px;
    border-bottom: 1px solid var(--border-light);
}

.doc-section:last-child { border-bottom: none; }

/* ── Typography ── */
h1 {
    font-size: 40px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 8px;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.tagline {
    font-size: 19px;
    color: var(--ruby-muted);
    font-weight: 400;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    line-height: 1.2;
    position: relative;
    padding-bottom: 12px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 32px; height: 2px;
    background: var(--ruby);
    border-radius: 1px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-top: 36px;
    margin-bottom: 12px;
    letter-spacing: -0.015em;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.75;
}

a {
    color: var(--ruby);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--ruby-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

ul, ol {
    margin-bottom: 16px;
    padding-left: 20px;
}

li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

li code {
    font-weight: 500;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(198, 40, 40, 0.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--ruby-deep);
    border: 1px solid rgba(198, 40, 40, 0.08);
}

/* ── Code Blocks ── */
pre {
    margin-bottom: 24px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.06),
        0 4px 12px rgba(0,0,0,0.04);
}

pre::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(198, 40, 40, 0.2),
        transparent
    );
    z-index: 1;
}

pre code {
    display: block;
    padding: 22px 26px;
    font-size: 13px;
    line-height: 1.65;
    background: var(--black-code);
    color: #d4d0cc;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    font-weight: 400;
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

thead th {
    text-align: left;
    padding: 10px 18px;
    background: var(--surface);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 9px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: rgba(198, 40, 40, 0.02);
}

/* Capability checkmarks */
td:last-child {
    color: var(--ruby);
    font-weight: 600;
    font-size: 15px;
}

/* ── Feature Grid ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.feature-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 20px;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ruby), var(--ruby-glow));
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.feature-card:hover {
    border-color: rgba(198, 40, 40, 0.2);
    box-shadow: 0 4px 20px rgba(198, 40, 40, 0.06);
    transform: translateY(-2px);
}

.feature-card:hover::before { opacity: 1; }

.feature-card {
    opacity: 0;
    transform: translateY(12px);
}

.feature-card.revealed {
    animation: cardReveal 0.45s var(--ease-out) both;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card h3 {
    font-size: 15px;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--black);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 0;
    line-height: 1.6;
}

/* ── Notes ── */
.note {
    font-size: 13.5px;
    color: var(--text-dim);
    font-style: normal;
    padding: 12px 16px;
    border-left: 2px solid var(--ruby-muted);
    margin-top: 16px;
    background: rgba(198, 40, 40, 0.03);
    border-radius: 0 6px 6px 0;
    line-height: 1.6;
}

/* ── Footer ── */
.footer {
    margin-left: var(--sidebar-width);
    background: var(--black);
    color: rgba(255,255,255,0.4);
    padding: 48px 56px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(198, 40, 40, 0.3),
        transparent
    );
}

.footer-content {
    display: flex;
    gap: 72px;
    max-width: 840px;
}

.footer-col h4 {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-col p,
.footer-col a {
    font-size: 13.5px;
    color: rgba(255,255,255,0.35);
    display: block;
    margin-bottom: 6px;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.copyright {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.2);
}

/* ── Scroll-reveal animation ── */
.doc-section {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Book Cover in About Section
   ============================================ */

.book-cover-link {
    display: block;
    float: right;
    margin: 0 0 20px 32px;
}

.book-cover-link:hover {
    text-decoration: none;
}

.book-cover-about {
    width: 200px;
    height: auto;
    border-radius: 6px;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.12),
        0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.3s var(--ease-out);
}

.book-cover-about:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 28px rgba(0,0,0,0.16),
        0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   Book Page
   ============================================ */

.book-page {
    max-width: 960px;
    margin: 0 auto;
    padding: calc(var(--topbar-height) + 72px) 32px 96px;
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.book-hero {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    margin-bottom: 72px;
}

.book-hero-cover {
    flex-shrink: 0;
}

.book-hero-cover img {
    width: 280px;
    height: auto;
    border-radius: 8px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.15),
        0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s var(--ease-out);
}

.book-hero-cover img:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.2),
        0 4px 12px rgba(0,0,0,0.12);
}

.book-hero-text h1 {
    font-size: 36px;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.book-hero-text .tagline {
    font-size: 18px;
    margin-bottom: 28px;
}

.book-hero-text p {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.book-cta {
    display: inline-block;
    padding: 14px 36px;
    background: var(--ruby);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: all 0.2s var(--ease-out);
    margin-top: 12px;
}

.book-cta:hover {
    background: var(--ruby-deep);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.3);
}

.book-details h2 {
    font-size: 26px;
    margin-bottom: 24px;
}

.book-details > p {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 720px;
}

.book-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    margin-bottom: 56px;
}

.book-topic {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 22px;
    transition: all 0.3s var(--ease-out);
}

.book-topic:hover {
    border-color: rgba(198, 40, 40, 0.2);
    box-shadow: 0 4px 20px rgba(198, 40, 40, 0.06);
    transform: translateY(-2px);
}

.book-topic h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--black);
}

.book-topic p {
    font-size: 14.5px;
    color: var(--text-dim);
    margin-bottom: 0;
    line-height: 1.65;
}

.book-cta-footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   Blog — Editorial layout
   ============================================ */

/* ── Blog Index ── */
.blog-index {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--topbar-height) + 72px) 32px 96px;
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.blog-index > h1 {
    font-size: 48px;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.blog-index > .tagline {
    font-size: 18px;
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-weight: 400;
}

/* ── Blog Card List ── */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-card {
    padding: 36px 0;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    opacity: 0;
    transform: translateY(12px);
    animation: blogCardIn 0.5s var(--ease-out) both;
}

.blog-card:first-child { padding-top: 0; }
.blog-card:last-child { border-bottom: none; }

.blog-card:nth-child(1) { animation-delay: 0s; }
.blog-card:nth-child(2) { animation-delay: 0.08s; }
.blog-card:nth-child(3) { animation-delay: 0.16s; }
.blog-card:nth-child(4) { animation-delay: 0.24s; }
.blog-card:nth-child(5) { animation-delay: 0.32s; }
.blog-card:nth-child(6) { animation-delay: 0.4s; }

@keyframes blogCardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Meta: date + tag */
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.blog-card-meta time {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.blog-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(198, 40, 40, 0.07);
    color: var(--ruby);
    border: 1px solid rgba(198, 40, 40, 0.12);
}

/* Card title */
.blog-card h2 {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.blog-card h2::after {
    display: none;
}

.blog-card h2 a {
    color: var(--black);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}

.blog-card h2 a:hover {
    color: var(--ruby);
    text-decoration: none;
}

/* Card excerpt */
.blog-card > p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Read more link */
.blog-read-more {
    display: inline-flex;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ruby);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: all 0.2s var(--ease-out);
}

.blog-read-more:hover {
    color: var(--ruby-deep);
    text-decoration: none;
    transform: translateX(3px);
}

/* ── Blog Post (single article) ── */
.blog-post {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--topbar-height) + 48px) 32px 96px;
    animation: fadeInUp 0.5s var(--ease-out) both;
}

/* Post meta bar: back link + date */
.blog-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.blog-post-meta a {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
}

.blog-post-meta a:hover {
    color: var(--ruby);
    text-decoration: none;
}

.blog-post-meta time {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* Post title */
.blog-post > h1 {
    font-size: 38px;
    line-height: 1.18;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}

.blog-post > .tagline {
    font-size: 18px;
    margin-bottom: 40px;
    color: var(--text-dim);
    font-weight: 400;
    line-height: 1.5;
}

/* Post body headings — override the h2::after to be more subtle in long-form */
.blog-post h2 {
    margin-top: 48px;
    font-size: 24px;
}

.blog-post h3 {
    margin-top: 32px;
    font-size: 17px;
}

/* Post body paragraphs — slightly larger for readability */
.blog-post > p,
.blog-post > ol,
.blog-post > ul {
    font-size: 18px;
    line-height: 1.8;
}

/* Post footer / CTA */
.blog-post-footer {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    position: relative;
}

.blog-post-footer::before {
    content: '';
    position: absolute;
    top: -1px; left: 0;
    width: 48px; height: 2px;
    background: var(--ruby);
    border-radius: 1px;
}

.blog-post-footer p {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.7;
}

/* Tables inside blog posts — reset last-child color override */
.blog-post table td:last-child {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .hamburger { display: block; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease-out);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.3);
    }

    .content {
        margin-left: 0;
        padding: 32px 24px 64px;
    }

    .footer {
        margin-left: 0;
        padding: 32px 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 28px;
    }

    .blog-index { padding-left: 24px; padding-right: 24px; }
    .blog-post { padding-left: 24px; padding-right: 24px; }
    .book-page { padding-left: 24px; padding-right: 24px; }
    .book-hero { gap: 32px; }
    .book-hero-cover img { width: 220px; }
}

@media (max-width: 600px) {
    h1 { font-size: 30px; }
    h2 { font-size: 22px; }
    h3 { font-size: 17px; }

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

    pre code {
        font-size: 12px;
        padding: 16px 18px;
    }

    .content {
        padding: 24px 18px 48px;
    }

    .blog-index > h1 { font-size: 34px; }
    .blog-index > .tagline { margin-bottom: 32px; padding-bottom: 28px; }
    .blog-index { padding-left: 18px; padding-right: 18px; }

    .blog-post > h1 { font-size: 28px; }
    .blog-post { padding-left: 18px; padding-right: 18px; }
    .blog-post h2 { font-size: 21px; }

    .blog-card { padding: 28px 0; }
    .blog-card h2 { font-size: 20px; }

    .blog-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .book-cover-link {
        float: none;
        margin: 0 0 20px 0;
        text-align: center;
    }
    .book-cover-about { width: 160px; }

    .book-page { padding-left: 18px; padding-right: 18px; }
    .book-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }
    .book-hero-cover img { width: 200px; }
    .book-hero-text h1 { font-size: 28px; }
    .book-topics { grid-template-columns: 1fr; }
}
