@import url('https://fonts.googleapis.com/css2?family=LINE+Seed+JP:wght@400;700;800&display=swap');

/* Shared site nav: compact single-row layout where possible. */
site-nav {
    --nav-progress: 0;
    --nav-height-large: 118px;
    --nav-height-delta: 36px;
    --art-width-large: 88px;
    --art-width-delta: 40px;
    --art-height-large: 103px;
    --art-height-delta: 47px;
    --nav-gap: clamp(10px, 1.2vw, 22px);
    --nav-link-size: 11.5px;
    --nav-sub-size: 9.86px;
    --nav-sub-gap: 2px;
    --nav-label-size: 9.86px;
    display: block;
    min-height: var(--nav-height-large);
    box-sizing: border-box;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    overflow-x: clip;
    background: rgba(241, 241, 239, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-wrap {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 clamp(11.9px, 6vw, 79.9px);
}

.nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: var(--nav-gap);
    row-gap: 8px;
    min-height: calc(var(--nav-height-large) - (var(--nav-progress) * var(--nav-height-delta)));
    padding-top: 4px;
    padding-bottom: 4px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #000;
    font-family: 'LINE Seed JP', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: 0;
    flex-shrink: 0;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.12;
}

.nav-brand-text strong {
    font-size: 15px;
}

.nav-brand-text small {
    color: #8a8a8a;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.nav-art {
    display: block;
    width: calc(var(--art-width-large) - (var(--nav-progress) * var(--art-width-delta)));
    height: calc(var(--art-height-large) - (var(--nav-progress) * var(--art-height-delta)));
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(0, 0, 0, 0.28);
    filter: grayscale(1) contrast(1.08);
}

.nav-menu {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: flex-end;
    column-gap: var(--nav-gap);
    row-gap: 8px;
    margin-left: auto;
    min-width: 0;
    flex: 1 1 auto;
}

/* Section groups: muted label left, links right, shared baseline */
.nav-section {
    display: inline-flex;
    align-items: flex-end;
    gap: 14px;
    padding-right: calc(var(--nav-gap) * 1.15);
    margin-right: calc(var(--nav-gap) * 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.nav-section-label {
    font-family: 'LINE Seed JP', sans-serif;
    font-size: var(--nav-label-size);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a8a;
    line-height: 1.1;
    text-align: right;
    min-width: 5.25em;
    flex-shrink: 0;
    user-select: none;
    /* Align with the primary link line above each subtitle */
    padding-bottom: calc(var(--nav-sub-size) + var(--nav-sub-gap) + 1px);
}

.nav-section-links {
    display: inline-flex;
    align-items: flex-end;
    flex-wrap: wrap;
    column-gap: calc(var(--nav-gap) * 0.75);
    row-gap: 4px;
}

.nav-link-stack,
.nav-local-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.1;
    white-space: nowrap;
}

.nav-link-stack small,
.nav-local-stack small {
    color: #929292;
    font-size: var(--nav-sub-size);
    font-weight: 400;
    letter-spacing: 0.025em;
    text-transform: none;
    white-space: nowrap;
}

.nav-hanford {
    flex-shrink: 0;
}

.nav-local,
.nav-link {
    font-family: 'LINE Seed JP', sans-serif;
    font-size: var(--nav-link-size);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border: 0;
    padding-bottom: 1px;
    white-space: nowrap;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.nav-local {
    color: #5c5c5c;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.15);
}

.nav-local:hover {
    color: #000;
    border-color: rgba(0, 0, 0, 0.4);
}

.nav-link {
    color: #252525;
    border-bottom: 1.5px solid transparent;
}

.nav-link:hover {
    color: #000;
    border-color: rgba(0, 0, 0, 0.4);
}

/* Social: icon row + stacked emails */
.nav-social {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-social-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #4a4a4a;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-icon:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.06);
}

.nav-icon-svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nav-emails {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    line-height: 1.2;
    user-select: text;
}

.nav-emails a {
    color: #5c5c5c;
    font-family: 'LINE Seed JP', sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-emails a:hover {
    color: #000;
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    site-nav {
        --nav-progress: 1 !important;
    }
}

/* Mid widths: menu may wrap to second row */
@media (max-width: 1280px) {
    site-nav {
        --nav-height-large: 88px;
        --nav-gap: 10px;
    }

    .nav-emails {
        display: none;
    }

    .nav-icon-mail {
        display: inline-flex;
    }
}

@media (max-width: 1280px) and (min-width: 901px) {
    .nav-menu {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* Small screens */
@media (max-width: 900px) {
    site-nav {
        --nav-height-large: 64px;
        --nav-height-delta: 8px;
        --art-width-large: 42px;
        --art-width-delta: 4px;
        --art-height-large: 49px;
        --art-height-delta: 6px;
        --nav-gap: 10px;
    }

    .nav-inner {
        position: relative;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .nav-menu {
        width: auto;
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    .nav-resume {
        display: none;
    }

    .nav-hanford small,
    .nav-local-stack small {
        display: block;
        font-size: 8.5px;
    }

    .nav-section {
        gap: 10px;
        margin-right: 6px;
        padding-right: 10px;
    }

    .nav-section-label {
        min-width: 4.5em;
        padding-bottom: calc(var(--nav-sub-size) + var(--nav-sub-gap));
    }

    .nav-section-links {
        column-gap: 10px;
    }

    .nav-local,
    .nav-link {
        font-size: 10.5px;
    }

    .nav-social {
        gap: 6px;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
    }

    .nav-icon-svg {
        width: 15px;
        height: 15px;
    }

    /* One email line on mobile; mail icon opens primary address */
    .nav-emails {
        display: block;
    }

    .nav-emails a {
        font-size: 9.5px;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 520px) {
    .nav-brand-text small {
        display: none;
    }

    .nav-emails {
        display: none;
    }

    .nav-menu {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    /* Keep stacked subtitles visible */
    .nav-hanford small,
    .nav-local-stack small {
        display: block;
        font-size: 8.5px;
    }

    .nav-section-label {
        display: none;
    }

    .nav-section {
        border-right: 0;
        padding-right: 0;
        margin-right: 0;
    }

    .nav-local,
    .nav-link {
        letter-spacing: 0.08em;
    }
}
