/* ===== CSS Custom Properties — Light Theme ===== */
:root {
    --bg: #edf2f7;
    --bg-alt: #e2e8f0;
    --text: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --link: #3182ce;
    --link-hover: #2256a0;
    --glow: rgba(66, 133, 244, 0.25);
    --glow-inner: rgba(66, 133, 244, 0.08);
    --border: rgba(66, 133, 244, 0.15);
    --card-bg: #ffffff;
    --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(66, 133, 244, 0.35);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(66, 133, 244, 0.55);
}

/* ===== Blue Glow Border (Viewport Frame) ===== */
.glow-border {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow:
        inset 0 0 80px var(--glow-inner),
        inset 0 0 200px rgba(80, 140, 220, 0.06),
        0 0 60px var(--glow),
        0 0 120px rgba(80, 140, 220, 0.15);
    border: 1px solid var(--border);
    border-radius: 2px;
}

/* ===== Selection ===== */
::selection {
    background-color: rgba(66, 133, 244, 0.2);
    color: var(--text);
}

/* ===== Links ===== */
a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition);
}

a:hover {
    color: var(--link-hover);
}

/* ===== HOME PAGE ===== */
.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 0;
}

.home-name {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.home-tagline {
    font-family: var(--sans);
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

.home-time {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 2.5rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.home-nav {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.home-nav a {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--link);
    text-decoration: none;
    letter-spacing: 0.02em;
    position: relative;
    padding-bottom: 2px;
    font-weight: 500;
}

.home-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--link-hover);
    transition: width var(--transition);
}

.home-nav a:hover::after {
    width: 100%;
}

/* ===== Entrance Animation ===== */
body:not(.loaded) .home-name,
body:not(.loaded) .home-tagline,
body:not(.loaded) .home-time,
body:not(.loaded) .home-nav {
    opacity: 0;
    transform: translateY(20px);
}

body.loaded .home-name {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

body.loaded .home-tagline {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.25s;
    opacity: 0;
}

body.loaded .home-time {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

body.loaded .home-nav {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.55s;
    opacity: 0;
}

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

/* Keep time slightly transparent after animation */
body.loaded .home-time {
    animation: fadeUpMuted 0.8s ease forwards;
    animation-delay: 0.4s;
}

@keyframes fadeUpMuted {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ===== SHARED INNER PAGES LAYOUT ===== */
.page {
    max-width: 800px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 3rem;
}

.page-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ===== Back Link ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    transition: color var(--transition);
    font-weight: 500;
}

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

.back-link svg {
    width: 14px;
    height: 14px;
}

/* ===== ABOUT PAGE ===== */
.about-intro {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    align-items: start;
}

.about-ascii {
    font-family: 'Courier New', monospace;
    font-size: 3.5px;
    line-height: 1;
    letter-spacing: 1px;
    white-space: pre;
    color: var(--text);
    opacity: 0.7;
    user-select: none;
    background: var(--card-bg);
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.about-bio h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.about-bio p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-bio strong,
.about-bio a {
    color: var(--text);
    font-weight: 500;
}

/* About Sections */
.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.about-section h3 {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    margin-top: 1.25rem;
}

.about-list {
    list-style: none;
    padding: 0;
}

.about-list li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.about-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--link);
    font-weight: 700;
    font-size: 1.1em;
}

.about-list li a {
    border-bottom: 1px solid transparent;
}

.about-list li a:hover {
    border-bottom-color: var(--link);
}

.about-list li strong {
    color: var(--text);
    font-weight: 600;
}

/* Experience Metrics */
.experience-metrics {
    display: flex;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.exp-metric {
    text-align: center;
}

.exp-metric-number {
    display: block;
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--link);
    margin-bottom: 0.15rem;
}

.exp-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Hobbies / Currently */
.currently-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem 2rem;
}

.currently-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
}

.currently-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: capitalize;
    min-width: 80px;
}

.currently-value {
    color: var(--text);
}

/* ===== PROJECTS PAGE ===== */
.projects-category {
    margin-bottom: 2.5rem;
}

.projects-category h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.project-list {
    list-style: none;
    padding: 0;
}

.project-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(66, 133, 244, 0.1);
    transition: padding-left var(--transition);
}

.project-list li:hover {
    padding-left: 0.5rem;
}

.project-list li:last-child {
    border-bottom: none;
}

.project-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.project-link .project-name {
    font-weight: 500;
    font-size: 1rem;
    color: var(--link);
    flex: 1;
}

.project-link .project-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    max-width: 50%;
}

.project-link .project-tech-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-tech-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: rgba(66, 133, 244, 0.1);
    color: var(--text-muted);
    border-radius: 3px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Project cards (alternative for featured) */
.featured-project {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.featured-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(66, 133, 244, 0.12);
}

.featured-project h3 {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.featured-project h3 a {
    color: var(--text);
}

.featured-project h3 a:hover {
    color: var(--link);
}

/* Project Header with Links */
.featured-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.featured-project-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.project-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all var(--transition);
    font-weight: 500;
}

.project-icon-link:hover {
    color: var(--link);
    border-color: var(--link);
    background: rgba(66, 133, 244, 0.06);
}

.project-icon-link svg {
    flex-shrink: 0;
}

.featured-project-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.featured-project p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.featured-project-features {
    list-style: none;
    padding: 0;
    margin-bottom: 0.75rem;
}

.featured-project-features li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.featured-project-features li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--link);
    font-weight: 700;
}

.featured-project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ===== CONTACT PAGE ===== */
.contact-center {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 500px;
    margin-bottom: 2.5rem;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.contact-item-label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 70px;
    text-align: right;
}

.contact-item a {
    color: var(--link);
    font-weight: 400;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.contact-item a:hover {
    border-bottom-color: var(--link);
}

/* Page nav (bottom) */
.page-nav {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.page-nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition);
}

.page-nav a:hover {
    color: var(--link);
}

/* ===== Footer ===== */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* ===== Page entrance ===== */
.page {
    animation: pageIn 0.6s ease forwards;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .home-nav {
        gap: 1.5rem;
    }

    .about-intro {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-ascii {
        margin: 0 auto;
    }

    .page {
        padding: 3rem 1.5rem 3rem;
    }

    .project-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .project-link .project-desc {
        text-align: left;
        max-width: 100%;
    }

    .contact-items {
        text-align: center;
    }

    .contact-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .contact-item-label {
        text-align: center;
    }

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

    .page-nav {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .home-name {
        font-size: 2.2rem;
    }

    .page-title {
        font-size: 1.8rem;
    }
}
