/* ============================================
   WANNA GO — Shared Components
   ============================================ */

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  transition: opacity var(--duration-fast) var(--ease-smooth),
              transform var(--duration-fast) var(--ease-smooth);
}

.nav.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.nav__logo {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  transition:
    width var(--duration-base) var(--ease-luxury),
    height var(--duration-base) var(--ease-luxury),
    transform var(--duration-fast) var(--ease-out);
}

/* Logo symbol — square showing the full logo with text */
.nav__logo::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: url('../assets/logo.jpg') center / contain no-repeat;
  border-radius: 2px;
  mix-blend-mode: screen;
  filter: brightness(1.25) saturate(1.1);
  transition:
    width var(--duration-base) var(--ease-luxury),
    height var(--duration-base) var(--ease-luxury),
    filter var(--duration-base) var(--ease-luxury);
}

.nav__logo:hover::before,
.nav__logo:focus-visible::before {
  filter: brightness(1.45) saturate(1.2);
}

.nav__logo:hover,
.nav__logo:focus-visible {
  transform: translateY(-1px);
}

.nav.is-compact .nav__logo {
  width: 66px;
  height: 66px;
}

.nav.is-compact .nav__logo::before {
  width: 60px;
  height: 60px;
}

@media (min-width: 768px) {
  .nav__logo {
    width: 112px;
    height: 112px;
  }

  .nav__logo::before {
    width: 104px;
    height: 104px;
  }

  .nav.is-compact .nav__logo {
    width: 76px;
    height: 76px;
  }

  .nav.is-compact .nav__logo::before {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 420px) {
  .nav__logo {
    width: 70px;
    height: 70px;
  }

  .nav__logo::before {
    width: 64px;
    height: 64px;
  }

  .nav.is-compact .nav__logo {
    width: 58px;
    height: 58px;
  }

  .nav.is-compact .nav__logo::before {
    width: 52px;
    height: 52px;
  }
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  min-width: 48px;
  min-height: 48px;
  align-items: flex-end;
  justify-content: center;
}

.nav__toggle span {
  display: block;
  height: 1px;
  background: var(--color-text);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav__toggle span:nth-child(1) { width: 28px; }
.nav__toggle span:nth-child(2) { width: 20px; }

.nav__toggle:hover span:nth-child(2),
.nav__toggle:focus-visible span:nth-child(2) {
  width: 28px;
}

/* ---- Navigation Overlay ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(3rem, 8vh, 5rem) 0;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-smooth);
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay__close {
  position: absolute;
  top: var(--space-sm);
  right: 5vw;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--duration-base) var(--ease-luxury);
}

/* Rotation removed — a luxury brand close button becomes brighter, not cleverer. */
.nav-overlay__close:hover,
.nav-overlay__close:focus-visible {
  color: var(--color-text);
}

.nav-overlay__list {
  text-align: center;
}

.nav-overlay__item {
  overflow: hidden;
}

.nav-overlay__link {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.4vw + 0.75rem, 2.2rem);
  font-weight: 300;
  line-height: 1.3;
  padding: 0.32em var(--space-md);
  color: var(--color-muted);
  transition: color var(--duration-fast) var(--ease-out);
  transform: translateY(100%);
  opacity: 0;
}

.nav-overlay__link-sub {
  display: block;
  font-family: var(--font-serif-jp);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-muted);
  opacity: 0.6;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* Nav items enter from below with editorial easing — slower, more intentional */
.nav-overlay.is-open .nav-overlay__link {
  transform: translateY(0);
  opacity: 1;
  transition:
    color var(--duration-fast) var(--ease-out),
    transform 800ms var(--ease-editorial),
    opacity 650ms var(--ease-editorial);
}

/* Stagger: 80ms between each link — slower than before, more composed */
.nav-overlay__item:nth-child(1) .nav-overlay__link { transition-delay: 60ms; }
.nav-overlay__item:nth-child(2) .nav-overlay__link { transition-delay: 130ms; }
.nav-overlay__item:nth-child(3) .nav-overlay__link { transition-delay: 200ms; }
.nav-overlay__item:nth-child(4) .nav-overlay__link { transition-delay: 270ms; }
.nav-overlay__item:nth-child(5) .nav-overlay__link { transition-delay: 340ms; }
.nav-overlay__item:nth-child(6) .nav-overlay__link { transition-delay: 410ms; }
.nav-overlay__item:nth-child(7) .nav-overlay__link { transition-delay: 480ms; }

.nav-overlay__link:hover,
.nav-overlay__link:focus-visible,
.nav-overlay__link.is-active {
  color: var(--color-text);
}

.nav-overlay__link .nav-overlay__num {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-right: var(--space-xs);
  vertical-align: super;
}

/* ---- Chapter Header ---- */
.chapter {
  position: relative;
  padding-top: calc(var(--space-xl) + 60px);
  padding-bottom: var(--space-xl);
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .chapter {
    padding-top: calc(var(--space-2xl) + 60px);
    padding-bottom: var(--space-2xl);
  }
}

/* Ghost letter — single large character as art element */
@keyframes chapter-ghost-drift {
  0%   { transform: translate(-50%, -50%) translateY(0px); }
  50%  { transform: translate(-50%, -50%) translateY(-18px); }
  100% { transform: translate(-50%, -50%) translateY(0px); }
}

.chapter__number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: clamp(28vw, 36vw, 46vw);
  font-weight: 300;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(245, 240, 235, 0.04);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
  animation: chapter-ghost-drift 22s var(--ease-drift) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .chapter__number { animation: none; }
}

.chapter__title {
  position: relative;
  z-index: 2;
  font-family: var(--font-serif-jp);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

@media (min-width: 768px) {
  .chapter__title {
    font-size: var(--text-3xl);
  }
}

.chapter__subtitle {
  position: relative;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 300;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ---- Chapter Intro — page-entry title composition ---- */
/*
  Wraps eyebrow label + thin rule + title + subtitle into one
  composed unit. Animates via CSS keyframes on page load —
  no IntersectionObserver. The page announces itself from darkness.
  Sequence: eyebrow → rule draws → title rises → subtitle fades.
*/
.chapter__intro {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Navigation / category label — appears first, anchors context */
.chapter__eyebrow {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  color: var(--color-warm);
  text-transform: uppercase;
  letter-spacing: 0.30em;
  margin-bottom: var(--space-sm);
  opacity: 0;
  animation: chapter-eyebrow-in 1.2s var(--ease-luxury) 0.3s both;
}

/* Thin horizontal rule — draws from center outward between eyebrow and title */
.chapter__divider {
  display: block;
  width: 30px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(200, 184, 164, 0.5),
    transparent
  );
  margin: 0 auto var(--space-md);
  transform: scaleX(0);
  transform-origin: center;
  animation: chapter-divider-draw 1.1s var(--ease-luxury) 0.6s both;
}

/* Title — cinematic emergence from depth */
.chapter__intro .chapter__title {
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(56px);
  animation: chapter-title-in 2.4s var(--ease-luxury) 0.78s both;
}

/* Subtitle — rises in after title, with clear movement */
.chapter__intro .chapter__subtitle {
  margin-top: var(--space-sm);
  opacity: 0;
  transform: translateY(32px);
  animation: chapter-sub-in 1.8s var(--ease-luxury) 1.4s both;
}

/* Keyframes */
@keyframes chapter-eyebrow-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes chapter-divider-draw {
  to { transform: scaleX(1); }
}

@keyframes chapter-title-in {
  from { opacity: 0; transform: translateY(56px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes chapter-sub-in {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduced-motion: all elements present immediately */
@media (prefers-reduced-motion: reduce) {
  .chapter__eyebrow,
  .chapter__intro .chapter__title,
  .chapter__intro .chapter__subtitle {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .chapter__divider {
    animation: none;
    transform: scaleX(1);
  }
}


/* ---- Divider ---- */
.divider {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-muted), transparent);
  margin: var(--space-lg) auto;
  opacity: 0.35;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 900ms var(--ease-editorial);
}

.divider.is-drawn {
  transform: scaleY(1);
}

/* ---- Pull Quote ---- */
.pullquote {
  font-family: var(--font-serif-jp);
  font-size: clamp(1.1rem, 1.3vw + 0.5rem, 1.6rem);
  font-weight: 300;
  font-style: normal;
  line-height: 1.9;
  color: var(--color-text);
  text-align: left;
  padding: var(--space-lg) 8vw var(--space-lg) calc(8vw + 1.5rem);
  max-width: var(--content-narrow);
  margin: 0 auto;
  letter-spacing: 0.04em;
  position: relative;
}

.pullquote::before {
  content: '';
  position: absolute;
  left: 8vw;
  top: var(--space-lg);
  bottom: var(--space-lg);
  width: 1px;
  background: linear-gradient(to bottom, var(--color-warm) 60%, transparent 100%);
  opacity: 0.45;
}

@media (min-width: 768px) {
  .pullquote {
    padding: var(--space-xl) 5vw var(--space-xl) calc(5vw + 2rem);
  }
  .pullquote::before {
    left: 5vw;
  }
}

/* ---- Editorial Image ---- */
/* Hover: slow, cinematic zoom + very subtle brightness lift.
   Duration extended to 1.4s for luxury pacing.               */
.editorial-image {
  position: relative;
  overflow: hidden;
  background: var(--color-deep);
}

.editorial-image + .editorial-image {
  margin-top: var(--space-md);
}

.editorial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 1.4s var(--ease-editorial),
    filter 1.4s var(--ease-smooth);
  filter: grayscale(0.08) brightness(0.92);
  will-change: transform;
}

.editorial-image:hover img {
  transform: scale(1.028);
  filter: grayscale(0) brightness(1);
}

/* Subtle dark vignette that lightens on hover */
.editorial-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.28) 100%);
  pointer-events: none;
  transition: opacity 1.4s var(--ease-smooth);
  opacity: 1;
}

.editorial-image:hover::after {
  opacity: 0.4;
}

.editorial-image--full {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
  .editorial-image--full {
    aspect-ratio: 21 / 9;
  }
}

.editorial-image--portrait {
  aspect-ratio: 3 / 4;
}

.editorial-image--landscape {
  aspect-ratio: 16 / 10;
}

/* ---- Image Placeholder (for development) ---- */
.placeholder-img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: var(--color-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-line);
  padding: var(--space-sm);
  text-align: center;
}

/* ---- Body Text Block ---- */
.prose {
  font-family: var(--font-serif-jp);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
  font-weight: 300;
  line-height: 2.2;
  color: var(--color-text);
  opacity: 0.9;
  letter-spacing: 0.06em;
}

.prose p + p {
  margin-top: 1.6em;
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-xl) 5vw var(--space-xl);
  border-top: 1px solid var(--color-line);
}

.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  text-align: center;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr auto 1fr;
    text-align: left;
    align-items: start;
  }
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity var(--duration-fast);
}

.footer__logo:hover {
  opacity: 0.7;
}

.footer__logo::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: url('../assets/logo.jpg') center / contain no-repeat;
  border-radius: 4px;
  mix-blend-mode: screen;
  filter: brightness(1.25) saturate(1.1);
}

.footer__tagline {
  font-family: var(--font-serif-jp);
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.footer__links {
  display: flex;
  gap: var(--space-sm) var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .footer__links {
    justify-content: flex-end;
  }
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-muted);
  padding: var(--space-xs) 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--duration-fast);
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--color-text);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-muted);
  opacity: 0.5;
  grid-column: 1 / -1;
  text-align: center;
  margin-top: var(--space-md);
}

/* ---- Footer Gate — unified page navigation ---- */
.footer-gate {
  padding: var(--space-2xl) 5vw var(--space-lg);
  max-width: var(--content-width);
  margin: 0 auto;
}

.footer-gate__enter {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.footer-gate__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-lg);
}

.footer-gate__nav .cta-link {
  font-size: 9px;
}

.footer-gate__prev {
  flex-direction: row-reverse;
}

.footer-gate__next {
  margin-left: auto;
}

/* ---- Scroll Indicator ---- */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 6vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--color-muted);
  font-size: 8px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  animation: scroll-pulse 2.5s var(--ease-smooth) infinite;
}

.scroll-indicator__line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(138, 129, 120, 0.5), transparent);
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.15; }
}

/* ---- Horizontal Scroll Track ---- */
.h-scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 5vw;
}

.h-scroll::-webkit-scrollbar {
  display: none;
}

.h-scroll__item {
  flex: 0 0 80vw;
  scroll-snap-align: center;
}

@media (min-width: 768px) {
  .h-scroll__item {
    flex: 0 0 45vw;
  }
}

@media (min-width: 1200px) {
  .h-scroll__item {
    flex: 0 0 35vw;
  }
}

/* ---- CTA Link ---- */
/* Refined: luxury easing, warm → ivory color shift, deliberate extension */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-warm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-height: 48px;
  transition:
    gap 700ms var(--ease-luxury),
    color var(--duration-base) var(--ease-out);
}

.cta-link::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: currentColor;
  transition: width 700ms var(--ease-luxury);
  flex-shrink: 0;
}

.cta-link:hover,
.cta-link:focus-visible {
  color: var(--color-text);
  gap: 20px;
}

.cta-link:hover::after,
.cta-link:focus-visible::after {
  width: 52px;
}

/* ---- Grain overlay — living film texture ---- */
/* Animated grain drift creates a cinematic, premium "film" presence.
   Steps() timing produces organic randomness rather than smooth interpolation.
   scale(1.06) ensures no edge-gaps during translation.                        */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  animation: grain-drift 9s steps(12) infinite;
  will-change: transform;
}

@keyframes grain-drift {
  0%   { transform: translate(0,     0)     scale(1.06); }
  8%   { transform: translate(-1.8%, -1.2%) scale(1.06); }
  16%  { transform: translate( 2.1%,  0.8%) scale(1.06); }
  24%  { transform: translate(-0.6%,  2%)   scale(1.06); }
  32%  { transform: translate( 1.9%, -1.6%) scale(1.06); }
  40%  { transform: translate(-2.2%,  1.1%) scale(1.06); }
  48%  { transform: translate( 0.7%, -1.9%) scale(1.06); }
  56%  { transform: translate(-1.4%,  1.7%) scale(1.06); }
  64%  { transform: translate( 2%,    0.4%) scale(1.06); }
  72%  { transform: translate(-1%,   -1.8%) scale(1.06); }
  80%  { transform: translate( 1.6%,  1.3%) scale(1.06); }
  90%  { transform: translate(-1.9%, -0.7%) scale(1.06); }
  100% { transform: translate(0,     0)     scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; transform: scale(1.06); }
}
