/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Extracted from the architectural atrium image */
    --steel:        #2f7fc1;   /* steel beam blue */
    --sky:          #0ea5e9;   /* bright sky through glass */
    --cyan:         #06b6d4;   /* teal glass glow */
    --cyan-dim:     #0891b2;
    --indigo:       #1e3a5f;   /* deep shadow between beams */

    /* Packt orange — used ONLY for publisher branding */
    --packt:        #e8521a;

    /* Backgrounds — deep navy derived from the image's dark zones */
    --bg:           #05080f;
    --bg-surface:   #080d1a;
    --bg-card:      #0b1120;
    --bg-elevated:  #0f1829;

    /* Text */
    --text:         #dde6f0;
    --text-muted:   #4d6480;
    --text-dim:     #2a3d54;

    /* Borders */
    --border:       #111e30;
    --border-mid:   #1a2e48;
    --border-hi:    #235080;

    /* Grid line used in background texture */
    --grid:         rgba(30, 58, 95, 0.25);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* Subtle engineering grid texture */
.grid-bg {
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 48px; }

/* ── Navigation ────────────────────────────────────────────────────────────── */
.navbar {
    background: rgba(5, 8, 15, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
}

.nav-brand span { color: var(--sky); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(14, 165, 233, 0.06);
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: 88px 24px 72px;
    text-align: center;
    overflow: hidden;
    background: var(--bg);
}

/* Map background — 4-panel satellite/light/dark/topo composition */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../assets/map-bg.svg') center/cover no-repeat;
    opacity: 0.22;
    pointer-events: none;
}

/* Radial glow + engineering grid overlay */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 55% at 50% -5%, rgba(6, 182, 212, 0.1) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 20% 100%, rgba(14, 165, 233, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 80% 100%, rgba(47, 127, 193, 0.06) 0%, transparent 50%),
        linear-gradient(rgba(30, 58, 95, 0.14) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgba(30, 58, 95, 0.14) 1px, transparent 1px) 0 0 / 48px 48px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 20%, transparent 80%);
}

.hero-content { position: relative; z-index: 1; }

.publisher-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(232, 82, 26, 0.1);
    border: 1px solid rgba(232, 82, 26, 0.3);
    color: #f4845e;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    margin-bottom: 2rem;
    font-family: 'Courier New', monospace;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #f0f6fc;
    margin-bottom: 1rem;
}

.hero-content h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--sky) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-authors {
    margin-top: 3rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.hero-authors strong { color: var(--text-muted); }
.hero-author-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border-mid);
    transition: color 0.2s, border-color 0.2s;
}
.hero-author-link:hover { color: var(--sky); border-color: var(--sky); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s;
    border: 1px solid transparent;
    cursor: pointer;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn-primary {
    background: var(--sky);
    color: #030810;
    border-color: var(--sky);
}

.btn-primary:hover {
    background: #38bdf8;
    border-color: #38bdf8;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-mid);
}

.btn-secondary:hover {
    border-color: var(--sky);
    color: var(--sky);
    background: rgba(14, 165, 233, 0.06);
}

.btn-small { padding: 0.4rem 0.9rem; font-size: 0.78rem; }

/* ── Sections ──────────────────────────────────────────────────────────────── */
.section { padding: 72px 24px; }

.section-label {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.6rem;
    text-align: center;
}

.section h2 {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #f0f6fc;
    text-align: center;
    margin-bottom: 0;
}

.section-intro {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0.75rem auto 3rem;
    line-height: 1.75;
}

.bg-surface { background: var(--bg-surface); }

/* Subtle map echo on surface sections */
#data.bg-surface {
    background-image: url('../assets/map-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

#data.bg-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-surface);
    opacity: 0.92;
    pointer-events: none;
    z-index: 0;
}

#data.bg-surface > .container {
    position: relative;
    z-index: 1;
}

/* ── Section divider ───────────────────────────────────────────────────────── */
.section-divider { height: 1px; background: var(--border); }

/* ── Book section ──────────────────────────────────────────────────────────── */
.book-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 4rem;
    align-items: start;
    margin-top: 3rem;
}

.book-cover img {
    width: 220px;
    border-radius: 2px;
    box-shadow:
        0 0 0 1px var(--border-mid),
        0 24px 48px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(6, 182, 212, 0.06);
}

.book-cover-placeholder {
    width: 220px;
    height: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.book-edition {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f4845e;
    background: rgba(232, 82, 26, 0.1);
    border: 1px solid rgba(232, 82, 26, 0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.book-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.book-topics {
    list-style: none;
    border-top: 1px solid var(--border);
}

.book-topics li {
    padding: 0.6rem 0 0.6rem 1.25rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.book-topics li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--steel);
    border-radius: 50%;
}

.book-links { display: flex; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-top: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.stat-item {
    padding: 1.25rem;
    border-right: 1px solid var(--border);
    text-align: center;
}

.stat-item:last-child { border-right: none; }

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--sky);
    line-height: 1;
    font-family: 'Courier New', monospace;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Courier New', monospace;
}

/* ── Data highlight ─────────────────────────────────────────────────────────── */
.data-highlight {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    margin-top: 2.5rem;
    padding: 1.75rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-left: 2px solid var(--cyan);
    border-radius: 2px;
}

.data-highlight h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f6fc;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.data-highlight p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.data-badges { display: flex; gap: 0.4rem; margin-top: 0.9rem; flex-wrap: wrap; }

.badge {
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
}

.badge-vector  { background: rgba(14, 165, 233, 0.1); color: var(--sky); border: 1px solid rgba(14, 165, 233, 0.25); }
.badge-raster  { background: rgba(6, 182, 212, 0.1); color: var(--cyan); border: 1px solid rgba(6, 182, 212, 0.25); }
.badge-tabular { background: rgba(47, 127, 193, 0.1); color: #7ec8e3; border: 1px solid rgba(47, 127, 193, 0.3); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.playground-grid,
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    margin-top: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.playground-card,
.resource-card {
    background: var(--bg-card);
    padding: 1.5rem;
    transition: background 0.15s;
    position: relative;
}

.playground-card::before,
.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: transparent;
    transition: background 0.15s;
}

.playground-card:hover,
.resource-card:hover { background: var(--bg-elevated); }

.playground-card:hover::before,
.resource-card:hover::before { background: var(--sky); }

.card-label {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
}

.playground-card h3,
.resource-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.playground-card p,
.resource-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.65;
}

/* ── Authors ───────────────────────────────────────────────────────────────── */
.authors-grid {
    display: grid;
    gap: 1px;
    margin-top: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.author-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0;
    background: var(--bg-card);
    transition: background 0.15s;
}

.author-row:hover { background: var(--bg-elevated); }

.author-photo-cell {
    padding: 1.75rem 1.5rem;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.author-image {
    width: 88px;
    height: 88px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid var(--border-mid);
}

.author-image-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-dim);
}

.author-text-cell { padding: 1.75rem 2rem; }

.author-text-cell h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0f6fc;
    letter-spacing: -0.01em;
    margin-bottom: 0.2rem;
}

.bio-title {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.85rem;
}

.author-text-cell p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 560px;
}

.social-links { display: flex; gap: 0.5rem; margin-top: 1rem; }

.social-links a {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border-mid);
    border-radius: 2px;
    transition: all 0.15s;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.social-links a:hover { border-color: var(--sky); color: var(--sky); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 2rem 24px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-brand { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.footer-brand span { color: var(--sky); }
.footer p { font-size: 0.75rem; color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
/* ── Author photo lightbox ──────────────────────────────────────────────────── */
.author-image.clickable {
    cursor: zoom-in;
    transition: opacity 0.15s, transform 0.15s;
}
.author-image.clickable:hover { opacity: 0.85; transform: scale(1.04); }

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(2, 4, 10, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    cursor: zoom-out;
    animation: lb-in 0.18s ease;
}
#lightbox.open { display: flex; }
@keyframes lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#lightbox img {
    max-width: min(520px, 90vw);
    max-height: 80vh;
    border-radius: 3px;
    border: 1px solid var(--border-mid);
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    animation: lb-img-in 0.2s ease;
    object-fit: cover;
}
@keyframes lb-img-in {
    from { transform: scale(0.93); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
#lightbox-caption {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    max-width: min(520px, 90vw);
    text-align: left;
    line-height: 1.6;
}
#lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.4rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}
#lightbox-close:hover { color: #f0f6fc; }

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2rem; }
    .nav-links { gap: 0; font-size: 0.78rem; }
    .book-grid { grid-template-columns: 1fr; }
    .book-cover { display: flex; justify-content: center; }
    .data-highlight { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .stat-item:nth-child(2) { border-right: none; }
    .author-row { grid-template-columns: 1fr; }
    .author-photo-cell { border-right: none; border-bottom: 1px solid var(--border); padding: 1.25rem 1.5rem; justify-content: flex-start; }
    .cta-buttons { flex-direction: column; align-items: center; }
    .playground-grid, .resources-grid { grid-template-columns: 1fr; }
}
