/* =========================================================
   satoj Photography — shared styles
   ========================================================= */

:root {
    --bg: #F3F5F6;
    --bg-soft: #E3E7EA;
    --line: #C9CFD4;
    --text: #000000;
    --muted: #5B6168;
    --accent: #0047AB;
    --header-h: 72px;
    --gutter: clamp(16px, 4.5vw, 64px);
    --max: 1440px;
    --row-h: 340px;
    --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
    --font-num: "Barlow Condensed", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

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

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(243, 245, 246, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
}

.logo {
    font-family: var(--font-num);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
}

.logo span {
    color: var(--muted);
    font-weight: 400;
}

.nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 32px);
    font-size: 15px;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    transition: color 0.2s;
    white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"] {
    color: var(--text);
}

.nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.lang-toggle {
    background: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 12px;
    font-family: var(--font-num);
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lang-toggle:hover {
    border-color: var(--muted);
}

@media (max-width: 560px) {
    .logo span {
        display: none;
    }
    .nav {
        gap: 14px;
        font-size: 14px;
    }
    .nav .nav-sub {
        display: none; /* profile and contact are further down the page; keep header within narrow screens */
    }
}

/* ---------- Hero slideshow ---------- */

.hero {
    position: relative;
    height: min(calc(100svh - var(--header-h)), 66.6vw);
    min-height: 240px;
    overflow: hidden;
    background: #000;
}

.hero-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-slide.is-active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-caption {
    position: absolute;
    left: var(--gutter);
    bottom: 28px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.hero-controls {
    color: #fff;
    position: absolute;
    right: var(--gutter);
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: background 0.2s;
}

.hero-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.hero-btn svg {
    width: 16px;
    height: 16px;
}

.hero-dots {
    display: flex;
    gap: 2px;
    margin: 0 8px;
}

.hero-dot {
    width: 28px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    position: relative;
}

.hero-dot::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 50%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s;
}

.hero-dot[aria-current="true"]::after {
    background: #fff;
}

/* ---------- Sections ---------- */

.section {
    padding: clamp(56px, 9vw, 120px) 0;
}

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


.heading {
    margin: 0 0 28px;
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.35;
}

.display {
    margin: 0;
    max-width: 12em;
    font-size: clamp(40px, 6.2vw, 92px);
    font-weight: 700;
    line-height: 1.15;
}

.lead {
    max-width: 36em;
    margin: 0;
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 2.05;
}

/* Intro (home) */

.intro {
    display: flex;
    flex-wrap: wrap;
    gap: 32px clamp(32px, 6vw, 96px);
}

.intro .lead {
    flex: 1 1 520px;
}

.intro-side {
    flex: 1 1 280px;
}

.stat {
    display: flex;
    flex-direction: column;
    margin: 0 0 24px;
}

.stat-num {
    font-family: var(--font-num);
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
    color: var(--accent);
}

.stat-label,
.credits {
    font-size: 15px;
    color: var(--muted);
}

.credits {
    margin: 0;
    line-height: 1.9;
}

.text-link {
    color: var(--accent);
    font-size: 16px;
    text-underline-offset: 4px;
}

.text-link:hover {
    color: #00337a;
}

/* Sport lanes (home) */

.lanes-section {
    padding-bottom: 0;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.lanes {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lanes li {
    border-top: 1px solid var(--line);
}

.lane {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px clamp(24px, 4vw, 48px);
    max-width: var(--max);
    margin: 0 auto;
    padding: 20px var(--gutter);
    text-decoration: none;
}

.lane-text {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sport-name {
    font-size: clamp(32px, 4.4vw, 64px);
    font-weight: 700;
    line-height: 1.1;
}

.lane-meta {
    font-family: var(--font-num);
    font-size: 22px;
    color: var(--muted);
}

.lane-photo {
    flex: 2 1 480px;
    height: 180px;
    overflow: hidden;
    background: var(--bg-soft);
}

.lane-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.lane:hover .lane-photo img {
    transform: scale(1.03);
}

@media (max-width: 560px) {
    .lane-photo {
        flex-basis: 100%;
        height: 140px;
    }
}

/* Profile */

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 32px clamp(32px, 6vw, 96px);
}

@media (max-width: 760px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.career {
    margin: 0;
    padding: 0;
    list-style: none;
}

.career li {
    display: grid;
    grid-template-columns: 8.5em 1fr;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.career li:first-child {
    border-top: 1px solid var(--line);
}

.career time,
.career .year {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: 19px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .career li {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ---------- Footer / contact ---------- */

.site-footer {
    background: #000;
    color: var(--bg);
    padding: clamp(56px, 8vw, 96px) 0 32px;
}

.contact-mail {
    display: inline-block;
    font-family: var(--font-num);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid #4d8de8;
    padding-bottom: 2px;
    word-break: break-all;
    transition: border-color 0.2s;
}

.contact-mail:hover {
    border-color: var(--bg);
}

.site-footer .lead {
    color: var(--line);
}

.site-footer :focus-visible {
    outline-color: #4d8de8;
}

.copyright {
    margin: 64px 0 0;
    font-size: 13px;
    color: #9aa1a8;
}

/* ---------- Portfolio page ---------- */

.page-head {
    padding: clamp(48px, 7vw, 96px) 0 24px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    margin: 32px 0;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
    list-style: none;
}

.filter-btn {
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    background: none;
    font-size: clamp(17px, 1.6vw, 22px);
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s;
}

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

.filter-btn[aria-pressed="true"] {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 10px;
}

.filter-btn .count {
    margin-left: 6px;
    font-family: var(--font-num);
    font-size: 0.85em;
    font-weight: 500;
    color: var(--muted);
}

/* Justified gallery: rows keep each photo's full aspect ratio (no cropping). */

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 clamp(56px, 8vw, 96px);
    padding: 0;
    list-style: none;
}

.gallery::after {
    content: "";
    flex-grow: 999;
}

.gallery-item {
    flex: var(--r) 1 calc(var(--r) * var(--row-h));
    max-width: 100%;
}

.gallery-item button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--bg-soft);
    cursor: zoom-in;
    aspect-ratio: var(--r);
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s, transform 0.6s ease;
}

.gallery-item img.is-loaded {
    opacity: 1;
}

.gallery-item button:hover img {
    transform: scale(1.03);
}

@media (max-width: 900px) {
    :root {
        --row-h: 240px;
    }
}

@media (max-width: 520px) {
    :root {
        --row-h: 150px;
    }
    .gallery {
        gap: 4px;
    }
}

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    background: rgba(0, 0, 0, 0.96);
    color: var(--bg);
    touch-action: pan-y;
}

.lightbox.is-open {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

body.no-scroll {
    overflow: hidden;
}

.lb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--gutter);
    font-family: var(--font-num);
    font-size: 17px;
    color: var(--line);
}

.lb-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0 clamp(8px, 7vw, 96px);
}

.lb-stage img {
    max-width: 100%;
    max-height: calc(100svh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.25s;
}

.lb-stage img.is-loading {
    opacity: 0.3;
}

.lb-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s;
}

.lb-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.lb-btn svg {
    width: 20px;
    height: 20px;
}

.lb-prev,
.lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lb-prev {
    left: clamp(8px, 2vw, 32px);
}

.lb-next {
    right: clamp(8px, 2vw, 32px);
}

@media (max-width: 640px) {
    .lb-prev,
    .lb-next {
        display: none; /* swipe instead */
    }
}

.lb-caption {
    padding: 12px var(--gutter) 16px;
    text-align: center;
    font-size: 14px;
    color: var(--line);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
