/* =========================================================
   Yuya Hakozaki — Photographer Portfolio
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600;700&family=Shippori+Mincho+B1:wght@400;500;600;700&family=Noto+Sans+JP:wght@300;400;500&family=Jost:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Dancing+Script:wght@500&family=Cinzel:wght@400;500&display=swap');

:root{
  --bg: #131210;
  --bg-deep: #0b0a09;
  --ink: #f1ece1;
  --ink-soft: #9d968a;
  --line: rgba(241,236,225,0.14);
  --accent: #c9573f;
  --paper: #1c1a17;
  --dur-s: .5s;
  --dur-m: .9s;
  --dur-l: 1.4s;
  --ease: cubic-bezier(.22,1,.36,1);
  --nav-h: 84px;
  --font-en: 'Jost', sans-serif;
  /* Trajan Pro 3 isn't a web font Anthropic/Google can serve — Cinzel is the
     standard free stand-in (same inscriptional-Roman-capitals feel), used
     for collection/place names specifically, not general UI text. */
  --font-name: 'Cinzel', 'Jost', serif;
  --font-jp: 'Shippori Mincho', serif;
  --font-jp-hero: 'Shippori Mincho B1', 'Shippori Mincho', serif;
  --font-jp-body: 'Noto Sans JP', sans-serif;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

/* The home page no longer forces a stop at each section boundary — plain
   smooth scrolling (set on <html> above) reads better than the earlier
   mandatory scroll-snap, which fought fast flicks and made the page feel
   like it was fighting the user. Anchor nav clicks still glide smoothly
   to their target since scroll-behavior:smooth is in effect. */

/* Fixed full-viewport color layer, sat behind every section. JS (see
   initBackgroundFade in main.js) interpolates its background-color as
   each section scrolls into view, so the page's background eases from
   one tone to the next instead of hard-cutting at the section boundary.
   The sections themselves stay transparent — see below. */
.bg-fade{
  position: fixed; inset:0; z-index:-1;
  background: var(--bg-deep);
}

body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en), var(--font-jp-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.jp{ font-family: var(--font-jp); font-weight:400; }
.jp-hero{ font-family: var(--font-jp-hero); font-weight:400; }

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style:none; margin:0; padding:0; }
h1,h2,h3,h4,p{ margin:0; font-weight:400; }
button{ font-family: inherit; background:none; border:none; padding:0; margin:0; color: inherit; cursor:pointer; }

.container{ width:100%; max-width:1400px; margin:0 auto; padding:0 48px; }

/* corner marks */
.corner{
  position: fixed;
  font-size: 20px;
  color: var(--ink);
  opacity:.28;
  z-index: 40;
  font-weight:300;
  pointer-events:none;
}
.corner.tl{ top: 96px; left: 26px; }
.corner.tr{ top: 96px; right: 26px; }
.corner.bl{ bottom: 26px; left: 26px; }
.corner.br{ bottom: 26px; right: 26px; }

/* -------------------- Loader -------------------- */
#loader{
  position: fixed; inset:0; background: var(--bg);
  z-index: 999; display:flex; align-items:center; justify-content:center;
  transition: opacity var(--dur-m) var(--ease), visibility var(--dur-m) var(--ease);
}
#loader.hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.loader-mark{
  font-family: var(--font-en); font-weight:300; font-size: 14px; letter-spacing:.3em;
  color: var(--ink-soft); overflow:hidden;
}
.loader-mark span{ display:inline-block; transform: translateY(110%); animation: riseIn .8s var(--ease) forwards; }
@keyframes riseIn{ to{ transform: translateY(0); } }

/* -------------------- Nav -------------------- */
.site-nav{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  display:flex; align-items:center; justify-content:space-between;
  padding: 26px 40px; gap: 20px;
}
.site-nav .logo{
  font-family: var(--font-en); font-size:14px; letter-spacing:.2em; font-weight:500;
  color: var(--ink); white-space:nowrap; flex-shrink:0;
}
.nav-right{ display:flex; align-items:center; gap:22px; flex-shrink:0; }
/* The "Index / Collection / About / Store / Contact" chooser is a dedicated
   full-screen selection screen (opened via .menu-toggle) rather than a
   plain inline row — a nod to ryo-konishi.com's numbered "00 — Index"
   layout, built with our own type and motion. */
.nav-links{
  position: fixed; top:0; right:0; bottom:0; width: 66.6667vw; z-index:90;
  /* A dark wine/burgundy found nowhere else in the section palette (hero
     black, index indigo, about brown, equipment green, contact teal) —
     so the panel always reads as its own surface instead of blending into
     whichever section happens to be open behind it. */
  background: #1c0a10;
  border-radius: 32px 0 0 32px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 4px;
  pointer-events:none;
  /* Grows outward from the menu button as a circle, like jafmate.jp's menu
     reveal, instead of a plain fade/slide. --menu-origin-x/y are set in JS
     relative to this panel's own box (not the viewport), since clip-path's
     default reference box is the element itself. */
  clip-path: circle(0% at var(--menu-origin-x, 100%) var(--menu-origin-y, 46px));
  transition: clip-path .85s var(--ease);
}
.nav-links.open{
  pointer-events:auto;
  clip-path: circle(150% at var(--menu-origin-x, 100%) var(--menu-origin-y, 46px));
}
.nav-links a{
  position:relative; display:flex; align-items:baseline; gap:28px;
  font-family: var(--font-jp-hero); font-weight:400; font-size: clamp(22px, 3.2vw, 52px);
  color: var(--ink); white-space:nowrap;
  /* % rather than vw — the panel is only 2/3 of the viewport now, so a
     vw-based width (sized for the old full-screen overlay) would overflow
     its own narrower container. */
  padding: 12px 0; width: 82%;
  border-bottom: 1px solid var(--line);
  opacity:0; transform: translateY(24px);
}
.nav-links a::before{
  content: attr(data-num);
  font-family: var(--font-en); font-size:12px; letter-spacing:.2em; color: var(--ink-soft);
  min-width:34px; flex-shrink:0;
}
.nav-links a:hover, .nav-links a.active{ color: var(--accent); }
.nav-links a:hover::before, .nav-links a.active::before{ color: var(--accent); }

.nav-social{ display:flex; gap:14px; align-items:center; flex-shrink:0; }
.nav-social a{ white-space:nowrap; }
.nav-social a{ font-size:13px; opacity:.75; }
.nav-social a:hover{ opacity:1; }

/* -------------------- Hero -------------------- */
/* The section is taller than one screen, but its content is pinned via
   position:sticky — so scrolling through it holds the hero on screen for
   longer (more scroll distance before About appears) instead of just
   handing off to the next section after a single viewport-height flick. */
.hero{
  position:relative; height:150vh; width:100%;
}
.hero-pin{
  position:sticky; top:0; height:100vh; width:100%; overflow:hidden;
  display:flex; align-items:flex-end;
}
.hero-media{
  position:absolute; inset:0; overflow:hidden;
}
/* Two stacked layers crossfade between photos (JS toggles .active's
   opacity via GSAP); each layer also gets a slow Ken Burns zoom while
   it's the current one. */
.hero-media .slide{
  position:absolute; inset:0; opacity:0;
}
.hero-media .slide.active{ opacity:1; }
.hero-media .slide img{
  width:100%; height:100%; object-fit:cover;
  transform: scale(1.12);
  filter: saturate(1.02);
}
.hero-media .slide.zoom img{ animation: heroZoom 7s linear forwards; }
@keyframes heroZoom{ to{ transform: scale(1); } }
.hero-media::after{
  content:''; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(6,5,4,.32) 0%, rgba(6,5,4,.05) 35%, rgba(6,5,4,.12) 70%, rgba(6,5,4,.55) 100%);
}

.hero-copy{
  position:relative; z-index:5; padding: 0 48px 260px;
  display:flex; align-items:flex-end; gap:26px;
}
.hero-copy-text{ display:flex; flex-direction:column; gap:18px; }
.hero-eyebrow{
  font-family: var(--font-en);
  font-size:12px; letter-spacing:.28em; text-transform:uppercase;
  color: rgba(241,236,225,.82); overflow:hidden;
}
.hero-eyebrow span{ display:inline-block; transform: translateY(120%); }

.hero-title{
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: clamp(15px, 3.3vh, 29px);
  line-height:1.5;
  color:#f7f4ec;
  letter-spacing:.08em;
  height: auto;
}
.hero-title .line{ overflow:hidden; display:block; height:100%; }
.hero-title .line span{ display:inline-block; transform: translateY(110%); }

.hero-sub{
  font-family: var(--font-en);
  font-size:12px; letter-spacing:.06em; color: rgba(241,236,225,.68);
  max-width: 180px; overflow:hidden; line-height:1.7;
}
.hero-sub span{ display:inline-block; transform: translateY(120%); }

.scroll-cue{
  position:absolute; right:48px; top: calc(var(--nav-h) + 30px); bottom:40px; z-index:6;
  width:1px;
  color: rgba(241,236,225,.92); font-family: var(--font-en); font-size:12px; letter-spacing:.24em; text-transform:uppercase;
}
.scroll-cue .line-anim{
  position:absolute; inset:0; background: rgba(241,236,225,.32); overflow:hidden;
}
/* The moving glow travels bottom-to-top through the line — "bottom" is
   animated (not "top") specifically so it rises rather than drops. */
.scroll-cue .line-anim::after{
  content:''; position:absolute; bottom:-100%; left:0; width:100%; height:100%;
  background: #fff; box-shadow: 0 0 8px 1px rgba(255,255,255,.8);
  animation: cueRise 2.4s ease-in-out infinite;
}
@keyframes cueRise{ 0%{ bottom:-100%; } 60%{ bottom:100%; } 100%{ bottom:100%; } }

/* "Scroll" sits at the line's midpoint and glows in sync with the light
   passing that point on its way up (roughly a third of the way through
   the rise, since the rise itself only spans the first 60% of the cycle). */
.scroll-cue .cue-word{
  position:absolute; top:50%; left:50%;
  /* Shifted left off the line itself — sitting centered ON it put the
     line right through the middle of the letters. */
  transform:translate(calc(-50% - 20px), -50%);
  /* Vertical, matching the line it sits on — also keeps it narrow enough
     to never overflow the viewport edge on phone-width screens, unlike a
     horizontal "SCROLL" centered this close to the edge. */
  writing-mode: vertical-rl; text-orientation: mixed;
  white-space:nowrap;
  animation: cueWordGlow 2.4s ease-in-out infinite;
}
@keyframes cueWordGlow{
  0%, 15%{ color: rgba(241,236,225,.92); text-shadow:none; }
  30%{ color:#fff; text-shadow: 0 0 10px rgba(255,255,255,.85), 0 0 22px rgba(255,255,255,.5); }
  45%, 100%{ color: rgba(241,236,225,.92); text-shadow:none; }
}

.hero-mark{
  position:absolute; left:48px; bottom:44px; z-index:6;
  display:flex; align-items:center; gap:10px; color:#f7f4ec;
  font-family: var(--font-en);
}
.hero-mark .dot{ width:10px; height:10px; border-radius:50%; background: var(--accent); }
.hero-mark span{ font-size:11px; letter-spacing:.18em; text-transform:uppercase; }

/* -------------------- Section shell -------------------- */
.section{ position:relative; padding: 160px 0; }
.section-tight{ padding: 110px 0; }

/* Each major area gets its own subtly distinct dark tone instead of one
   flat background, so the page reads as a sequence of rooms rather than
   a single slab — still all dark, just not identical. */
/* #about / #contact backgrounds are now driven by .bg-fade (see above) so
   they can ease between tones on scroll instead of cutting hard; the colors
   themselves live in main.js's initBackgroundFade stop list — keep both in
   sync if you change one. */
body.page-collection{ background: #1a1a1a; }
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom: 70px; gap: 40px; flex-wrap:wrap;
}
.kicker{
  font-family: var(--font-en);
  font-size:12px; letter-spacing:.28em; text-transform:uppercase; color: var(--ink-soft);
  display:flex; align-items:center; gap:14px;
}
.kicker::before{ content:''; width:28px; height:1px; background: var(--ink-soft); }
.section-title{
  font-family: var(--font-jp); font-weight:400; font-size: clamp(30px,4vw,56px); line-height:1.3;
}
.section-desc{ font-family: var(--font-en), var(--font-jp-body); font-weight:300; max-width:460px; font-size:14px; line-height:1.9; color: var(--ink-soft); }

.reveal{ overflow:hidden; }
.reveal-inner{ transform: translateY(110%); opacity:0; }

.fade-up{ opacity:0; transform: translateY(48px); }
.fade-in{ opacity:0; }

/* -------------------- About -------------------- */
.about-grid{
  display:grid; grid-template-columns: 0.9fr 1.1fr; gap: 90px; align-items:center;
}
.about-photo{
  position:relative; overflow:hidden; aspect-ratio: 4/5;
}
.about-photo img{ width:100%; height:100%; object-fit:cover; transition: transform 1.2s var(--ease); }
.about-photo:hover img{ transform: scale(1.06); }
.about-photo .frame{
  position:absolute; inset:18px; border:1px solid rgba(247,244,236,.4); pointer-events:none;
}
.about-name{ font-family: var(--font-en); font-weight:500; font-size:14px; letter-spacing:.2em; margin-bottom:26px; color: var(--ink-soft); text-transform:uppercase; }
.about-text p{ font-family: var(--font-jp-body); font-weight:300; font-size:15px; line-height:2.05; color: var(--ink); margin-bottom:20px; }
.about-text p:last-child{ margin-bottom:0; }
.about-text .en{ font-family: var(--font-en); font-size:13px; color: var(--ink-soft); line-height:1.95; }

/* -------------------- Equipment -------------------- */
.gear-grid{
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 0;
  border-top:1px solid var(--line);
}
.gear-col{ padding-right: 60px; }
.gear-col + .gear-col{ padding-left:60px; padding-right:0; border-left:1px solid var(--line); }
.gear-label{ font-family: var(--font-en); font-size:11px; letter-spacing:.24em; text-transform:uppercase; color: var(--ink-soft); margin: 38px 0 18px; }
.gear-list li{
  display:flex; align-items:baseline; justify-content:space-between;
  padding: 16px 0; border-bottom:1px solid var(--line);
  font-family: var(--font-en); font-size: 15px; letter-spacing:.01em;
}
.gear-list li .idx{ font-size:11px; color: var(--ink-soft); width:28px; }
.gear-list li .name{ flex:1; padding: 0 18px; }
.gear-list li .tag{ font-size:10px; color: var(--ink-soft); letter-spacing:.1em; text-transform:uppercase; }

/* -------------------- Index menu (Collection / Store peek-carousel) --------------------
   Collection and Store slide past each other with the next one peeking in
   at the edge (see initIndexCarousel in main.js) — smaller cards than the
   old single big face, in the spirit of ryo-konishi.com's index section,
   with jafmate.jp-style prev/next arrows instead of a 3D flip. */
.index-carousel{
  display:flex; align-items:center; justify-content:center; gap:18px;
}
.ic-viewport{
  overflow:hidden;
  width: min(340px, 76vw);
}
.ic-track{
  display:flex; gap:20px;
  transition: transform .9s var(--ease);
}
.ic-track .index-card{
  width: min(280px, 66vw); flex-shrink:0; aspect-ratio: 3/4;
}
.ic-arrow{
  flex-shrink:0; width:40px; height:40px; border-radius:50%;
  border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
  font-family: var(--font-en); font-size:20px; color: var(--ink-soft);
  transition: color .3s ease, border-color .3s ease;
}
.ic-arrow:hover{ color: var(--ink); border-color: var(--ink-soft); }

.ir-tabs{ display:flex; justify-content:center; gap:40px; margin-top:24px; }
.ir-tab{
  font-family: var(--font-en); font-size:12px; letter-spacing:.2em; text-transform:uppercase;
  color: var(--ink-soft); opacity:.45; padding:6px 0;
  transition: opacity .4s var(--ease), color .4s var(--ease), text-shadow .4s var(--ease);
}
.ir-tab.active{
  color: var(--ink); opacity:1;
  text-shadow: 0 0 10px rgba(241,236,225,.55), 0 0 22px rgba(201,87,63,.45);
}

.index-card{
  position:relative; overflow:hidden; aspect-ratio: 3/4; background:#111;
  display:block; transform-style: preserve-3d; will-change: transform;
}
.index-card .ic-num{
  position:absolute; top:18px; left:18px; z-index:2; color:#f7f4ec;
  font-family: var(--font-en); font-size:11px; letter-spacing:.16em;
  opacity:.8;
}
.index-card .ic-img-wrap{ position:absolute; inset:0; clip-path: inset(100% 0 0 0); }
.index-card.revealed .ic-img-wrap{ transition: clip-path 1.1s var(--ease); clip-path: inset(0 0 0 0); }
.index-card .ic-img-wrap img{ width:100%; height:100%; object-fit:cover; transition: transform 1.4s var(--ease); transform: scale(1.12); }
.index-card.revealed .ic-img-wrap img{ transition: transform 1.4s var(--ease); transform: scale(1); }
.index-card:hover .ic-img-wrap img{ transform: scale(1.08) !important; }
.index-card::after{
  content:''; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.72) 100%);
}
.index-card .ic-body{
  position:absolute; left:22px; bottom:20px; right:22px; z-index:2; color:#f7f4ec;
  display:flex; flex-direction:column; gap:6px; transition: transform .5s var(--ease);
}
.index-card:hover .ic-body{ transform: translateY(-4px); }
.index-card .ic-label{ font-size:16px; letter-spacing:.14em; text-transform:uppercase; opacity:.94; }
.index-card .ic-desc{
  font-family: var(--font-en), var(--font-jp-body); font-weight:300; font-size:12px;
  line-height:1.6; color: rgba(247,244,236,.68); max-width:88%;
}
.index-card .ic-view{
  position:absolute; inset:0; z-index:3; display:flex; align-items:center; justify-content:center;
  opacity:0; transition: opacity .4s var(--ease); pointer-events:none;
}
.index-card:hover .ic-view{ opacity:1; }
.index-card .ic-view span{
  width:76px; height:76px; border-radius:50%; border:1px solid rgba(247,244,236,.7);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-en); font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:#f7f4ec;
  backdrop-filter: blur(2px);
  transform: scale(.7);
  transition: transform .4s var(--ease);
}
.index-card:hover .ic-view span{ transform: scale(1); }

/* -------------------- Contact -------------------- */
.contact-wrap{
  display:grid; grid-template-columns: 1fr 1fr; gap: 90px;
}
.contact-big{
  font-family: var(--font-jp-body); font-weight:300; font-size: clamp(22px,2.6vw,34px); line-height:1.7;
}
.contact-big .en-line{ font-family: var(--font-en); font-size:.55em; color: var(--ink-soft); }
.contact-info{ display:flex; flex-direction:column; gap: 30px; }
.contact-row{ display:flex; flex-direction:column; gap:6px; border-bottom:1px solid var(--line); padding-bottom:20px; }
.contact-row .label{ font-family: var(--font-en); font-size:11px; letter-spacing:.22em; text-transform:uppercase; color: var(--ink-soft); }
.contact-row .value{ font-family: var(--font-en); font-size:16px; }
.contact-row a.value:hover{ color: var(--accent); }
.contact-note{
  font-family: var(--font-jp-body); font-weight:300; font-size:12px; line-height:1.9;
  color: var(--ink-soft); margin-top: 48px; padding-top:28px; border-top:1px solid var(--line);
}

/* -------------------- Footer -------------------- */
.site-footer{
  padding: 46px 0; border-top:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  font-family: var(--font-en); font-size:11px; letter-spacing:.12em; color: var(--ink-soft); text-transform:uppercase;
}

/* ============================================================
   COLLECTION LISTING PAGE
   ============================================================ */
.coll-hero{
  padding: calc(var(--nav-h) + 90px) 0 60px;
}
.coll-hero .section-title{ font-size: clamp(34px,5vw,64px); font-family: var(--font-name); letter-spacing:.02em; }
.coll-filter{
  display:flex; flex-wrap:wrap; gap: 10px 26px; margin-top: 46px;
  border-top:1px solid var(--line); padding-top: 26px;
}
.coll-filter button{
  font-family: var(--font-en); font-size:12px; letter-spacing:.14em; text-transform:uppercase;
  color: var(--ink-soft); padding: 6px 0; position:relative;
}
.coll-filter button::after{
  content:''; position:absolute; left:0; right:0; bottom:0; height:1px; background: var(--ink);
  transform: scaleX(0); transition: transform .35s var(--ease);
}
.coll-filter button.active{ color: var(--ink); }
.coll-filter button.active::after{ transform: scaleX(1); }
.coll-filter button:hover{ color: var(--ink); }

/* -------------------- Region switcher (iOS app-switcher style) --------------------
   Every collection lives in this one continuous horizontal stack (region-
   grouped), the centered card full-size and the rest receding in
   scale/opacity as they drift from center (see updateSwitcherDepth in
   collection.js) — closer to flipping through iOS's app switcher than a
   grid. The region buttons above are jump shortcuts + a scroll-spy, not a
   filter — there's no separate grid view anymore. */
.coll-switcher-wrap{ overflow:hidden; }
.coll-switcher{
  /* Narrower than the card felt at first (74vw) so there's always real,
     visible room left over for the next card to peek in — at 74vw on a
     phone-width screen the leftover space was almost entirely eaten by
     the inter-card gap, leaving only a sliver too thin to read as "swipe
     for more". */
  --cs-card-w: min(300px, 62vw);
  display:none; gap:16px; align-items:center;
  overflow-x:auto; overflow-y:visible;
  /* Side padding = half the viewport minus half a card, so the first (and
     last) card's CENTER lands on the viewport's center at rest — padding
     alone (without the card-width term) only centered the card's edge,
     which is what made the opening view look pushed to the right. */
  padding: 30px calc(50vw - var(--cs-card-w) / 2) 120px;
  scroll-snap-type: x proximity;
  scrollbar-width:none;
}
.coll-switcher::-webkit-scrollbar{ display:none; }
.coll-switcher.active{ display:flex; }
.cs-card{
  position:relative; flex-shrink:0; scroll-snap-align:center; cursor:pointer;
  width: var(--cs-card-w); aspect-ratio:3/4; overflow:hidden;
  background:#111; box-shadow: 0 30px 70px rgba(0,0,0,.55);
  transition: transform .2s ease, opacity .2s ease;
}
.cs-card img{ width:100%; height:100%; object-fit:cover; }
.cs-card::after{
  content:''; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.75) 100%);
}
.cs-card .cs-label{
  position:absolute; left:24px; bottom:22px; right:24px; z-index:2; color:#f7f4ec;
}
.cs-card .cs-label .en{
  font-family: var(--font-name); font-size:19px; letter-spacing:.08em; text-transform:uppercase;
}
.cs-card .cs-count{
  position:absolute; top:18px; right:18px; z-index:2; color:#f7f4ec;
  font-family: var(--font-en); font-size:11px; letter-spacing:.12em;
}
/* -------------------- Gallery overlay -------------------- */
.gallery-overlay{
  position: fixed; inset:0; z-index: 500; background: var(--bg);
  transform: translateY(100%); transition: transform .7s var(--ease);
  overflow-y:auto;
}
.gallery-overlay.open{ transform: translateY(0); }
.gallery-top{
  position:sticky; top:0; z-index:5; background: var(--bg);
  display:flex; align-items:center; justify-content:space-between;
  padding: 26px 48px; border-bottom:1px solid var(--line); gap:20px;
}
.gallery-title{ display:flex; flex-direction:column; }
.gallery-title .en{ font-family: var(--font-name); font-weight:400; font-size:20px; letter-spacing:.04em; color: var(--ink); }

.gallery-controls{ display:flex; align-items:center; gap:26px; }

.gallery-close{
  display:flex; align-items:center; gap:10px; font-family: var(--font-en); font-size:12px; letter-spacing:.16em; text-transform:uppercase;
}
.gallery-close .x{ font-size:20px; font-weight:300; }

/* -------------------- Rail view: big image + side thumbnail rail --------------------
   Loosely inspired by ryo-konishi.com's collection viewer (category panel +
   large photo + thumbnail rail + counter), rebuilt with our own layout,
   type and a crossfade transition instead of a plain image swap. */
.rail-view{
  display:flex;
  height: calc(100vh - 85px);
}

.rail-info{
  width: 240px; flex-shrink:0;
  display:flex; flex-direction:column; justify-content:center;
  padding: 0 40px; gap: 18px;
  border-right: 1px solid var(--line);
}
.rail-cat-en{
  font-family: var(--font-name); font-weight:400; font-size:24px; letter-spacing:.03em; color: var(--ink);
}
.rail-meter{
  width:100%; height:1px; background: var(--line); position:relative; overflow:hidden;
}
.rail-meter .fill{
  position:absolute; top:0; left:0; height:100%; width:0%;
  background: var(--ink); transition: width .4s var(--ease);
}
.rail-count{
  font-family: var(--font-en); font-size:12px; letter-spacing:.14em; color: var(--ink-soft);
}
.rail-count .sep{ margin: 0 6px; opacity:.5; }

.rail-stage{
  flex:1; position:relative; display:flex; align-items:center; justify-content:center;
  padding: 30px 70px; min-width:0;
}
/* inline-flex so this box shrink-wraps to the image's own rendered size
   (object-fit:contain can letterbox within a larger container) — that
   lets the credit be positioned "inside" the photo's actual bottom edge
   rather than floating in empty flex space below a tall/narrow image. */
.rail-main-wrap{
  display:flex; flex-direction:column; align-items:center; gap:14px;
  max-width:100%; max-height:100%; min-height:0;
}
.rail-main{ position:relative; display:inline-flex; max-width:100%; min-height:0; }
.rail-main img{
  display:block; max-width:100%; max-height: calc(100vh - 190px); width:auto; height:auto;
  object-fit:contain;
}
.rail-credit{
  position:absolute; left:50%; bottom:14px; transform:translateX(-50%);
  font-family: 'Dancing Script', cursive; font-weight:500; font-size:13px; letter-spacing:.02em;
  color: rgba(255,255,255,.10);
  text-shadow: 0 1px 2px rgba(0,0,0,.15); pointer-events:none;
}
.rail-caption{
  font-family: var(--font-name); font-size:14px; letter-spacing:.08em;
  color: var(--ink-soft); text-align:center; flex-shrink:0;
}
.rail-caption .yr{ opacity:.6; margin-left:.6em; }
.rail-nav{
  position:absolute; top:50%; transform:translateY(-50%); z-index:4;
  font-family: var(--font-en); font-size:30px; color: var(--ink-soft);
  width:48px; height:48px; display:flex; align-items:center; justify-content:center;
  transition: color .3s ease;
}
.rail-nav:hover{ color: var(--ink); }
.rail-nav.prev{ left:14px; }
.rail-nav.next{ right:14px; }

.rail-strip{
  width: 104px; flex-shrink:0;
  overflow-y:auto; scrollbar-width:none;
  display:flex; flex-direction:column; gap:8px;
  padding: 20px 16px; border-left: 1px solid var(--line);
  scroll-snap-type: y proximity;
}
.rail-strip::-webkit-scrollbar{ display:none; }
.rail-thumb{
  display:block; width:100%; aspect-ratio: 1/1; overflow:hidden; position:relative;
  opacity:.42; transition: opacity .35s var(--ease);
  scroll-snap-align: center;
  flex-shrink:0; /* without this, a column-flex .rail-strip taller than the
    viewport squeezes every thumb to fit instead of actually overflowing —
    which also meant the scroll container never truly scrolled, so the
    lazy-load IntersectionObserver saw all of them as "visible" at once. */
}
.rail-thumb img{ width:100%; height:100%; object-fit:cover; }
.rail-thumb:hover{ opacity:.75; }
.rail-thumb.active{ opacity:1; box-shadow: 0 0 0 2px var(--ink); }

/* -------------------- Recommended (jump to another collection) --------------------
   Sits below the fixed-height rail-view, reached by scrolling the overlay
   (which is overflow-y:auto) — picking a card re-runs openGallery() with a
   different slug, swapping the whole viewer in place. */
.rail-related{
  padding: 64px 48px 90px;
  border-top: 1px solid var(--line);
}
.rail-related-label{
  font-family: var(--font-en); font-size:12px; letter-spacing:.24em; text-transform:uppercase;
  color: var(--ink-soft); margin-bottom:28px;
}
.rail-related-list{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap:24px;
}
.rail-related-card{
  cursor:pointer; text-align:left; display:block; width:100%;
}
.rail-related-card .rr-img{
  position:relative; aspect-ratio:3/4; overflow:hidden; background:#111; margin-bottom:14px;
}
.rail-related-card .rr-img img{
  width:100%; height:100%; object-fit:cover; transition: transform .5s var(--ease);
}
.rail-related-card:hover .rr-img img{ transform: scale(1.06); }
.rail-related-card .en{
  font-family: var(--font-name); font-size:14px; letter-spacing:.06em; text-transform:uppercase; color: var(--ink);
}
.rail-related-card .rr-count{
  display:block; margin-top:4px; font-family: var(--font-en); font-size:11px; color: var(--ink-soft);
}

/* -------------------- Menu toggle (always visible; opens .nav-links) -------------------- */
.menu-toggle{
  display:flex; flex-direction:column; gap:5px; width:24px; z-index:110;
  flex-shrink:0;
}
.menu-toggle span{ height:1px; background: var(--ink); width:100%; transition: transform .3s ease, opacity .3s ease; }
.menu-toggle.open span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2){ opacity:0; }
.menu-toggle.open span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px){
  .about-grid{ grid-template-columns: 1fr; gap: 50px; }
  .about-photo{ max-width:420px; }
  .gear-grid{ grid-template-columns: 1fr; }
  .gear-col + .gear-col{ border-left:none; border-top:1px solid var(--line); padding-left:0; margin-top:10px; }
  .contact-wrap{ grid-template-columns:1fr; gap:50px; }
}

@media (max-width: 720px){
  .hide-mobile{ display:none; }
  .container{ padding: 0 20px; }
  .site-nav{ padding: 20px 20px; }
  .site-nav .logo{ font-size:13px; letter-spacing:.16em; }
  .nav-links a{ width: 92%; gap:16px; }
  .nav-links a::before{ min-width:26px; }
  .nav-social{ display:none; }

  .hero-copy{ padding: 0 20px 130px; gap:16px; }
  .hero-title{ font-size: clamp(14px, 3vh, 24px); height: auto; letter-spacing:.06em; }
  .hero-sub{ display:none; }
  .scroll-cue{ right:20px; top: calc(var(--nav-h) + 10px); bottom:26px; }
  .hero-mark{ left:20px; bottom:30px; }
  .hero-mark span{ display:none; }

  .section{ padding: 90px 0; }
  .section-head{ margin-bottom:40px; }
  .about-grid{ gap:36px; }
  .index-card .ic-view{ display:none; }
  .gallery-top{ padding: 18px 20px; flex-wrap:wrap; }
  .gallery-controls{ gap:14px; }
  .contact-wrap{ gap:36px; }
  .corner{ display:none; }

  .rail-view{ height: calc(100vh - 118px); flex-direction:column; }
  .rail-info{
    width:100%; flex-direction:row; align-items:center; justify-content:space-between;
    padding: 14px 18px; gap:14px; border-right:none; border-bottom:1px solid var(--line);
  }
  .rail-cat-en{ font-size:16px; }
  .rail-meter{ display:none; }
  .rail-stage{ padding: 14px 44px; flex:1; min-height:0; }
  .rail-main img{ max-height: calc(100vh - 260px); }
  .rail-credit{ bottom:10px; font-size:12px; }
  .rail-nav{ width:36px; height:36px; font-size:24px; }
  .rail-nav.prev{ left:0; }
  .rail-nav.next{ right:0; }
  .rail-strip{
    width:100%; flex-direction:row; overflow-x:auto; overflow-y:hidden;
    border-left:none; border-top:1px solid var(--line);
    padding: 12px 14px;
    /* Strip scrolls sideways here, not up/down — the snap axis (and the
       JS center-detection in collection.js) both need to match. */
    scroll-snap-type: x proximity;
  }
  .rail-thumb{ width:64px; flex-shrink:0; }
  .rail-related{ padding: 44px 20px 60px; }
  .rail-related-list{ grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap:16px; }
}
