/* Space Grotesk – self-hosted, all weights 400-700 */
/* latin */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext (covers Latvian ā č ē ģ ī ķ ļ ņ š ū ž) */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* vietnamese */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
                   U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323,
                   U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
    --sky: #1D84D7;
    --cream: #F9F6F0;
    --white: #FFFFFF;
    --black: #0A0A0A;
    --surface: #FFFFFF;
    --border: rgba(10, 10, 10, 0.4);
    --nav-bg: rgba(255, 255, 255, 0.5);
    --ink: #0A0A0A;
}

[data-theme="dark"] {
    --sky: #4FA8E8;
    --black: #F2EFE9;
    --surface: #121417;
    --border: rgba(242, 239, 233, 0.25);
    --nav-bg: rgba(18, 20, 23, 0.55);
}

[data-theme="dark"] .when,
[data-theme="dark"] .entry-location {
    opacity: 0.75;
}

[data-theme="dark"] .entry-year,
[data-theme="dark"] .achievement-location {
    opacity: 0.88;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--black);
    background: var(--surface);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    padding: 48px 5vw 60px;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.container.leaving,
.container.hidden {
    filter: blur(16px);
    opacity: 0;
}

.nav-vertical {
    position: fixed;
    top: 36px;
    right: 5vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    z-index: 10;
    view-transition-name: site-nav;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-hidden {
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
}

.nav-trigger {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 220px;
    z-index: 9;
}

body:has(.nav-trigger:hover) .nav-hidden {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-vertical a {
    color: var(--black);
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.nav-vertical a:hover,
.nav-vertical a.active {
    color: var(--sky);
}

.nav-vertical a.active {
    border-bottom: 2px solid var(--sky);
    padding-bottom: 2px;
}

.nav-home {
    position: absolute;
    top: 50%;
    right: 5vw;
    transform: translateY(-50%);
    align-items: flex-end;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-home a {
    color: var(--white);
    text-shadow: 0 1px 4px rgba(10, 10, 10, 0.7), 0 0 14px rgba(10, 10, 10, 0.5);
}

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: 0s;
}

h1 {
    font-size: clamp(1.4rem, 5.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--black);
    margin-bottom: 0.2em;
    text-transform: lowercase;
}

h2 {
    display: inline-block;
    align-self: flex-start;
    color: var(--black);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-top: 3.2em;
    border-bottom: 2px solid var(--sky);
    padding-bottom: 0.5em;
    text-transform: lowercase;
}

h2:first-of-type {
    margin-top: 1.5em;
}

.tagline {
    color: var(--black);
    opacity: 0.7;
    font-size: 1.15rem;
    margin-bottom: 1.5em;
}

.tagline a {
    color: var(--sky);
    text-decoration: none;
}

.tagline a:hover {
    text-decoration: underline;
}

.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    transition: filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.hero.hidden {
    filter: blur(16px);
    opacity: 0;
}

.hero.leaving {
    transition: filter 0.4s ease-in-out, opacity 0.4s ease-in-out;
    filter: blur(16px);
    opacity: 0;
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 8%;
    display: block;
}

.hero-greeting,
.hero-intro {
    position: absolute;
    top: 15%;
    transform: translateX(-50%);
    font-size: clamp(1.1rem, 4.5vw, 3.5rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.hero-greeting {
    left: 15%;
}

.hero-intro {
    left: 74%;
}

.hero-mobile-text {
    display: none;
}

.entry {
    margin-top: 1.4em;
    margin-bottom: 1.4em;
}

.entry > strong {
    font-size: 1.15rem;
}

.entry > strong a {
    color: inherit;
    text-decoration: underline;
}

.entry-location {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--black);
    opacity: 0.6;
}

.achievement-location {
    opacity: 0.71;
}

.entry-year {
    opacity: 0.71;
}

.entry .when {
    color: var(--black);
    opacity: 0.6;
    font-size: 0.9rem;
}

.entry .when + .when {
    margin-top: 7.5px;
}

.entry ul {
    margin-top: 0.4em;
    padding-left: 1.2em;
    font-size: 0.9rem;
    opacity: 0.85;
    list-style: none;
}

.entry ul li {
    position: relative;
}

.entry ul li::before {
    content: "\2013";
    position: absolute;
    left: -1.2em;
}

.placeholder {
    background: var(--surface);
    border-left: 3px solid var(--sky);
    border-radius: 4px;
    padding: 18px 20px;
    margin-top: 1.4em;
    color: var(--black);
    opacity: 0.8;
    font-style: italic;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 28px;
    margin-top: 1.4em;
}

.photo-item {
    position: relative;
    display: block;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 4px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-item:hover img {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(10, 10, 10, 0.15);
}

.photo-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.55) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.photo-item:hover::after {
    opacity: 1;
}

.photo-location {
    position: absolute;
    z-index: 1;
    left: 14px;
    bottom: 12px;
    color: var(--white);
    font-size: 0.8rem;
    text-transform: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.photo-item:hover .photo-location {
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

html:has(.lightbox:target),
body:has(.lightbox:target) {
    touch-action: none;
}

.lightbox:target,
.lightbox.lightbox-peek {
    display: flex;
}

.lightbox a:not(.lightbox-close):not(.lightbox-prev):not(.lightbox-next) {
    display: flex;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 36px;
    right: 5vw;
    z-index: 1001;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    font-size: 15px;
    letter-spacing: 0.03em;
    text-decoration: underline;
    text-transform: lowercase;
    cursor: pointer;
}

.lightbox-location {
    position: absolute;
    bottom: 36px;
    left: 5vw;
    z-index: 1001;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    font-size: 15px;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.lightbox-close.text-dark,
.lightbox-location.text-dark {
    color: var(--ink);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--white);
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-prev::after,
.lightbox-next::after {
    content: '';
    position: absolute;
    inset: -14px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(10, 10, 10, 0.6);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.4em;
    max-width: 480px;
    margin-top: 1.5em;
    padding: 32px;
    border: 2px solid var(--sky);
    border-radius: 8px;
}

.contact-form[hidden] {
    display: none;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    font-size: 0.9rem;
    color: var(--black);
    opacity: 0.7;
}

.contact-form input,
.contact-form textarea {
    font-family: inherit;
    font-size: 1rem;
    text-transform: none;
    color: var(--black);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 14px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--sky);
}

.contact-form button {
    align-self: flex-start;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--white);
    background: var(--sky);
    border: none;
    border-radius: 4px;
    padding: 12px 28px;
    cursor: pointer;
}

.contact-form button:disabled {
    opacity: 0.6;
    cursor: default;
}

.contact-status {
    max-width: 480px;
    margin-top: 1.5em;
    padding: 16px 20px;
    border-radius: 4px;
    border-left: 3px solid var(--sky);
    background: var(--surface);
    color: var(--black);
}

.contact-status-error {
    border-left-color: #e0454f;
}

footer {
    position: relative;
    margin-top: auto;
    padding-top: 100px;
    padding-bottom: 24px;
    color: var(--black);
    opacity: 0.6;
    font-size: 0.85rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.copyright {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

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

footer a::after {
    content: "\2197";
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links-big {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 1.4em;
}

.social-links-big a {
    color: var(--sky);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
}

.social-links-big a:hover {
    text-decoration: underline;
}

.social-links-big a::after {
    content: "\2197";
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
}

.utility-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    margin: 36px 5vw 0;
    transition: filter 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.utility-bar.leaving,
.utility-bar.hidden {
    filter: blur(16px);
    opacity: 0;
}

.utility-bar .lang-toggle {
    position: static;
}

.theme-toggle,
.lang-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-toggle {
    position: fixed;
    top: 36px;
    left: 5vw;
    z-index: 10;
}

.theme-toggle button,
.lang-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.03em;
    border: none;
    background: none;
    color: var(--black);
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
}

.theme-toggle button.active,
.lang-toggle button.active {
    opacity: 1;
    color: var(--sky);
    font-weight: 600;
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.toggle-divider {
    color: var(--black);
    opacity: 0.3;
}

@media (max-width: 700px) {
    .hero {
        height: 100dvh;
    }

    .utility-bar {
        margin: 10px 5vw 0;
    }

    .nav-vertical {
        top: 54px;
        gap: 8px;
        padding: 8px 12px;
    }

    .nav-vertical a {
        font-size: 14px;
    }

    .container {
        padding-top: 148px;
    }

    h1 {
        margin-top: 0;
    }

    .entry > strong {
        display: block;
        font-size: 1rem;
    }

    .entry-location {
        display: block;
        font-size: 1rem;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .contact-form {
        padding: 20px;
    }

    .social-links-big {
        gap: 18px;
    }

    footer {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding-top: 60px;
        text-align: center;
    }

    .copyright {
        position: static;
        transform: none;
    }

    .lightbox-close {
        top: 20px;
        right: 5vw;
    }

    .lightbox-location {
        bottom: 20px;
        left: 5vw;
    }


    .lightbox-close.text-dark,
    .lightbox-location.text-dark {
        color: var(--white);
    }

    .hero-greeting,
    .hero-intro {
        display: none;
    }

    .hero-mobile-text {
        display: block;
        position: absolute;
        top: 9%;
        right: 6%;
        width: 46%;
        text-align: right;
        font-size: clamp(1.5rem, 8.5vw, 2.4rem);
        font-weight: 700;
        color: var(--ink);
        letter-spacing: -0.01em;
        line-height: 1.7;
        text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8), 0 0 14px rgba(255, 255, 255, 0.6);
    }

    .nav-home {
        top: auto;
        bottom: 5%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: auto;
        background: rgba(10, 10, 10, 0.35);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 14px 22px;
        border-radius: 12px;
    }

    .nav-home a {
        white-space: nowrap;
        font-size: 14px;
    }

    .nav-home a.active {
        color: var(--white);
        text-shadow: none;
    }
}
