/* ===========================================================
   Liaison — Responsive / mobile layer (shared across all pages)
   Loaded last so it overrides. Header switches to its compact desktop layout
   before using the drawer navigation at 1280px and below.
   =========================================================== */

/* ---------- Mobile menu: hamburger + drawer ---------- */
.nav-toggle { display: none; }

/* SP-only line break (hero catch copy) */
.sp-br { display: none; }

.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(26, 22, 20, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.mobile-backdrop.open { opacity: 1; visibility: visible; }

.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  z-index: 80;
  width: min(84vw, 340px);
  height: 100%;
  background: var(--paper);
  box-shadow: -24px 0 64px -20px rgba(26, 22, 20, 0.4);
  transform: translateX(100%);
  transition: transform .42s cubic-bezier(.2, .7, .2, 1);
  padding: 104px 30px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-drawer.open { transform: none; }
.mobile-drawer-nav { display: flex; flex-direction: column; }
.mobile-drawer-nav a {
  font-family: var(--jpsans);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
}
.mobile-drawer-nav a.btn-contact {
  margin-top: 28px;
  border-bottom: 0;
  justify-content: center;
  padding: 15px 22px;
  font-size: 14px;
  color: var(--paper);
}
body.menu-open { overflow: hidden; }

/* Compact desktop: keep labels intact while reducing type and spacing. */
@media (min-width: 1281px) and (max-width: 1500px) {
  .site-header,
  .site-header.scrolled {
    padding-left: clamp(20px, 2vw, 30px);
    padding-right: clamp(20px, 2vw, 30px);
  }
  .brand-mark { gap: 10px; }
  .brand-mark .logo-img { height: 46px; }
  .site-header.scrolled .brand-mark .logo-img { height: 40px; }
  .brand-mark .wordmark small {
    font-size: 9px;
    letter-spacing: 0.2em;
    padding-left: 9px;
  }
  .nav { gap: 2px; }
  .nav a.nav-item {
    font-size: clamp(11px, 0.82vw, 12px);
    letter-spacing: 0.02em;
    padding: 10px clamp(7px, 0.7vw, 10px);
  }
  .nav a.nav-item::after {
    left: clamp(7px, 0.7vw, 10px);
    right: clamp(7px, 0.7vw, 10px);
  }
  .btn-contact {
    gap: 7px;
    margin-left: 5px;
    padding: 11px 14px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 1280px) {
  /* replace inline nav with hamburger */
  .nav { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 46px;
    height: 46px;
    margin: -8px -6px -8px 0;
  }
  .nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .32s cubic-bezier(.2, .7, .2, 1), opacity .2s ease;
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* keep the toggle tappable above the drawer while open */
  body.menu-open .site-header { z-index: 90; }
}

/* ===========================================================
   Phone layout (<= 680px)
   =========================================================== */
@media (max-width: 680px) {
  /* Header */
  .site-header { padding: 14px var(--gutter); }
  /* backdrop-filter はスクロール中に毎フレームのぼかし再計算が走り
     モバイルでカクつくため、SPでは不透明度を上げた背景で代替する */
  .site-header.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(244, 241, 235, 0.97);
  }
  .brand-mark .logo-img { height: 42px; }
  .site-header.scrolled .brand-mark .logo-img { height: 38px; }
  .brand-mark { gap: 10px; }
  .brand-mark .wordmark small { letter-spacing: 0.24em; padding-left: 10px; }

  /* Hero — full-bleed photo, magazine-cover treatment */
  .hero { min-height: 100svh; padding: 0; }
  .hero-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    grid-template-columns: 1fr;
    min-height: 100svh;
    gap: 0;
    padding: 116px var(--gutter) 64px;
    position: relative;
    z-index: 2;
  }
  .hero-copy { padding-right: 0; position: relative; z-index: 2; }

  .sp-br { display: inline; }

  .hero-title {
    white-space: normal;
    font-size: clamp(38px, 11.5vw, 50px);
    line-height: 1.28;
    letter-spacing: 0.04em;
    color: var(--paper);
    text-shadow: 0 2px 24px rgba(26,22,20,.45);
  }
  .hero-title .hl { z-index: 0; }
  .hero-title .hl::after {
    background: rgba(168,24,72,.62);
    height: 22%;
    bottom: 4%;
    z-index: -1;
  }
  .hero-sub {
    white-space: normal;
    font-size: 14px;
    line-height: 2;
    margin: 20px 0 28px;
    color: rgba(251,249,244,.92);
    text-shadow: 0 1px 12px rgba(26,22,20,.5);
  }
  .hero-sub br { display: none; }
  .hero-tagline-en {
    margin-bottom: 18px;
    font-size: 10px;
    letter-spacing: 0.34em;
    color: rgba(251,249,244,.85);
  }
  .hero-tagline-en::before { background: var(--accent); }

  /* photo: full-bleed + slow Ken Burns */
  .hero.var-a .hero-vis {
    position: absolute; inset: 0; z-index: 0;
    min-height: 0; max-height: none; aspect-ratio: unset;
    width: 100%; height: 100%;
    animation: heroKen 8s ease-out forwards;
  }

  /* cinematic duotone gradient — drawn as the photo's own overlay
     (::after of .hero-vis) so it always paints above the bg-image. */
  .hero.var-a .hero-vis::after {
    content: "";
    position: absolute; inset: 0;
    background:
      linear-gradient(180deg,
        rgba(26,22,20,0) 0%,
        rgba(26,22,20,.12) 38%,
        rgba(59,15,33,.55) 72%,
        rgba(38,10,22,.92) 100%),
      radial-gradient(120% 60% at 50% 108%, rgba(168,24,72,.28), rgba(168,24,72,0) 60%);
    pointer-events: none;
  }

  /* oversized serif wordmark, ghosted over the photo
     (drawn on the photo's ::before so it reliably paints above it) */
  .hero-bg-type { display: none; }
  .hero.var-a .hero-vis::before {
    content: "Liaison";
    position: absolute;
    top: 58px; left: -10px;
    z-index: 1;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 46vw;
    line-height: 0.8;
    letter-spacing: -0.04em;
    color: rgba(251,249,244,.15);
    white-space: nowrap;
    pointer-events: none;
  }

  /* ---- Header over the dark FV photo (index only) ----
     Header states: FV(base) / .scrolled(light backdrop) / body.menu-open(paper drawer).
     Light-on-dark treatment applies ONLY to the base state — over the light
     scrolled backdrop or the open drawer everything reverts to ink. */
  body.page-home:not(.menu-open) .site-header:not(.scrolled) .nav-toggle span {
    background: var(--paper);
  }
  body.page-home .site-header .nav-toggle span {
    transition: transform .32s cubic-bezier(.2, .7, .2, 1), opacity .2s ease, background-color .3s ease;
  }
  body.page-home:not(.menu-open) .site-header:not(.scrolled) .brand-mark .wordmark,
  body.page-home:not(.menu-open) .site-header:not(.scrolled) .brand-mark .wordmark small {
    color: var(--paper);
  }
  body.page-home .brand-mark .wordmark,
  body.page-home .brand-mark .wordmark small {
    transition: color .3s ease;
  }
  /* logo disc: an independent circle behind the logo, faded with opacity only.
     The logo itself never changes size or shape between states, so nothing
     jumps — the disc simply dissolves in sync with the header backdrop (.4s). */
  body.page-home .brand-mark { position: relative; }
  body.page-home .brand-mark::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(251, 249, 244, 0.94);
    box-shadow: 0 2px 16px rgba(26, 22, 20, 0.35);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
  }
  body.page-home:not(.menu-open) .site-header:not(.scrolled) .brand-mark::before {
    opacity: 1;
  }
  body.page-home .brand-mark .logo-img { position: relative; z-index: 1; }

  /* scroll cue */
  .hero-inner::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, rgba(251,249,244,0), rgba(251,249,244,.85));
    animation: scrollCue 2.4s ease-in-out infinite;
  }
}

@keyframes heroKen {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}
@keyframes scrollCue {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  70% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero.var-a .hero-vis { animation: none; }
  .hero-inner::after { animation: none; }
}

@media (max-width: 680px) {

  /* Section rhythm */
  .section { padding: 72px var(--gutter); }
  .section-head { margin-bottom: 40px; gap: 16px; }
  .about-chapter { margin-top: 72px; padding-top: 52px; }
  .about-chapter-head { margin-bottom: 36px; }

  /* About bg decorative mark */
  .about-bg-mark { font-size: clamp(160px, 50vw, 260px); top: -12px; right: -18px; }

  /* Buttons full-tap comfort */
  .btn-pill { padding: 15px 24px; font-size: 13px; }

  /* Feature cards (already single column at 1024) */
  .feature-grid { gap: 48px; }
  .feature-card .feat-body { gap: 12px; }
  .feature-card .feat-text { font-size: 15px; }

  /* Movie */
  .movie-intro { font-size: 15px; margin-top: 20px; }
  .video-frame .play-btn { width: 72px; height: 72px; }
  .video-frame .play-btn .tri {
    border-left-width: 17px;
    border-top-width: 11px;
    border-bottom-width: 11px;
  }
  .video-caption { flex-direction: column; gap: 6px; }

  /* Schedule: horizontal scroll hint */
  .schedule-intro { font-size: 15px; }
  .schedule-wrap {
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    padding: 4px var(--gutter);
  }
  .schedule-note { font-size: 12px; padding: 16px 18px; }

  /* Staff / Facility banners (single column already) */
  .staff-banner,
  .facility-section { padding: 72px var(--gutter); }
  .staff-banner-statement { font-size: clamp(22px, 6vw, 30px); }
  .staff-banner-text,
  .facility-text { font-size: 15px; }
  .staff-banner-en,
  .facility-en { font-size: clamp(120px, 40vw, 220px); }

  /* Subpage split cards */
  .split-cards.compact { padding-left: var(--gutter); padding-right: var(--gutter); }

  /* Contact / access */
  .contact-bar { padding-top: 72px; padding-bottom: 72px; }
  .contact-map { min-height: 260px; }
  .contact-title { font-size: clamp(22px, 6vw, 30px); }
  .contact-en { font-size: clamp(120px, 40vw, 220px); }

  /* Footer */
  .footer-nav { grid-template-columns: 1fr; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  /* clear the fixed floating banner so the copyright stays visible */
  body:has(.float-cta) .site-footer { padding-bottom: 150px; }

  /* Floating CTA: drop the "詳しくはこちら" text, move arrow to the right, bigger title */
  .float-cta { align-items: center; padding-right: 54px; }
  .float-cta-title { font-size: 16px; }
  .float-cta-more {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    gap: 0;
    line-height: 1;
    color: var(--paper);
  }
  .float-cta-more-txt { display: none; }
  .float-cta-arr { width: auto; height: auto; background: none; display: flex; }
  .float-cta-arr::after { display: none; }
  .fc-arr-svg { display: block; width: 28px; height: 14px; }
}

/* ===========================================================
   Small phone (<= 400px)
   =========================================================== */
@media (max-width: 400px) {
  .brand-mark .wordmark { font-size: 13px; }
  .hero-title { font-size: clamp(27px, 8.2vw, 34px); }
}

/* ===========================================================
   Subpage shared components — phone (<= 680px)
   page-hero / breadcrumb / cta-band / center-head are defined in
   styles-about-page.css but loaded on every subpage.
   =========================================================== */
@media (max-width: 680px) {
  /* Page hero band */
  .page-hero { padding: 104px var(--gutter) 0; }
  .page-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding-bottom: 24px;
  }
  .page-hero-en { font-size: clamp(28px, 8vw, 38px); }
  .page-hero-sub { margin-top: 12px; font-size: 11px; letter-spacing: 0.24em; }
  .breadcrumb { font-size: 10px; letter-spacing: 0.1em; flex-wrap: wrap; }

  /* CTA band */
  .cta-band { margin-top: 80px; padding: 52px var(--gutter); }
  .cta-band-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
  .cta-band h2 { font-size: clamp(21px, 5.6vw, 28px); }

  /* Centered section head */
  .center-head { margin-bottom: 40px; }
  .center-head h2 { font-size: clamp(23px, 6vw, 32px); line-height: 1.5; }
  .center-head .ch-label { margin-bottom: 14px; gap: 10px; }

  .ap-eyebrow { margin-bottom: 14px; }
}
