/* ========================================
   Design Tokens
   ======================================== */
:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border: #e5e7eb;
    --color-surface: #f3f4f6;
    --color-hero-bg: #0f172a;
    --color-hero-text: #ffffff;
    --color-section-blue: #1e3a5f;
    --color-section-blue-light: #2563eb;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --max-width: 52rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 3.5rem;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    padding-left: 1.5em;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-hero-text);
    text-decoration: none;
    transition: color 0.3s;
}

.navbar.scrolled .navbar-brand {
    color: var(--color-text);
}

.navbar-brand:hover {
    text-decoration: none;
    color: var(--color-accent);
}

.navbar-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    padding: 0;
}

.navbar-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.navbar.scrolled .navbar-links a {
    color: var(--color-text-muted);
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--color-accent);
    text-decoration: none;
}

.navbar-burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    flex-direction: column;
    gap: 5px;
}

.navbar-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-hero-text);
    transition: transform 0.2s, opacity 0.2s, background 0.3s;
}

.navbar.scrolled .navbar-burger span {
    background: var(--color-text);
}

.navbar-burger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
}

.navbar-burger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
}

.mobile-menu.is-active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: var(--space-sm) 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.mobile-menu a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-hero-bg);
    color: var(--color-hero-text);
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3xl);
    padding: var(--space-2xl) var(--space-lg);
    max-width: var(--max-width);
    width: 100%;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.hero-photo {
    width: 320px;
    height: 420px;
    border-radius: 0.75rem;
    object-fit: cover;
    object-position: top;
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.hero-name {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-typewriter {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    min-height: 2rem;
    margin-top: var(--space-sm);
}

.typewriter-cursor {
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-location {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--space-md);
}

/* Hero buttons */
.hero-buttons {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.btn {
    display: inline-block;
    padding: 0.7em 1.8em;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.btn:hover {
    text-decoration: none;
}

.btn--primary {
    background: var(--color-accent);
    color: #fff;
    border: 2px solid var(--color-accent);
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn--outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn--outline:hover {
    border-color: #fff;
    color: #fff;
}

.hero-scroll-btn {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    animation: bounce 2s ease infinite;
    z-index: 1;
}

.hero-scroll-btn:hover {
    color: var(--color-accent);
    text-decoration: none;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: var(--space-3xl) 0;
}

.section--alt {
    background: var(--color-surface);
}

.section--blue {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #ffffff;
}

.section--blue .section-title {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.section--blue a {
    color: #93c5fd;
}

.section--blue a:hover {
    color: #ffffff;
}

.section--blue .link-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.section--blue .link-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.section--blue .link-card-label {
    color: rgba(255, 255, 255, 0.7);
}

.section--blue .link-card-value {
    color: #ffffff;
}

.section--blue .link-card-detail {
    color: rgba(255, 255, 255, 0.7);
}

.section--blue span.link-card-logo {
    background: rgba(255, 255, 255, 0.2);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

/* ========================================
   Stats
   ======================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Card Grid
   ======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: var(--space-lg);
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}

.card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card--link {
    text-decoration: none;
    color: inherit;
}

.card--link:hover {
    text-decoration: none;
}

.card--featured {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fbbf24;
    position: relative;
}

.card--featured::before {
    content: "\2605";
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.2rem;
    color: #f59e0b;
}

.card--featured:hover {
    border-color: #f59e0b;
}

.card--placeholder {
    border-style: dashed;
    background: var(--color-surface);
    text-align: center;
    justify-content: center;
    align-items: center;
    min-height: 6rem;
}

.card--placeholder .card-title {
    color: var(--color-text-muted);
}

.card--placeholder .card-meta {
    color: var(--color-accent);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
    text-decoration: none;
}

.card-title:hover {
    color: var(--color-accent);
}

.card-meta {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-xs);
}

.card-details {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    line-height: 1.7;
}

.card-details summary {
    cursor: pointer;
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 500;
    user-select: none;
}

.card-details summary:hover {
    text-decoration: underline;
}

.card-details p {
    margin-top: var(--space-sm);
    color: var(--color-text);
}

.card--with-logo {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-md);
}

.card-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
    object-fit: contain;
}

span.card-logo {
    background: var(--color-border);
}

.card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-highlight {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-top: var(--space-sm);
}

.card-note {
    display: block;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
}

/* ========================================
   Content Items
   ======================================== */
.item {
    padding: var(--space-lg) 0;
}

.item + .item {
    border-top: 1px solid var(--color-border);
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.item-title a {
    color: var(--color-text);
}

.item-title a:hover {
    color: var(--color-accent);
}

.item-meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.item-description {
    margin-top: var(--space-sm);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text);
}

.item-badges {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.badge:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.badge--disabled {
    border-color: var(--color-border);
    color: var(--color-text-muted);
    pointer-events: none;
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ========================================
   Links Grid
   ======================================== */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-md);
}

.link-card {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: var(--space-lg);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    text-decoration: none;
}

.link-card-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.link-card-value {
    display: block;
    font-weight: 600;
    color: var(--color-text);
}

.link-card-detail {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.link-card--wide {
    grid-column: 1 / -1;
}

.link-card--with-logo {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
}

.link-card-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
    object-fit: contain;
}

span.link-card-logo {
    background: var(--color-border);
}

.link-card-body {
    display: flex;
    flex-direction: column;
}

/* ========================================
   Blog (standalone pages)
   ======================================== */
.page-header {
    padding: var(--space-2xl) 0 var(--space-lg);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-top: var(--space-xs);
}

/* Blog listing */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-bottom: var(--space-xl);
}

.blog-card {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: var(--space-lg);
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.blog-card-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--space-xs);
    color: var(--color-text);
    line-height: 1.4;
}

.blog-card:hover .blog-card-title {
    color: var(--color-accent);
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
    line-height: 1.6;
}

.blog-card-read {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-top: var(--space-sm);
}

/* Post page */
.post {
    padding-bottom: var(--space-2xl);
}

.post-header {
    padding: var(--space-lg) 0 var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-xl);
}

.post-back {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.post-back:hover {
    color: var(--color-accent);
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 42rem;
}

.post-content h2 {
    font-size: 1.4rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.post-content h3 {
    font-size: 1.2rem;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.post-content p {
    margin-bottom: var(--space-md);
}

.post-content ul,
.post-content ol {
    margin-bottom: var(--space-md);
}

.post-content li {
    margin-bottom: var(--space-xs);
}

.post-content pre {
    background: var(--color-surface);
    padding: var(--space-md);
    border-radius: 0.375rem;
    overflow-x: auto;
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border);
}

.post-content code {
    font-size: 0.9em;
}

.post-content p code,
.post-content li code {
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.88em;
}

.post-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: var(--space-md);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    font-style: italic;
}

.post-content img {
    border-radius: 0.375rem;
    margin: var(--space-md) 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-xl) 0;
}

.post-footer {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-lg);
    margin-top: var(--space-xl);
}

.back-link {
    display: inline-block;
    font-size: 0.95rem;
}

/* Blog page navbar override (not transparent) */
.navbar--static {
    position: sticky;
    background: var(--color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.navbar--static .navbar-brand {
    color: var(--color-text);
}

.navbar--static .navbar-links a {
    color: var(--color-text-muted);
}

.navbar--static .navbar-burger span {
    background: var(--color-text);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-lg) 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
    .navbar-links {
        display: none;
    }

    .navbar-burger {
        display: flex;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: var(--space-lg);
    }

    .hero-text {
        text-align: center;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-typewriter {
        font-size: 1.1rem;
    }

    .hero-photo {
        width: 220px;
        height: 290px;
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .page-header h1 {
        font-size: 1.6rem;
    }
}
