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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(circle at 12% 20%, rgba(14, 165, 233, 0.07), transparent 30%),
        radial-gradient(circle at 86% 10%, rgba(245, 158, 11, 0.07), transparent 28%),
        linear-gradient(180deg, #f9fbff 0%, #f4f6fb 100%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition), opacity var(--transition);
}

img {
    display: block;
    max-width: 100%;
    border-radius: var(--radius);
}

ul {
    list-style: none;
}

/* Layout helpers */
.shell {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-sm);
    width: 100%;
}

.page {
    padding-bottom: var(--space-xl);
}

.section {
    margin: 0 auto;
    padding: var(--space-lg) var(--space-sm);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--muted);
    max-width: 620px;
}

.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.05;
}

h3 {
    font-size: 1.2rem;
}

p {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.lede {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 720px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.pill + .pill {
    margin-left: 0.5rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(246, 247, 251, 0.75);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.site-header .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    padding: 0.55rem 0.65rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
}

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

.nav-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-toggle {
    display: none;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn.primary {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    color: white;
    border: none;
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
}

.text-link {
    font-weight: 700;
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow);
}

.card h3 {
    margin-bottom: var(--space-xs);
}

.muted {
    color: var(--muted);
}

.inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.inline-list .pill {
    margin-left: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.stat {
    padding: var(--space-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-top: 0.2rem;
}

/* Hero */
.hero {
    padding: var(--space-xl) var(--space-sm) var(--space-lg);
    background: var(--hero-gradient);
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    align-items: center;
    max-width: var(--content-max);
    margin: 0 auto;
}

.hero-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 242, 251, 0.95));
}

.hero-meta {
    display: grid;
    gap: 0.9rem;
    margin-top: var(--space-sm);
}

.hero-meta li {
    color: var(--muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: var(--space-sm) 0;
}

/* Lists */
.list {
    display: grid;
    gap: 0.7rem;
}

.list li {
    color: var(--muted);
}

.list strong {
    color: var(--ink);
}

/* Project Cards */
.project-card {
    position: relative;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-sm);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-weight: 700;
    font-size: 0.85rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Blog */
.blog-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-weight: 600;
}

.blog-meta .pill {
    background: rgba(15, 23, 42, 0.04);
    border: 1px dashed var(--border);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.gallery-grid img {
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    width: 100%;
    cursor: zoom-in;
}

.hobby-gallery img {
    height: 140px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.media-grid video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
    box-shadow: var(--shadow);
    max-height: 320px;
    object-fit: cover;
}

.scroll-panel {
    max-height: 540px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

@media (max-width: 720px) {
    .scroll-panel {
        max-height: 420px;
    }
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: min(900px, 90vw);
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: #fff;
}

.lightbox-caption {
    margin-top: var(--space-xs);
    color: #f8fafc;
    text-align: center;
    font-weight: 600;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    padding: var(--space-md) var(--space-sm);
}

.site-footer .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    color: var(--muted);
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-weight: 500;
}

.visit-metric strong {
    color: var(--text);
}

.visitor-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
}

.map-card {
    padding: var(--space-md);
}

.world-map {
    position: relative;
    aspect-ratio: 16 / 8.5;
    background: linear-gradient(135deg, rgba(64, 104, 255, 0.08), rgba(27, 43, 89, 0.08));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.world-map svg {
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
}

.world-map .land {
    fill: #c7d6ff;
    stroke: rgba(51, 68, 102, 0.3);
    stroke-width: 2;
    filter: drop-shadow(0 4px 12px rgba(0, 23, 71, 0.08));
}

.map-dot {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--dot-size, 14px);
    height: var(--dot-size, 14px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #e8f0ff, #3b5bff);
    box-shadow: 0 6px 18px rgba(59, 91, 255, 0.35);
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.map-note {
    margin-top: var(--space-sm);
}

.visitor-stats h3 {
    margin-bottom: var(--space-sm);
}

.continent-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.continent-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.8);
}

.continent-list span:last-child {
    font-weight: 700;
    color: var(--text);
}

/* Utilities */
.muted-border {
    border: 1px dashed var(--border);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
    .site-header .shell {
        height: auto;
        padding: var(--space-xs) var(--space-sm);
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .nav {
        width: 100%;
        justify-content: space-between;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: var(--space-sm);
        right: var(--space-sm);
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--space-sm);
        box-shadow: var(--shadow);
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-cta {
        display: none;
    }

    .hero {
        padding-top: var(--space-lg);
    }

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