/* ==========================================================================
   HOME / NOCTURNE INDEX
   Phase 1: cinematic hero, selected works, overlay navigation, and directory.
   ========================================================================== */

:root {
  --night: #030911;
  --night-soft: #07121d;
  --ink: #0a1622;
  --white: #eef2f3;
  --blue-gray: #82909d;
  --blue-gray-dark: #4b5a68;
  --gold: #b6a276;
  --line: rgba(150, 170, 185, .18);
  --line-strong: rgba(213, 223, 228, .34);
  --serif: "Shippori Mincho", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; background: var(--night); }
body.home-page { min-width: 320px; overflow-x: hidden; background: var(--night); color: var(--white); font-family: var(--sans); }
body.work-overlay-open { overflow: hidden; }
.home-page button, .home-page a { -webkit-tap-highlight-color: transparent; }
.home-page :focus-visible { outline: 1px solid var(--gold); outline-offset: 5px; }
.skip-link { z-index: 1000; }

/* Header */
.nocturne-header {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 0 clamp(24px, 4vw, 70px);
  color: var(--white);
  transition: background-color .3s ease, border-color .3s ease;
}
.nocturne-header.is-scrolled { background: rgba(3, 9, 17, .88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.nocturne-brand { display: inline-flex; align-items: center; gap: 16px; color: inherit; }
.nocturne-brand__mark { display: grid; place-items: center; width: 42px; aspect-ratio: 1; border: 1px solid rgba(182, 162, 118, .55); color: var(--gold); font: 500 .72rem/1 var(--serif); letter-spacing: .08em; }
.nocturne-brand__copy { font-size: .63rem; letter-spacing: .22em; }
.nocturne-nav { display: flex; align-items: center; gap: clamp(24px, 3vw, 50px); }
.nocturne-nav a, .nocturne-nav button { position: relative; padding: 12px 0; border: 0; background: none; color: inherit; font: 500 .68rem/1 var(--sans); letter-spacing: .22em; cursor: pointer; }
.nocturne-nav a::after, .nocturne-nav button::after { content: ""; position: absolute; right: 100%; bottom: 4px; left: 0; height: 1px; background: var(--gold); transition: right .3s ease; }
.nocturne-nav a:hover::after, .nocturne-nav button:hover::after, .nocturne-nav a:focus-visible::after, .nocturne-nav button:focus-visible::after { right: 0; }

/* Work overlay */
.work-overlay { position: fixed; z-index: 80; inset: 0; overflow-y: auto; background: rgba(3, 9, 17, .985); color: var(--white); }
.work-overlay[hidden] { display: none; }
.work-overlay::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 0 62%, rgba(91, 111, 130, .07)), radial-gradient(circle at 78% 22%, rgba(78, 99, 120, .13), transparent 32%); }
.work-overlay__bar { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 92px; padding: 0 clamp(24px, 4vw, 70px); border-bottom: 1px solid var(--line); }
.work-overlay__bar p, .work-overlay__bar button { color: var(--blue-gray); font-size: .62rem; letter-spacing: .2em; }
.work-overlay__bar button { min-height: 44px; border: 0; background: transparent; cursor: pointer; }
.work-overlay__bar button span { margin-left: 14px; color: var(--white); font-size: 1.2rem; }
.work-overlay__inner { position: relative; width: min(1120px, calc(100% - 80px)); margin: 0 auto; padding: clamp(70px, 10vh, 120px) 0 80px; }
.work-overlay__eyebrow { color: var(--gold); font-size: .6rem; letter-spacing: .22em; }
.work-overlay h2 { margin: 12px 0 clamp(38px, 6vh, 68px); font: 500 clamp(3.2rem, 7vw, 6rem)/1 var(--serif); letter-spacing: .02em; }
.work-overlay nav { border-top: 1px solid var(--line-strong); }
.work-overlay nav a { display: grid; grid-template-columns: 56px 1fr auto; gap: 20px; align-items: baseline; padding: clamp(19px, 3vh, 30px) 0; border-bottom: 1px solid var(--line); color: var(--white); transition: color .3s ease, padding .3s ease; }
.work-overlay nav a:hover, .work-overlay nav a:focus-visible { color: var(--gold); padding-left: 12px; }
.work-overlay nav span { color: var(--blue-gray-dark); font-size: .68rem; }
.work-overlay nav strong { font: 500 clamp(1.7rem, 4vw, 3.3rem)/1 var(--serif); letter-spacing: .04em; }
.work-overlay nav small { color: var(--blue-gray); font-size: .68rem; letter-spacing: .14em; }

/* Full-screen hero */
.nocturne-hero { position: relative; isolation: isolate; min-height: 680px; height: 100svh; overflow: hidden; background: var(--night); }
.nocturne-hero__video { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; pointer-events: none; }
.nocturne-hero__shade { position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg, rgba(3,9,17,.77) 0%, rgba(3,9,17,.3) 46%, rgba(3,9,17,.2) 70%, rgba(3,9,17,.68) 100%), linear-gradient(0deg, rgba(3,9,17,.74), transparent 42%, rgba(3,9,17,.38)); }
.nocturne-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 100% 4px; }
.nocturne-hero__title { position: absolute; z-index: 1; left: clamp(28px, 6.2vw, 96px); bottom: clamp(112px, 15vh, 154px); max-width: min(64vw, 980px); animation: nocturne-fade .8s ease both; }
.nocturne-hero__title > p:first-child { margin-bottom: 16px; color: var(--gold); font-size: clamp(.54rem, .8vw, .7rem); letter-spacing: .24em; }
.nocturne-hero h1 { font: 500 clamp(4rem, 7.6vw, 8rem)/.94 var(--serif); letter-spacing: .025em; text-shadow: 0 3px 24px rgba(0,0,0,.4); }
.nocturne-hero__tagline { margin-top: 25px; color: #d8dfe2; font: 500 clamp(.95rem, 1.35vw, 1.25rem)/1.8 var(--serif); letter-spacing: .09em; }
.hero-index { position: absolute; z-index: 1; right: clamp(28px, 5vw, 76px); bottom: clamp(100px, 13vh, 132px); width: min(31vw, 390px); animation: nocturne-fade .8s .12s ease both; }
.hero-index > p { margin-bottom: 12px; color: var(--blue-gray-dark); font-size: .56rem; letter-spacing: .18em; }
.hero-index ol { border-top: 1px solid var(--line); }
.hero-index li { border-bottom: 1px solid var(--line); }
.hero-index a { position: relative; width: 100%; min-height: 45px; display: grid; grid-template-columns: 28px 76px minmax(0, 1fr); gap: 8px; align-items: center; padding: 0; color: var(--blue-gray); text-align: left; font: 500 .61rem/1.35 var(--sans); letter-spacing: .11em; transition: color .3s ease, padding .3s ease; }
.hero-index a::before { content: ""; position: absolute; left: 0; width: 0; height: 1px; background: var(--gold); transition: width .3s ease; }
.hero-index a span { color: var(--blue-gray-dark); }
.hero-index a small { color: var(--gold); font-size: .48rem; letter-spacing: .14em; }
.hero-index a strong { min-width: 0; overflow-wrap: anywhere; font: inherit; }
.hero-index a:hover, .hero-index a:focus-visible, .hero-index a.is-active { color: var(--white); }
.hero-index a.is-active { padding-left: 17px; }
.hero-index a.is-active::before { width: 9px; }
.nocturne-scroll { position: absolute; left: clamp(28px, 6.2vw, 96px); bottom: 36px; display: flex; align-items: center; gap: 22px; color: var(--blue-gray); font-size: .54rem; letter-spacing: .2em; }
.nocturne-scroll i { display: block; width: 92px; height: 1px; overflow: hidden; background: var(--line-strong); }
.nocturne-scroll i::after { content: ""; display: block; width: 38%; height: 100%; background: var(--gold); animation: scroll-line 2s ease-in-out infinite; }

/* Selected works */
.selected-works { position: relative; min-height: 100svh; padding: clamp(82px, 6.6vw, 104px) clamp(24px, 5vw, 76px) clamp(72px, 8vw, 116px); background: var(--night-soft); border-top: 1px solid var(--line); }
.selected-works__header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 2.5vw, 36px); }
.selected-works__header h2 { display: flex; align-items: center; gap: 11px; color: var(--white); font: 500 clamp(.67rem, .75vw, .78rem)/1.4 var(--sans); letter-spacing: .18em; }
.selected-works__header h2 span { color: var(--gold); }
.selected-works__header h2 i { color: var(--blue-gray-dark); font-style: normal; }
.selected-works__header > span { color: var(--blue-gray-dark); font-size: .56rem; letter-spacing: .18em; }
.selected-works__layout { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(250px, .58fr); gap: 0 clamp(46px, 5vw, 82px); align-items: start; }
.selected-visual { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #07101a; color: var(--white); }
.selected-visual::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(3,9,17,.95) 0%, rgba(3,9,17,.76) 24%, rgba(3,9,17,.16) 58%, transparent 76%), linear-gradient(90deg, rgba(3,9,17,.18), transparent 42%); }
.selected-visual img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: saturate(.82) brightness(.78); transition: opacity .32s ease, filter .32s ease, transform .4s ease; }
.selected-visual[data-visual="kanan"] img { object-fit: cover; object-position: center 42%; }
.selected-visual:hover img { filter: saturate(.92) brightness(.83); transform: scale(1.012); }
.selected-visual.is-changing img { opacity: .08; }
.selected-visual.is-placeholder img { display: none; }
.selected-visual__placeholder { position: absolute; inset: 0; display: none; place-items: center; overflow: hidden; background: radial-gradient(circle at 66% 34%, rgba(100,125,148,.22), transparent 36%), linear-gradient(145deg, #091725, #030911 72%); }
.selected-visual.is-placeholder .selected-visual__placeholder { display: grid; }
.selected-visual__placeholder b { color: rgba(234,239,241,.72); font: 500 clamp(4rem, 12vw, 11rem)/1 var(--serif); letter-spacing: .04em; }
.selected-visual__placeholder i, .selected-visual__placeholder i::before, .selected-visual__placeholder i::after { position: absolute; display: block; border: 1px solid rgba(182,162,118,.25); border-radius: 50%; content: ""; }
.selected-visual__placeholder i { width: 52%; aspect-ratio: 1; }
.selected-visual__placeholder i::before { inset: 16%; }
.selected-visual__placeholder i::after { inset: 33%; }
.selected-visual__number { position: absolute; z-index: 2; top: 24px; left: 26px; color: rgba(255,255,255,.75); font: 500 clamp(2rem, 4vw, 4.4rem)/1 var(--serif); }
.selected-visual__caption { flex: none; align-self: end; padding-bottom: 2px; color: var(--white); font-size: .57rem; letter-spacing: .18em; }
.selected-visual__caption b { margin-left: 10px; color: var(--gold); }
.selected-copy { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; padding: clamp(78px, 11vw, 150px) clamp(22px, 3vw, 42px) clamp(20px, 2.2vw, 32px); }
.selected-copy__category { color: var(--gold); font-size: .58rem; letter-spacing: .2em; }
.selected-copy h3 { margin: 8px 0 9px; font: 500 clamp(1.55rem, 2.35vw, 2.45rem)/1.3 var(--serif); text-shadow: 0 2px 18px rgba(0,0,0,.55); }
.selected-copy h3 > span { display: inline; }
.selected-copy h3 small { display: block; margin-top: 3px; font: 500 .48em/1.5 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.selected-copy__summary { max-width: 680px; color: #c3cbd0; font-size: clamp(.7rem, .8vw, .8rem); line-height: 1.75; }
.selected-copy__footer { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-top: 13px; }
.selected-copy__meta { display: flex; gap: clamp(28px, 4vw, 56px); margin: 0; }
.selected-copy__meta dt { margin-bottom: 5px; color: var(--blue-gray-dark); font-size: .52rem; letter-spacing: .16em; }
.selected-copy__meta dd { color: var(--blue-gray); font-size: .67rem; }
.selected-copy__link, .view-archive, .nocturne-about a { display: inline-flex; align-items: center; gap: 18px; min-height: 44px; color: var(--white); font-size: .66rem; letter-spacing: .16em; }
.selected-copy__link span, .view-archive span, .nocturne-about a span { color: var(--gold); transition: transform .3s ease; }
.selected-copy__link:hover span, .view-archive:hover span, .nocturne-about a:hover span { transform: translateX(5px); }
.selected-index { grid-column: 2; }
.selected-index > p { margin-bottom: 12px; color: var(--blue-gray-dark); font-size: .54rem; letter-spacing: .18em; }
.selected-index ol { border-top: 1px solid var(--line-strong); }
.selected-index li { border-bottom: 1px solid var(--line); }
.selected-index a { position: relative; width: 100%; min-height: 74px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 8px; align-content: center; padding: 13px 0; color: var(--blue-gray); text-align: left; transition: color .3s ease, padding .3s ease; }
.selected-index a::before { content: ""; position: absolute; top: 50%; left: 0; width: 0; height: 1px; background: var(--gold); transition: width .3s ease; }
.selected-index a span { grid-row: 1 / span 2; align-self: center; color: var(--blue-gray-dark); font-size: .58rem; }
.selected-index a small { grid-column: 2; color: var(--gold); font-size: .5rem; letter-spacing: .14em; }
.selected-index a strong { grid-column: 2; min-width: 0; font: 500 clamp(.68rem, .92vw, .84rem)/1.4 var(--sans); letter-spacing: .08em; overflow-wrap: anywhere; }
.selected-index a:hover, .selected-index a:focus-visible, .selected-index a.is-active { color: var(--white); }
.selected-index a.is-active { padding-left: 17px; }
.selected-index a.is-active::before { width: 9px; }
.selected-works__foot { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; margin-top: clamp(48px, 5vw, 72px); padding-top: 28px; border-top: 1px solid var(--line-strong); }
.recent-updates > p { margin-bottom: 13px; color: var(--blue-gray); font-size: .54rem; letter-spacing: .18em; }
.recent-updates ul { display: grid; gap: 8px; }
.recent-updates li { display: grid; grid-template-columns: 70px 1fr; gap: 14px; color: #aeb9c1; font-size: .7rem; }
.recent-updates li span { color: var(--gold); font-size: .54rem; letter-spacing: .12em; }
.recent-updates li a { color: inherit; }
.recent-updates li a:hover { color: var(--white); }

/* Compact about and directory */
.nocturne-about { padding: clamp(82px, 10vw, 150px) clamp(24px, 6vw, 96px) clamp(64px, 8vw, 112px); background: var(--night); border-top: 1px solid var(--line); }
.nocturne-about__intro { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(280px, 1fr); gap: 24px clamp(50px, 9vw, 150px); max-width: 1160px; }
.nocturne-about__intro > p:first-child { grid-column: 1 / -1; color: var(--gold); font-size: .58rem; letter-spacing: .18em; }
.nocturne-about__intro h2 { font: 500 clamp(2rem, 4.4vw, 4.2rem)/1.35 var(--serif); }
.nocturne-about__intro > p:nth-of-type(2) { color: #aeb9c1; font-size: .87rem; line-height: 2.1; }
.nocturne-about__intro > a { grid-column: 2; }
.nocturne-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); margin-top: clamp(70px, 9vw, 120px); padding-top: 26px; border-top: 1px solid var(--line-strong); }
.nocturne-directory > div { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.nocturne-directory p { margin-bottom: 6px; color: var(--gold); font-size: .55rem; letter-spacing: .18em; }
.nocturne-directory a, .nocturne-directory span { min-height: 0; color: var(--blue-gray); font-size: .63rem; letter-spacing: .08em; line-height: 1.55; }
.nocturne-directory a:hover { color: var(--white); }

/* Footer */
.nocturne-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 30px; align-items: center; min-height: 118px; padding: 0 clamp(24px, 5vw, 76px); border-top: 1px solid var(--line); background: var(--night); }
.nocturne-footer > a { color: var(--white); font: 500 .78rem/1 var(--serif); letter-spacing: .1em; }
.nocturne-footer > a span { margin-right: 12px; color: var(--gold); }
.nocturne-footer p, .nocturne-footer small { color: var(--blue-gray-dark); font-size: .52rem; letter-spacing: .12em; }
.nocturne-footer small { justify-self: end; }

@keyframes nocturne-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scroll-line { 0%, 100% { transform: translateX(-100%); } 55% { transform: translateX(270%); } }

/* Responsive */
@media (max-width: 980px) {
  .nocturne-header { min-height: 76px; }
  .nocturne-brand__copy { display: none; }
  .nocturne-hero__title { max-width: 72vw; }
  .hero-index { width: 36vw; }
  .selected-works__layout { grid-template-columns: minmax(0, 1.35fr) minmax(235px, .65fr); gap: 0 38px; }
  .selected-copy h3 { min-height: auto; }
  .nocturne-directory { grid-template-columns: repeat(2, 1fr); row-gap: 44px; }
}

@media (max-width: 768px) {
  .nocturne-header { min-height: 68px; padding-inline: 18px; }
  .nocturne-brand__mark { width: 36px; }
  .nocturne-nav { gap: 15px; }
  .nocturne-nav a, .nocturne-nav button { font-size: .56rem; letter-spacing: .12em; }
  .work-overlay__bar { min-height: 68px; padding-inline: 20px; }
  .work-overlay__bar p { display: none; }
  .work-overlay__bar button { margin-left: auto; }
  .work-overlay__inner { width: calc(100% - 40px); padding-top: 56px; }
  .work-overlay h2 { margin-bottom: 34px; font-size: 3.1rem; }
  .work-overlay nav a { grid-template-columns: 32px 1fr; padding: 20px 0; }
  .work-overlay nav small { grid-column: 2; }

  .nocturne-hero { min-height: 640px; }
  .nocturne-hero__video { object-position: 58% 45%; }
  .nocturne-hero__shade { background: linear-gradient(90deg, rgba(3,9,17,.78), rgba(3,9,17,.25) 75%), linear-gradient(0deg, rgba(3,9,17,.88), transparent 58%, rgba(3,9,17,.38)); }
  .nocturne-hero__title { top: 33%; bottom: auto; left: 20px; max-width: calc(100% - 40px); }
  .nocturne-hero__title > p:first-child { max-width: 290px; font-size: .5rem; line-height: 1.7; }
  .nocturne-hero h1 { font-size: clamp(2.75rem, 14vw, 4.25rem); white-space: nowrap; }
  .nocturne-hero__tagline { margin-top: 16px; font-size: .86rem; }
  .hero-index { right: 20px; bottom: 72px; left: 20px; width: auto; }
  .hero-index > p { display: none; }
  .hero-index a { min-height: 38px; grid-template-columns: 24px 68px minmax(0, 1fr); font-size: .54rem; }
  .nocturne-scroll { left: 20px; bottom: 25px; }
  .nocturne-scroll i { width: 58px; }

  .selected-works { padding: 68px 20px 72px; }
  .selected-works__header { margin-bottom: 28px; }
  .selected-works__header > span { display: none; }
  .selected-works__header h2 { font-size: .66rem; }
  .selected-works__layout { grid-template-columns: 1fr; gap: 0; }
  .selected-visual { aspect-ratio: auto; }
  .selected-visual::after { display: none; }
  .selected-visual img { height: auto; aspect-ratio: 16 / 9; object-fit: contain; object-position: center; }
  .selected-visual[data-visual="kanan"] img { object-fit: cover; object-position: center 42%; }
  .selected-visual__number { top: 15px; left: 16px; }
  .selected-copy { position: relative; padding: 24px 18px 20px; background: #05101a; }
  .selected-copy h3 { margin-top: 7px; font-size: clamp(1.38rem, 6.3vw, 1.85rem); }
  .selected-visual[data-visual="last-love"] .selected-copy h3 > span { display: block; white-space: nowrap; }
  .selected-copy__summary { font-size: .72rem; line-height: 1.7; }
  .selected-copy__footer { align-items: end; gap: 16px; margin-top: 12px; }
  .selected-copy__meta { gap: 22px; }
  .selected-copy__meta dd { font-size: .59rem; }
  .selected-visual__caption { font-size: .5rem; }
  .selected-index { grid-column: 1; grid-row: auto; margin-top: 42px; }
  .selected-index a { min-height: 68px; padding: 12px 0; }
  .selected-works__foot { grid-template-columns: 1fr; margin-top: 52px; }
  .recent-updates li { grid-template-columns: 54px 1fr; }
  .view-archive { justify-self: start; }

  .nocturne-about { padding: 74px 20px 62px; }
  .nocturne-about__intro { grid-template-columns: 1fr; gap: 20px; }
  .nocturne-about__intro > p:first-child, .nocturne-about__intro > a { grid-column: 1; }
  .nocturne-directory { grid-template-columns: 1fr 1fr; gap: 36px 24px; margin-top: 66px; }
  .nocturne-footer { grid-template-columns: 1fr; justify-items: center; gap: 13px; min-height: 164px; padding-block: 32px; text-align: center; }
  .nocturne-footer small { justify-self: center; }
}

@media (max-width: 420px) {
  .nocturne-nav { gap: 11px; }
  .nocturne-nav a, .nocturne-nav button { font-size: .52rem; }
  .nocturne-hero h1 { font-size: 12vw; }
  .nocturne-directory { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-page *, .home-page *::before, .home-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
