:root {
    --background: #FFFFFF;
    --text-primary: #737373;
    --text-heading: #000000;
    --link-color: #000000;
    --font-main: 'DM Sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-heading: 'Montserrat', sans-serif;
    --font-supporting: 'Space Mono', monospace;
    --font-size-body: 18px;
    --font-size-heading: 16px;
    --spacing-unit: 8px;
}

[data-theme="dark"] {
    --background: #0a0a0a;
    --text-primary: #a3a3a3;
    --text-heading: #ffffff;
    --link-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size-body);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
    width: 100%;
    padding: 36px 48px;
    overflow: hidden;
}

.hero-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    font-size: 18px;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-heading);
    text-decoration: none;
}

.resume-dropdown {
    position: relative;
}

.resume-toggle {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.resume-toggle:hover {
    color: var(--text-heading);
}

.resume-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--background);
    border: 1px solid color-mix(in srgb, var(--text-primary) 20%, transparent);
    display: flex;
    flex-direction: column;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.resume-dropdown.open .resume-menu {
    opacity: 1;
    visibility: visible;
}

.resume-menu a {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.resume-menu a:hover {
    background: color-mix(in srgb, var(--text-primary) 10%, transparent);
    color: var(--text-heading);
    text-decoration: none;
}

.nav-logo {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 20px;
}

.nav-logo:hover {
    text-decoration: none;
}

.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.hero-photo {
    width: 300px;
    height: auto;
    aspect-ratio: 3021 / 2945;
    object-fit: cover;
    border-radius: 0;
}

.hero-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(48px, 8vw, 80px);
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.1;
}

.hero-description {
    font-family: var(--font-main);
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

/* Work Section */
.work {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.work-heading {
    color: var(--text-heading);
    font-size: var(--font-size-heading);
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    border: 1px solid color-mix(in srgb, var(--text-primary) 60%, transparent);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.2s;
}

.project-card:hover {
    border-color: var(--text-primary);
    text-decoration: none;
}

.project-image {
    aspect-ratio: 16 / 10;
    background: color-mix(in srgb, var(--text-primary) 10%, transparent);
    overflow: hidden;
}

.project-image-link {
    display: block;
    text-decoration: none;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.project-image.dual-mobile {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: #fdfdfd;
    /* slightly distinct bg for mobile */
}

.project-image.dual-mobile img {
    width: auto;
    height: 100%;
    max-width: calc(50% - 8px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-info {
    padding: 16px;
}

.project-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.project-desc {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.project-stack {
    font-size: 13px;
    color: var(--text-primary);
    opacity: 0.6;
    font-family: var(--font-supporting);
    margin-bottom: 0;
}

.project-card.coming-soon {
    border-style: dashed;
    opacity: 0.5;
    cursor: default;
}

.project-card.coming-soon:hover {
    border-color: color-mix(in srgb, var(--text-primary) 35%, transparent);
}

/* Below Hero */
.container {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 8) var(--spacing-unit);
}

.theme-toggle {
    position: absolute;
    top: 36px;
    right: 48px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--text-heading);
}

.theme-toggle .iconify {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.intro {
    margin-top: 30vh;
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-family: var(--font-main);
}

.greeting {
    color: var(--text-heading);
    font-family: var(--font-main);
    font-size: var(--font-size-heading);
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
}

.intro p:not(.greeting) {
    font-family: var(--font-main);
    font-size: 18px;
    color: var(--text-primary);
    max-width: 600px;
}

p {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.faq {
    margin-top: calc(var(--spacing-unit) * 2);
}

.location-time {
    position: absolute;
    top: 36px;
    left: 48px;
    font-size: 18px;
    font-family: var(--font-main);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    color: var(--text-primary);
    opacity: 0.5;
}

.memories-link {
    color: var(--link-color);
    text-decoration: underline;
}

/* Memories Page Styles */
.back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-decoration: none;
}

.memory-hint {
    font-size: 20px;
    color: var(--text-primary);
    opacity: 0.75;
    margin-top: -12px;
    margin-bottom: 24px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.memory-item img {
    width: 100%;
    height: 180px;
    border-radius: 4px;
    display: block;
    margin-bottom: 8px;
    object-fit: cover;
}

.memory-image {
    cursor: zoom-in;
}

.memory-item .description {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox img {
    max-width: min(900px, 90vw);
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 6px;
}

.lightbox-caption {
    margin-top: 12px;
    color: #f1f1f1;
    font-size: 14px;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
}

.no-scroll {
    overflow: hidden;
}

.location {
    margin-right: 0;
}

.links {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.links a {
    margin-right: calc(var(--spacing-unit) * 2);
}

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

a:hover {
    text-decoration: underline;
}

.site-footer {
    border-top: 1px solid color-mix(in srgb, var(--text-primary) 15%, transparent);
    padding: 48px 48px;
    text-align: center;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-socials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.footer-socials a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-socials a:hover {
    color: var(--text-heading);
}

.footer-socials .iconify {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.footer-text {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.6;
    margin: 0;
}

/* Compact Pill Navbar */
.pill-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-nav.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.pill-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: color-mix(in srgb, var(--background) 85%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid color-mix(in srgb, var(--text-primary) 20%, transparent);
    border-radius: 50px;
    padding: 8px 20px 8px 8px;
}

.pill-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-heading);
    font-weight: 700;
    font-size: 16px;
}

.pill-identity:hover {
    text-decoration: none;
}

.pill-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.pill-name {
    white-space: nowrap;
}

.pill-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pill-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 4px;
}

.pill-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: background 0.2s;
}

.pill-dots:hover span {
    background: var(--text-heading);
}

.pill-links {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.35s ease;
    white-space: nowrap;
}

.pill-inner:hover .pill-links,
.pill-menu-wrapper.open .pill-links {
    max-width: 400px;
    opacity: 1;
    overflow: visible;
    padding-left: 16px;
}

.pill-inner:hover .pill-dots,
.pill-menu-wrapper.open .pill-dots {
    display: none;
}

.pill-links a,
.pill-links .resume-toggle {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    transition: color 0.2s;
}

.pill-links a:hover,
.pill-links .resume-toggle:hover {
    color: var(--text-heading);
    text-decoration: none;
}

.pill-links .resume-dropdown {
    display: flex;
    align-items: center;
}

.pill-links .resume-menu {
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
}

.theme-toggle-inline {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.theme-toggle-inline:hover {
    color: var(--text-heading);
}

.theme-toggle-inline .iconify {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .hero {
        padding: 24px 20px;
        height: auto;
        min-height: 100vh;
    }

    .nav-links {
        gap: 20px;
        font-size: 13px;
    }

    .resume-toggle {
        font-size: 13px;
    }

    .location-time {
        top: 24px;
        left: 20px;
        font-size: 14px;
    }

    .hero-photo {
        width: 150px;
    }

    .theme-toggle {
        top: 24px;
        right: 20px;
    }

    .hero-description {
        font-size: 16px;
    }

    .container {
        padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    }

    .container {
        padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    }

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

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

    .memory-item img {
        height: 200px;
    }
}