@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700;900&family=Sora:wght@300;400;500;600;700;800&display=swap');

/* =================================================================
   なまーさ Portfolio — Dark & Cinematic Design System
   ================================================================= */

:root {
    /* Brand */
    --accent: #E9B872;          /* warm gold (evolved from #F9C784) */
    --accent-strong: #f3c885;
    --accent2: #8EC5E1;         /* heritage soft blue */

    /* Surfaces */
    --bg: #0b0b0f;
    --bg-soft: #101016;
    --surface: #15151b;
    --surface-2: #1c1c24;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);

    /* Text */
    --text: #f4f4f6;
    --muted: #a2a2ad;
    --faint: #6f6f7b;

    /* Type */
    --font-display: 'Sora', 'Noto Sans JP', sans-serif;
    --font-body: 'Noto Sans JP', 'Sora', sans-serif;

    /* Effects */
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.4);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --header-h: 72px;
    --maxw: 1240px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: clamp(15px, 0.4vw + 0.7rem, 16.5px);
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60vw 60vw at 80% -10%, rgba(233, 184, 114, 0.10), transparent 60%),
        radial-gradient(55vw 55vw at -10% 110%, rgba(142, 197, 225, 0.08), transparent 60%);
    pointer-events: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.25s var(--ease);
}

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

iframe,
video {
    max-width: 100%;
    width: 100%;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

::selection {
    background: var(--accent);
    color: #1a1206;
}

/* ===== Layout helpers ===== */
.container {
    width: min(92vw, var(--maxw));
    margin-inline: auto;
}

section {
    padding: clamp(4rem, 9vw, 8rem) 0;
    position: relative;
}

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    will-change: opacity, transform;
}
.reveal.visible {
    opacity: 1;
    transform: none;
}
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ===== Section heading ===== */
.section-head {
    margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
    max-width: 760px;
}
.section-head.center {
    margin-inline: auto;
    text-align: center;
}
.overline {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.overline::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--accent);
    opacity: 0.7;
}
.section-head.center .overline { justify-content: center; }

.section-title {
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
}
.section-title .idx {
    color: var(--faint);
    font-weight: 500;
    font-size: 0.5em;
    vertical-align: super;
    margin-left: 0.5rem;
    letter-spacing: 0;
}
.section-sub {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 60ch;
}

/* legacy h2 fallback for subpages */
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }

/* =================================================================
   Header / Navigation
   ================================================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}
header.scrolled {
    background: rgba(11, 11, 15, 0.72);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom-color: var(--line);
}

.global-nav {
    width: min(94vw, var(--maxw));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--header-h);
}
.global-nav > ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.1rem, 0.8vw, 0.4rem);
    justify-content: center;
}
.global-nav li { position: relative; }
.global-nav ul li a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #d4d4dc;
    min-height: 44px;
    border-radius: 999px;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
header.scrolled .global-nav ul li a { text-shadow: none; color: var(--muted); }
.global-nav ul li a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.3rem;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s var(--ease);
}
.global-nav ul li a:hover,
.global-nav ul li:hover > a {
    color: var(--text);
}
.global-nav ul li a:hover::after {
    width: 22px;
}

/* dropdowns (kept for compatibility) */
.dropdown-content,
.sub-dropdown-content {
    display: none;
    position: absolute;
    background: var(--surface);
    min-width: 220px;
    box-shadow: var(--shadow);
    z-index: 1001;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0;
    border: 1px solid var(--line);
    list-style: none;
}
.dropdown:hover > .dropdown-content,
.dropdown:focus-within > .dropdown-content { display: block; }
.dropdown-content a, .sub-dropdown-content a {
    color: var(--muted);
    padding: 0.7rem 1.4rem;
    display: block;
    text-align: left;
    font-weight: 400;
}
.dropdown-content a:hover, .sub-dropdown-content a:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* =================================================================
   Hero — full-screen slideshow
   ================================================================= */
#hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    padding: calc(var(--header-h) + 2rem) 1.25rem 4rem;
}

.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: -2;
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
}
.hero-slide.active {
    opacity: 1;
}
/* leaving = フェードアウト中もズームを継続させるためのクラス（JSが付与） */
.hero-slide.active,
.hero-slide.leaving {
    animation: kenburns 8s ease-out forwards;
}
@keyframes kenburns {
    from { transform: scale(1.12); }
    to   { transform: scale(1.0); }
}
/* dark cinematic overlay */
#hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(11,11,15,0.55) 0%, rgba(11,11,15,0.35) 40%, rgba(11,11,15,0.92) 100%),
        radial-gradient(80% 60% at 50% 45%, transparent, rgba(11,11,15,0.5));
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 900px; }
.hero-content .avatar {
    width: clamp(78px, 14vw, 104px);
    height: clamp(78px, 14vw, 104px);
    border-radius: 50%;
    margin: 0 auto 1.6rem;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.hero-eyebrow {
    font-family: var(--font-display);
    font-size: clamp(0.72rem, 2vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.1rem;
}
.hero-content h1 {
    font-size: clamp(2.8rem, 11vw, 6.5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 0.98;
    text-shadow: 0 6px 40px rgba(0,0,0,0.5);
}
.hero-content .subtitle {
    margin-top: 1.4rem;
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    color: rgba(244,244,246,0.86);
    font-weight: 300;
    letter-spacing: 0.04em;
}
.hero-buttons {
    margin-top: 2.4rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 1.7rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}
.scroll-cue .mouse {
    width: 22px;
    height: 36px;
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    position: relative;
}
.scroll-cue .mouse::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 7px;
    width: 3px;
    height: 7px;
    background: var(--accent);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: wheel 1.6s var(--ease) infinite;
}
@keyframes wheel {
    0% { opacity: 0; transform: translate(-50%, 0); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* =================================================================
   Buttons
   ================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.9rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(6px);
    transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--text);
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #1a1206;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(233,184,114,0.28);
}
.btn-primary:hover {
    color: #1a1206;
    box-shadow: 0 14px 38px rgba(233,184,114,0.4);
}

/* =================================================================
   Category sections (home)
   ================================================================= */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: min(92vw, var(--maxw));
    margin-inline: auto;
}
.category-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}
.category-description {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.8;
}
.category-description h3 {
    color: var(--accent);
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
}

.tiles-wrapper {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 2vw, 1.6rem);
}
.tiles-wrapper .category-tile:only-child {
    grid-column: 1 / -1;
}

.category-tile {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    aspect-ratio: 16 / 10;
    min-height: 180px;
    border-radius: var(--radius);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.category-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.25) 45%, rgba(0,0,0,0.82) 100%);
    transition: background 0.5s var(--ease);
    z-index: 0;
}
.category-tile span {
    position: relative;
    z-index: 1;
    padding: 1.3rem 1.5rem;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 18px rgba(0,0,0,0.7);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: gap 0.4s var(--ease), color 0.3s var(--ease);
}
.category-tile span::after {
    content: '→';
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.category-tile:hover {
    transform: translateY(-6px) scale(1.012);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}
.category-tile:hover::before {
    background:
        linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.7) 100%);
}
.category-tile:hover span::after {
    opacity: 1;
    transform: translateX(0);
}

/* background images (unchanged paths) */
#cat-photo { background-image: url('../images/photography/thumb/images_photography_thumb_001.jpg'); }
#cat-family { background-image: url('../images/photography/family/thumb/images_photography_family_thumb_001.webp'); }
#cat-landscape { background-image: url('../images/photography/landscape/thumb/images_photography_landscape_thumb_001.webp'); }
#cat-artist { background-image: url('../images/photography/artist/thumb/images_photography_artist_thumb_001.webp'); }
#cat-school { background-image: url('../images/photography/school/thumb/images_photography_school_thumb_001.webp'); }
#cat-video { background-image: url('../images/videos/thumb/images_videos_thumb_001.jpg'); }
#cat-ai-img { background-image: url('../images/ai_images/thumb/images_ai_images_thumb_001.webp'); }
#cat-ai-vid { background-image: url('../images/ai_videos/thumb/images_ai_videos_thumb_001.jpg'); }
#cat-web { background-image: url('../images/web_sites/thumb/images_web_sites_thumb_002.webp'); }

/* =================================================================
   Work cards (web sites / generic grids)
   ================================================================= */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.2rem, 2.5vw, 2rem);
    width: min(92vw, var(--maxw));
    margin-inline: auto;
}
/* 動画が少ないページ用：justifiedGallery の対象外で中央寄せ・幅を抑える */
.movie-grid {
    max-width: min(92vw, 640px);
}
.work-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.work-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}
.work-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--bg-soft);
    transition: transform 0.5s var(--ease);
}
.work-card:hover img { transform: scale(1.05); }
.work-card-content { padding: 1.4rem 1.5rem; }
.work-card-content h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.work-card-content p { font-size: 0.9rem; color: var(--muted); }

/* =================================================================
   Sub-page header / breadcrumb
   ================================================================= */
.category-page {
    padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem));
}
.page-header {
    width: min(92vw, var(--maxw));
    margin: 0 auto clamp(2.5rem, 6vw, 4rem);
    text-align: center;
}
.page-header h1 {
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
}
.breadcrumb {
    text-align: center;
    margin-bottom: 1.2rem;
    color: var(--faint);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* photo category grouping (ai-images hub) */
.photo-category-group {
    width: min(95vw, var(--maxw));
    margin: 0 auto clamp(3rem, 7vw, 5rem);
    padding-top: clamp(2rem, 5vw, 3.5rem);
    border-top: 1px solid var(--line);
}
.photo-category-group:first-of-type { padding-top: 0; border-top: none; }
.photo-category-group h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}
.see-more-container { text-align: center; margin-top: 2.2rem; }

/* =================================================================
   Photo gallery
   ================================================================= */
.photo-gallery {
    width: min(95vw, var(--maxw));
    margin-inline: auto;
}
.photo-gallery.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}
.gallery-item {
    position: relative;
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
    filter: saturate(0.95);
}
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.45));
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.gallery-item:hover img {
    transform: scale(1.06);
    filter: saturate(1.1);
}
.gallery-item:hover::after { opacity: 1; }

/* justifiedGallery override */
.photo-gallery.justified-gallery > a > img,
.photo-gallery.justified-gallery > a > .caption { border-radius: 0; }

.gallery-item .badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    background: rgba(11,11,15,0.7);
    backdrop-filter: blur(6px);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    pointer-events: none;
}

/* video thumbnail play overlay */
.gallery-item[data-type="video"]::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0,0,0,0.25);
    transition: background 0.4s var(--ease);
}
.gallery-item[data-type="video"]:hover::before { background: rgba(0,0,0,0.1); }
.gallery-item[data-type="video"] .play-icon,
.gallery-item[data-type="video"]::after {
    pointer-events: none;
}
.gallery-item[data-type="video"] {
    background: #000;
}
.gallery-item[data-type="video"] > .play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 62px; height: 62px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(11,11,15,0.55);
    border: 1.5px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.gallery-item[data-type="video"] > .play-btn::after {
    content: '';
    margin-left: 3px;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}
.gallery-item[data-type="video"]:hover > .play-btn {
    transform: translate(-50%, -50%) scale(1.12);
    background: var(--accent);
}
.gallery-item[data-type="video"]:hover > .play-btn::after {
    border-color: transparent transparent transparent #1a1206;
}

/* =================================================================
   About
   ================================================================= */
.about-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3.5rem);
    width: min(92vw, var(--maxw));
    margin-inline: auto;
    align-items: start;
}
.about-avatar img,
.about-photo {
    width: 100%;
    max-width: 360px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    margin: 0 auto;
    float: none;
}
.about-bio { max-width: 720px; }
.about-bio h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    margin: 2rem 0 0.9rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
}
.about-bio h4:first-of-type { margin-top: 0; }
.about-bio p, .about-bio ul { margin-bottom: 1rem; color: var(--muted); }
.about-bio ul { list-style: none; padding-left: 0; }
.about-bio ul li {
    padding-left: 1.4em;
    position: relative;
    margin-bottom: 0.5rem;
}
.about-bio ul li::before {
    content: '';
    position: absolute;
    left: 0.2em;
    top: 0.7em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.about-bio .note { font-size: 0.85rem; color: var(--faint); margin-top: 1.8rem; }

/* =================================================================
   Review (home + page)
   ================================================================= */
.review-container {
    width: min(92vw, var(--maxw));
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.2rem);
}
.review-item {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.8rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.review-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}
.review-image {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16 / 11;
}
.review-image img { width: 100%; height: 100%; object-fit: cover; }
.review-text h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 0.7rem;
}
.review-text p {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.85;
    position: relative;
}
.review-button-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* review page showcase */
.review-intro {
    text-align: center;
    width: min(90vw, 760px);
    margin: 0 auto clamp(3rem, 6vw, 4rem);
    color: var(--muted);
}
.review-showcase {
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 6vw, 5rem);
    width: min(92vw, 1100px);
    margin-inline: auto;
}
.review-showcase-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "photo" "text";
    gap: clamp(1.2rem, 2.5vw, 2rem);
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.5rem);
}
.work-display {
    grid-area: photo;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.work-display.no-image {
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: var(--faint);
}
.work-display img { width: 100%; height: 100%; object-fit: cover; }
.work-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
}
.review-content { display: contents; }
.review-header { grid-area: title; }
.review-header h3 { font-size: 1.5rem; color: var(--accent); }
.review-body { grid-area: text; display: grid; gap: 1.1rem; }
.review-body p { color: var(--muted); line-height: 1.85; margin: 0; }

@media (min-width: 900px) {
    .review-showcase-item {
        grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr);
        grid-template-areas: "title title" "photo text";
        gap: clamp(2rem, 3vw, 3rem);
    }
}

/* =================================================================
   Contact
   ================================================================= */
.contact-simple, #contact .container { text-align: center; }
.contact-cta {
    width: min(92vw, 760px);
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(160deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
}
.contact-cta p { color: var(--muted); margin: 1rem auto 2rem; max-width: 48ch; }
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.x-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.04);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.x-btn:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--accent);
    background: rgba(233,184,114,0.1);
}
.x-btn img { width: 60%; height: 60%; object-fit: contain; }

/* =================================================================
   Footer
   ================================================================= */
footer {
    text-align: center;
    padding: clamp(2.5rem, 5vw, 3.5rem) 1rem;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

/* =================================================================
   Lightbox (custom)
   ================================================================= */
.custom-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(6,6,9,0.94);
    backdrop-filter: blur(8px);
    display: none;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    justify-content: center;
    align-items: center;
}
.custom-lightbox-content {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
    animation: lb-zoom 0.5s var(--ease);
}
@keyframes lb-zoom { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.custom-lightbox-close {
    position: absolute;
    top: 1.2rem; right: 1.6rem;
    color: #fff;
    font-size: 2.4rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 1002;
    line-height: 1;
    transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.custom-lightbox-close:hover { color: var(--accent); transform: rotate(90deg); }
.custom-lightbox-caption {
    position: absolute;
    bottom: 1.3rem; left: 0; right: 0;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}
.custom-lightbox-prev,
.custom-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    color: #fff;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s var(--ease);
    z-index: 1001;
}
.custom-lightbox-prev:hover,
.custom-lightbox-next:hover {
    background: var(--accent);
    color: #1a1206;
    border-color: transparent;
}
.custom-lightbox-prev { left: clamp(0.8rem, 2vw, 1.8rem); }
.custom-lightbox-next { right: clamp(0.8rem, 2vw, 1.8rem); }
.custom-lightbox-video-container {
    position: relative;
    width: 90vw;
    height: 50.625vw;
    max-width: min(96vw, 1500px);
    max-height: 86vh;
}
.custom-lightbox-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: 0;
    border-radius: 6px;
}

/* legacy lightbox (video pages still using #lightbox) */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(6,6,9,0.94);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox-content { max-width: 88vw; max-height: 86vh; }
#lightbox-video { width: 88vw; height: 49.5vw; max-width: min(95vw,1400px); max-height: 86vh; }
.lightbox-close {
    position: absolute; top: 1.2rem; right: 1.6rem;
    color: #fff; font-size: 2.4rem; cursor: pointer; z-index: 1002;
}
.lightbox-close:hover { color: var(--accent); }
.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: #fff; font-size: 1.6rem; cursor: pointer; z-index: 1001;
    background: rgba(255,255,255,0.06); border: 1px solid var(--line);
    width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all 0.3s var(--ease);
}
.lightbox-prev:hover, .lightbox-next:hover { background: var(--accent); color: #1a1206; }
.lightbox-prev { left: clamp(0.8rem,2vw,1.8rem); }
.lightbox-next { right: clamp(0.8rem,2vw,1.8rem); }
.lightbox-caption {
    position: absolute; bottom: 1.3rem; width: 100%; text-align: center;
    color: var(--muted); font-size: 0.9rem;
}

/* =================================================================
   Toast
   ================================================================= */
#toast {
    visibility: hidden;
    min-width: clamp(200px, 60vw, 320px);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    text-align: center;
    border-radius: 999px;
    padding: 0.9rem 1.5rem;
    position: fixed;
    z-index: 1003;
    left: 50%;
    transform: translateX(-50%);
    bottom: 2rem;
    font-size: 0.95rem;
}
#toast.show {
    visibility: visible;
    animation: fadein 0.4s, fadeout 0.4s 2.6s;
}
@keyframes fadein { from { bottom: 0; opacity: 0; } to { bottom: 2rem; opacity: 1; } }
@keyframes fadeout { from { bottom: 2rem; opacity: 1; } to { bottom: 0; opacity: 0; } }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 768px) {
    .tiles-wrapper { grid-template-columns: 1fr; }
    .category-tile { aspect-ratio: 16 / 10; }
    .about-container { justify-items: center; text-align: left; }
}

@media (min-width: 900px) {
    /* home category rows can sit side by side via .main-categories-row */
    .main-categories-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        width: 100%;
    }
}

/* Mobile nav: horizontal scroll chips */
@media (max-width: 767px) {
    .global-nav { justify-content: flex-start; }
    .global-nav > ul {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.5rem 0.25rem;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .global-nav > ul::-webkit-scrollbar { display: none; }
    .global-nav > ul > .nav-item > a {
        flex: 0 0 auto;
        white-space: nowrap;
        border: 1px solid var(--line);
        background: rgba(255,255,255,0.04);
    }
    .global-nav .dropdown-content,
    .global-nav .sub-dropdown-content { display: none !important; }
    header { background: rgba(11,11,15,0.85); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
}

/* anchor offset */
main { scroll-margin-top: var(--header-h); }
#hero, #photography, #videos, #ai-creat, #coding, #about, #review, #contact {
    scroll-margin-top: var(--header-h);
}

/* Mobile masonry for galleries */
@media (max-width: 767px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 8px;
    }
    .gallery-masonry .gallery-item {
        break-inside: avoid;
        margin-bottom: 8px;
        display: block;
        border-radius: 8px;
    }
    .gallery-masonry img { width: 100%; height: auto; }
}

@media (max-width: 600px) {
    .hero-content h1 { font-size: clamp(2.6rem, 16vw, 4rem); }
    .contact-cta { padding: 2.5rem 1.25rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .hero-slide.active,
    .hero-slide.leaving { animation: none; transform: scale(1); }
}
