:root {
    --font: "Geist Sans", "Geist", system-ui, -apple-system, sans-serif;
    --bg: #b9c7d6;
    --bg-dot: rgba(70, 90, 110, 0.22);
    --card: #f7f7f5;
    --text: #1a1a1a;
    --muted: #6b6b6b;
    --faint: #9a9a9a;
    --line: rgba(0, 0, 0, 0.08);
    --link-underline: rgba(0, 0, 0, 0.35);
    --shadow: 0 18px 50px rgba(40, 55, 75, 0.18), 0 2px 8px rgba(40, 55, 75, 0.08);
    --icon-bg: rgba(0, 0, 0, 0.04);
    --icon-hover: rgba(0, 0, 0, 0.08);
    --avatar-bg: #e8ebe8;
}

[data-theme="dark"] {
    --bg: #1c2229;
    --bg-dot: rgba(180, 200, 220, 0.12);
    --card: #22262b;
    --text: #ececec;
    --muted: #9a9a9a;
    --faint: #7a7a7a;
    --line: rgba(255, 255, 255, 0.1);
    --link-underline: rgba(255, 255, 255, 0.35);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
    --icon-bg: rgba(255, 255, 255, 0.06);
    --icon-hover: rgba(255, 255, 255, 0.1);
    --avatar-bg: #32363c;
}

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

html {
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(1.5rem, 5vw, 4rem) 1rem 3rem;
    -webkit-font-smoothing: antialiased;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px);
    background-size: 5px 5px;
    opacity: 0.9;
}

.postcard {
    position: relative;
    z-index: 1;
    width: min(42rem, 100%);
    background: var(--card);
    border-radius: 1.15rem;
    box-shadow: var(--shadow);
    padding: clamp(1.4rem, 4vw, 2.35rem);
    animation: rise 0.55s ease-out both;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.hero-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.avatar {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.85rem;
    background: var(--avatar-bg);
    color: var(--muted);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px var(--line);
}

.hero-text {
    min-width: 0;
}

.hero h1 {
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hero-name {
    color: var(--text);
}

.hero-divider,
.hero-title {
    color: var(--muted);
    font-weight: 500;
}

.hero-location {
    margin-top: 0.15rem;
    font-size: 0.9rem;
    color: var(--faint);
}

.header-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.icon-btn {
    width: 2.15rem;
    height: 2.15rem;
    border: 0;
    border-radius: 999px;
    background: var(--icon-bg);
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: var(--icon-hover);
    color: var(--text);
}

.icon-moon,
.icon-check {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

#copy-email[data-copied="true"] .icon-mail {
    display: none;
}

#copy-email[data-copied="true"] .icon-check {
    display: block;
}

.about {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.about p {
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--text);
}

.about a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.about a:hover {
    text-decoration-style: solid;
}

.work-section {
    display: grid;
    gap: 1.75rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--line);
}

.work-block-heading {
    font-size: 0.92rem;
    color: var(--faint);
    margin: 1.35rem 0 0.55rem;
}

.work-list {
    display: grid;
}

.work-list-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    color: inherit;
    text-decoration: none;
    border-radius: 0.35rem;
    transition: opacity 0.15s ease;
}

.work-list-item:hover {
    opacity: 0.7;
}

.work-list-body {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.work-list-title {
    font-size: 1.02rem;
    line-height: 1.45;
}

.work-list-desc {
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--muted);
}

.work-list-tail {
    white-space: nowrap;
}

.work-list-arrow {
    display: inline-block;
    vertical-align: -0.12em;
    margin-left: 0.1em;
    font-size: 0.95em;
}

.work-list-meta {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--faint);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-intro {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.page-lead {
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--muted);
}

.empty-state {
    padding: 0.55rem 0 0.25rem;
    font-size: 1.02rem;
    color: var(--faint);
}

.post-date {
    margin-bottom: 0.45rem;
}

.post-body {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.75rem;
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--text);
}

.post-body a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.post-body a:hover {
    text-decoration-style: solid;
}

.post-body code {
    font-size: 0.92em;
    padding: 0.1em 0.35em;
    border-radius: 0.3rem;
    background: var(--icon-bg);
}

.post-nav {
    font-size: 0.95rem;
}

.post-nav a {
    color: var(--muted);
    text-decoration: none;
}

.post-nav a:hover {
    color: var(--text);
}

.page-lead a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    text-decoration-color: var(--link-underline);
}

.work-section + .work-section,
.page-intro + .work-section {
    border-top: 1px solid var(--line);
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    padding-bottom: 0.25rem;
}

.skills-list li {
    font-size: 0.95rem;
    color: var(--muted);
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-top: 2.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--faint);
}

.footer-location {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.site-footer a {
    color: var(--faint);
    text-decoration: none;
}

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

:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 2px;
}

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

@media (max-width: 520px) {
    .hero {
        flex-direction: column;
    }

    .header-actions {
        align-self: flex-end;
    }

    .hero h1 {
        font-size: 1.05rem;
    }

    .hero-divider {
        display: none;
    }

    .hero-title {
        display: block;
        margin-top: 0.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .postcard {
        animation: none;
    }
}
