/* ==========================================================================
   Inside Laravel (বাংলা) — shared styles
   ========================================================================== */

:root {
    --red: #ff2d20;
    --red-dark: #e02216;
    --red-soft: rgba(255, 45, 32, 0.1);
    --bg-1: #0b1120;
    --bg-2: #1f2937;
    --ink: #1f2937;
    --ink-strong: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --paper: #ffffff;
    --paper-2: #f9fafb;
    --green: #059669;
    --amber: #d97706;
    --blue: #2563eb;
    --radius: 16px;
    --font: 'Hind Siliguri', 'Inter', system-ui, sans-serif;
    --font-en: 'Inter', 'Hind Siliguri', system-ui, sans-serif;
    --mono: 'Fira Code', ui-monospace, monospace;
    --content-fs: 1.0625rem;
}

html[data-fs="sm"] { --content-fs: 0.95rem; }
html[data-fs="lg"] { --content-fs: 1.2rem; }

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
    color: #f3f4f6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--red); }
a:hover { color: var(--red-dark); }

:focus-visible { outline: 3px solid rgba(255, 45, 32, 0.55); outline-offset: 2px; }

/* ==========================================================================
   Deck layout (chapter pages)
   ========================================================================== */

body.deck-page { height: 100vh; height: 100dvh; overflow: hidden; }

.deck {
    height: 100vh;
    height: 100dvh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
}

.deck-header { display: flex; align-items: center; gap: 10px; min-width: 0; }

.deck-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.deck-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

.deck-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.deck-chapter { color: var(--red); font-weight: 700; font-size: 0.85rem; }
.deck-name {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-progress { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.deck-progress-bar { height: 100%; width: 0; background: var(--red); transition: width .4s ease; }

.slides {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    min-height: 0;
    touch-action: pan-y;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(60px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity .45s ease, transform .45s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .45s;
}
.slide.prev { transform: translateX(-60px); }
.slide.active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
    transition: opacity .45s ease, transform .45s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .slide, .slide.active { transition: none; transform: none; }
}

.slide-content {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    color: var(--ink);
    padding: clamp(20px, 4vw, 48px);
    font-size: var(--content-fs);
    line-height: 1.75;
}
.slide-content > :last-child { margin-bottom: 0; }

.slide-content::-webkit-scrollbar { width: 8px; }
.slide-content::-webkit-scrollbar-track { background: #f1f1f1; }
.slide-content::-webkit-scrollbar-thumb { background: var(--red); border-radius: 4px; }

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

.nav-btn {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--red);
    color: #fff;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 45, 32, 0.35);
    transition: transform .2s, background .2s;
}
.nav-btn:hover:not(:disabled) { background: var(--red-dark); transform: translateY(-2px); }
.nav-btn:disabled { background: #4b5563; box-shadow: none; cursor: not-allowed; }

.deck-counter { flex: 1; min-width: 0; text-align: center; line-height: 1.3; }
.deck-counter strong { font-size: 1.05rem; }
.deck-counter small {
    display: block;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swipe-hint { color: #6b7280; font-size: 0.8rem; display: none; }

/* TOC drawer */
.toc.offcanvas { background: #111827; color: #f3f4f6; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.toc h6 { color: #9ca3af; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; margin: 20px 0 8px; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list button, .toc-list a {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: baseline;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.98rem;
}
.toc-list button:hover, .toc-list a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.toc-list .is-current { background: var(--red-soft); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.toc-list .num { color: var(--red); font-weight: 700; min-width: 1.6em; }
.toc-list .done { margin-left: auto; color: var(--green); }

/* ==========================================================================
   Slide components
   ========================================================================== */

.slide-title {
    color: var(--red);
    font-weight: 700;
    font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.3rem);
    line-height: 1.3;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 3px solid rgba(255, 45, 32, 0.18);
    display: flex;
    align-items: center;
    gap: 14px;
}
.slide-title i { font-size: .85em; flex: none; }

.slide-content h3 { font-size: 1.3rem; font-weight: 700; color: var(--ink-strong); margin: 28px 0 12px; }
.slide-content h4 { font-size: 1.12rem; font-weight: 700; color: var(--ink-strong); margin-bottom: 10px; }
.slide-content p { margin-bottom: 1rem; }
.slide-content ul, .slide-content ol { padding-left: 1.3rem; }
.slide-content li { margin-bottom: .45rem; }
.slide-content .lead { font-size: 1.15em; color: #374151; }
.muted { color: var(--muted); }
.en { font-family: var(--font-en); }

.slide-content :not(pre) > code {
    font-family: var(--mono);
    font-size: .86em;
    background: #fef2f2;
    color: #b91c1c;
    padding: .12em .4em;
    border-radius: 5px;
    word-break: break-word;
}

/* Cover */
.cover {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
}
.cover-icon {
    width: clamp(96px, 18vw, 150px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--red-soft);
    color: var(--red);
    display: grid;
    place-items: center;
    font-size: clamp(42px, 8vw, 72px);
    margin-bottom: 16px;
}
.cover-kicker { font-size: clamp(1.6rem, 1.2rem + 2vw, 3rem); font-weight: 700; color: var(--ink-strong); margin: 0; }
.cover-title {
    font-family: var(--font-en);
    font-size: clamp(1.4rem, 1rem + 2vw, 2.6rem);
    font-weight: 800;
    color: var(--red);
    margin: 0;
}
.cover-quote { font-family: var(--font-en); font-style: italic; color: var(--muted); margin: 14px 0 0; max-width: 720px; }
.cover-desc { color: #4b5563; font-size: 1.1em; max-width: 760px; margin: 10px 0 0; }
.cover-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.cover-meta span { background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: .9rem; color: #4b5563; }
.btn-start {
    margin-top: 28px;
    background: var(--red);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 14px 36px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(255, 45, 32, 0.3);
}
.btn-start:hover { background: var(--red-dark); color: #fff; }

/* Story / scenario */
.scenario {
    position: relative;
    background: linear-gradient(135deg, #fff7ed, #fef2f2);
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 22px 24px 22px 64px;
    margin-bottom: 24px;
}
.scenario::before {
    content: "\f518";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 22px;
    top: 22px;
    color: var(--amber);
    font-size: 1.4rem;
}
.scenario p:last-child { margin-bottom: 0; }

/* Concept card (left accent) */
.concept-card {
    background: var(--paper-2);
    border-left: 5px solid var(--red);
    padding: 20px 22px;
    margin-bottom: 20px;
    border-radius: 10px;
}
.concept-card h4 { display: flex; align-items: center; gap: 10px; }
.concept-card > :last-child { margin-bottom: 0; }

/* Callouts */
.callout {
    display: flex;
    gap: 14px;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 18px 0;
    border: 1px solid;
}
.callout > i { font-size: 1.2rem; margin-top: .3em; flex: none; }
.callout > div > :last-child { margin-bottom: 0; }
.callout-tip { background: #ecfdf5; border-color: #a7f3d0; }
.callout-tip > i { color: var(--green); }
.callout-warn { background: #fffbeb; border-color: #fde68a; }
.callout-warn > i { color: var(--amber); }
.callout-info { background: #eff6ff; border-color: #bfdbfe; }
.callout-info > i { color: var(--blue); }
.callout-danger { background: #fef2f2; border-color: #fecaca; }
.callout-danger > i { color: var(--red); }

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 16px;
    margin: 18px 0;
}
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.mini-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.mini-card > i.ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--red-soft);
    color: var(--red);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    margin-bottom: 12px;
}
.mini-card h4 { font-size: 1.05rem; }
.mini-card p { color: #4b5563; font-size: .95em; margin-bottom: 0; }
.mini-card.good { border-top: 4px solid var(--green); }
.mini-card.bad { border-top: 4px solid var(--red); }

/* Steps (numbered flow) */
.steps { list-style: none; padding: 0 !important; counter-reset: step; margin: 18px 0; }
.steps li {
    counter-increment: step;
    position: relative;
    padding: 4px 0 14px 52px;
    margin: 0;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
    font-family: var(--font-en);
}
.steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 2px;
    width: 2px;
    background: #fecaca;
}

/* Horizontal flow diagram */
.flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 18px;
    background: var(--paper-2);
    border-radius: 14px;
    border: 1px dashed #d1d5db;
}
.flow-node {
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: .95em;
    text-align: center;
}
.flow-node.primary { border-color: var(--red); color: var(--red); }
.flow-node.ok { border-color: var(--green); color: var(--green); }
.flow-node.dark { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.flow-arrow { color: #9ca3af; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; border-collapse: collapse; min-width: 520px; font-size: .95em; }
.cmp th, .cmp td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.cmp th { background: var(--ink-strong); color: #fff; font-weight: 600; white-space: nowrap; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp tbody tr:nth-child(even) td { background: var(--paper-2); }
.cmp .yes { color: var(--green); font-weight: 700; }
.cmp .no { color: var(--red); font-weight: 700; }

/* Code */
.code-block { position: relative; margin: 14px 0 18px; }
.code-label {
    display: inline-block;
    font-family: var(--mono);
    font-size: .78rem;
    color: #d1d5db;
    background: #3f3f46;
    padding: 3px 12px;
    border-radius: 8px 8px 0 0;
}
.code-label + pre { border-top-left-radius: 0 !important; margin-top: 0 !important; }
.slide-content pre[class*="language-"] {
    font-family: var(--mono) !important;
    font-size: .88rem;
    line-height: 1.6;
    background: #2d2d2d !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.slide-content pre code { font-family: inherit !important; white-space: pre; }
.slide-content pre, .slide-content code { font-variant-ligatures: none; }
.token { background: none !important; }
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    border: 0;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: .78rem;
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
    opacity: .75;
}
.code-label ~ .copy-btn { top: 34px; }
.copy-btn:hover, .copy-btn:focus-visible { opacity: 1; background: var(--red); color: #fff; }

/* Doc reference */
.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-family: var(--font-en);
    text-decoration: none;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px;
    margin: 4px 0 8px;
    color: #374151;
    word-break: break-all;
}
.ref-link:hover { border-color: var(--red); color: var(--red); }

/* Tags / chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.chips li, .chip {
    margin: 0;
    font-family: var(--mono);
    font-size: .82rem;
    background: var(--red-soft);
    color: #b91c1c;
    border-radius: 999px;
    padding: 3px 12px;
}

/* Takeaways */
.takeaways { list-style: none; padding: 0 !important; }
.takeaways li { position: relative; padding-left: 34px; margin-bottom: 12px; }
.takeaways li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: .15em;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #d1fae5;
    color: var(--green);
    font-size: .75rem;
    display: grid;
    place-items: center;
}

/* Quiz */
.quiz details {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    background: var(--paper-2);
}
.quiz summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; }
.quiz summary::-webkit-details-marker { display: none; }
.quiz summary::before { content: "\f059"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--blue); }
.quiz details[open] summary { margin-bottom: 10px; }
.quiz details[open] { background: #eff6ff; border-color: #bfdbfe; }
.quiz details p:last-child { margin-bottom: 0; }

/* End-of-chapter navigation (inserted by JS) */
.chapter-end {
    margin-top: 32px;
    padding: 24px;
    border-radius: 14px;
    background: var(--ink-strong);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.chapter-end p { margin: 0; color: #d1d5db; }
.chapter-end strong { color: #fff; font-family: var(--font-en); }
.chapter-end .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.chapter-end a {
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.chapter-end a.primary { background: var(--red); }
.chapter-end a:hover { background: var(--red-dark); color: #fff; }

/* ==========================================================================
   Home page
   ========================================================================== */

body.home-page { min-height: 100vh; padding: 48px 0 32px; }

.home-page .container { padding-left: 16px; padding-right: 16px; }

.hero { text-align: center; margin-bottom: 56px; }
.hero .logo { font-size: 64px; color: var(--red); margin-bottom: 16px; }
.hero h1 { font-family: var(--font-en); color: var(--red); font-weight: 800; font-size: clamp(2.3rem, 1.5rem + 4vw, 4rem); margin-bottom: 8px; }
.hero .tagline { font-family: var(--font-en); color: #d1d5db; font-size: clamp(1rem, .9rem + .6vw, 1.3rem); margin-bottom: 6px; }
.hero .bn-tagline { color: #9ca3af; font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 12px 28px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.btn-pill.primary { background: var(--red); border-color: var(--red); box-shadow: 0 10px 25px rgba(255, 45, 32, 0.3); }
.btn-pill:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }

.overall {
    max-width: 520px;
    margin: 28px auto 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    text-align: left;
}
.overall-row { display: flex; justify-content: space-between; font-size: .95rem; color: #d1d5db; margin-bottom: 8px; }
.bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--red); border-radius: 4px; transition: width .6s ease; }

.section-head { display: flex; align-items: center; gap: 12px; margin: 64px 0 24px; }
.section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; margin: 0; }
.section-head i { color: var(--red); font-size: 1.4rem; }
.section-head::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.1); }

.glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 24px;
    height: 100%;
}
.glass h3 { font-size: 1.15rem; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.glass h3 i { color: var(--red); }
.glass p, .glass li { color: #cbd5e1; }
.glass ul { padding-left: 1.2rem; margin-bottom: 0; }
.glass li { margin-bottom: 4px; }

.chapter-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 26px;
    height: 100%;
    transition: transform .3s, background .3s, border-color .3s, box-shadow .3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.chapter-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--red);
    box-shadow: 0 15px 30px rgba(255, 45, 32, 0.18);
    color: inherit;
}
.chapter-number {
    position: absolute;
    top: -18px;
    right: -6px;
    font-family: var(--font-en);
    font-size: 96px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
    transition: color .3s;
}
.chapter-card:hover .chapter-number { color: rgba(255, 45, 32, 0.12); }
.icon-box {
    width: 56px;
    height: 56px;
    background: var(--red-soft);
    color: var(--red);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 22px;
    margin-bottom: 18px;
    transition: background .3s, color .3s;
}
.chapter-card:hover .icon-box { background: var(--red); color: #fff; }
.chapter-label { color: var(--red); font-size: .85rem; font-weight: 700; }
.chapter-title { font-family: var(--font-en); font-size: 1.2rem; font-weight: 700; margin: 2px 0 8px; color: #fff; }
.chapter-desc { color: #9ca3af; font-size: .98rem; line-height: 1.6; flex-grow: 1; }
.chapter-card .chips li { background: rgba(255, 255, 255, 0.07); color: #e5e7eb; font-size: .75rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: .9rem; }
.card-foot .go { color: var(--red); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chapter-card:hover .card-foot .go { color: #fff; }
.status { color: #9ca3af; font-size: .82rem; }
.status.done { color: #34d399; }
.status.reading { color: #fbbf24; }
.chapter-card .bar { margin-top: 12px; height: 4px; }

.map-table { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.1); }
.map-table .cmp { min-width: 680px; color: #e5e7eb; }
.map-table .cmp th { background: rgba(255, 45, 32, 0.15); color: #fff; }
.map-table .cmp td { border-color: rgba(255, 255, 255, 0.08); }
.map-table .cmp tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.map-table .cmp a { color: #fff; font-weight: 600; text-decoration: none; }
.map-table .cmp a:hover { color: var(--red); }
.map-table code { font-family: var(--mono); font-size: .82rem; color: #fca5a5; }

.author { display: flex; gap: 16px; }
.author .avatar {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-family: var(--font-en);
}
.author h3 { margin-bottom: 4px; }
.author .handle { color: #9ca3af; font-size: .9rem; font-family: var(--font-en); }

.site-footer { text-align: center; color: #6b7280; font-size: .92rem; margin-top: 64px; }
.site-footer a, .site-footer .btn-link { color: #9ca3af; }
.site-footer .btn-link:hover { color: var(--red); }
.home-page kbd { background: #374151; color: #f3f4f6; font-family: var(--mono); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet */
@media (max-width: 991.98px) {
    .deck { padding: 12px 14px; gap: 10px; }
    .slide-content pre[class*="language-"] { font-size: .84rem; }
}

/* Phone */
@media (max-width: 575.98px) {
    .deck { padding: 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 8px; }
    .deck-btn { padding: 0; width: 44px; }
    .deck-name { font-size: .95rem; }
    .slides { border-radius: 12px; }
    .slide-content { padding: 20px 16px 28px; line-height: 1.7; }
    .slide-title { gap: 10px; margin-bottom: 18px; }
    .nav-btn { width: 48px; height: 48px; }
    .swipe-hint { display: block; }
    .scenario { padding: 18px 16px 16px; }
    .scenario::before { position: static; display: block; margin-bottom: 8px; }
    .slide-content pre[class*="language-"] { font-size: .8rem; padding: 14px !important; }
    .callout { padding: 14px; gap: 10px; }
    .concept-card { padding: 16px; }
    .steps li { padding-left: 46px; }
    .flow { flex-direction: column; }
    .flow-arrow { transform: rotate(90deg); }
    .chapter-end { padding: 18px; }
    .copy-btn span { display: none; }
    .copy-btn { padding: 4px 8px; }
    .chapter-end .btns, .chapter-end a { width: 100%; text-align: center; }

    body.home-page { padding-top: 32px; }
    .chapter-card { padding: 20px; }
    .chapter-number { font-size: 64px; top: -8px; }
    .glass { padding: 18px; }
    .section-head { margin-top: 48px; }
}

/* Short landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
    .deck { grid-template-rows: auto auto 1fr auto; padding-top: 6px; padding-bottom: 6px; gap: 6px; }
    .deck-btn { height: 36px; min-width: 36px; }
    .nav-btn { width: 40px; height: 40px; }
    .deck-counter small { display: none; }
}
