/* =========================================================
   St. John's Psychiatric Hospital — the "mask" page
   Calm, institutional, trustworthy. The dread is in the details.
   ========================================================= */

:root {
  --cream: #FAFAF7;
  --cream-2: #E3EAE8;
  --panel: #eae3d5;
  --ink: #28313a;
  --ink-soft: #56606a;
  --muted: #7a7468;
  --line: #d9d1c1;
  --navy: #233240;
  --green: #5d7a6a;
  --green-dark: #4c6657;
  --leaf: #b5462e;
  --serif: "Playfair Display", Georgia, serif;
}

body.hospital {
  background: var(--cream);
  color: var(--ink);
}

/* this wrapper is what dissolves into VIGNETTE */
#page {
  will-change: filter, opacity;
  transition: filter 4s ease-in, opacity 3s ease-in;
}

/* ---------- Top utility bar ---------- */
.util {
  background: var(--navy);
  color: #c9d2da;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.util .container {
  display: flex; justify-content: space-between; align-items: center;
  height: 34px;
}
.util a { color: #c9d2da; opacity: 0.85; }
.util a:hover { opacity: 1; }
.util-right { display: inline-flex; align-items: center; gap: 1rem; }

/* EN / JA language toggle */
.lang { display: inline-flex; align-items: center; gap: 0.4rem; }
.lang-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #8b96a0; font: inherit; font-size: 0.72rem; letter-spacing: 0.08em;
  transition: color 0.2s;
}
.lang-btn:hover { color: #c9d2da; }
.lang-btn.active { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lang-sep { color: #4a5660; }

/* ---------- Header / nav ---------- */
.masthead {
  position: sticky; top: 0; z-index: 30;
  background: rgba(243, 239, 231, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.masthead .container {
  display: flex; align-items: center; gap: 2rem;
  height: 76px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 44px; width: auto; display: block; }
.nav { margin-left: auto; display: flex; gap: 1.7rem; }
.nav a {
  font-size: 0.82rem; letter-spacing: 0.08em; color: var(--ink-soft);
  text-transform: uppercase; transition: color 0.2s;
}
.nav a:hover { color: var(--green-dark); }
.btn {
  display: inline-block; border: none;
  background: var(--green); color: #f6f3ec;
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.85em 1.5em; border-radius: 2px;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.masthead .btn { margin-left: 0.4rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 540px;
  display: flex; align-items: center;
  color: #f5f2ea;
  background:
    linear-gradient(180deg, rgba(20,28,24,0.30), rgba(20,28,24,0.55)),
    url("../assets/img/garden_sheets.png") center 38% / cover no-repeat;
}
.hero .container { padding: 4rem 0; max-width: 1180px; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.08; max-width: 16ch;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.hero p {
  max-width: 44ch; margin-top: 1.2rem; font-size: 1rem;
  color: #ece8df;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}
.hero .btn { margin-top: 1.8rem; background: var(--green); }

/* ---------- Generic section ---------- */
.section { padding: 5.5rem 0; }
.section.alt { background: var(--cream-2); }
.section .eyebrow { color: var(--green-dark); margin-bottom: 0.8rem; }
.section h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  max-width: 22ch; color: var(--ink);
}

/* Mission: intro + stacked cards */
.mission-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3.5rem; margin-top: 2.5rem; align-items: start;
}
.mission-intro p { color: var(--ink-soft); }
.cardlist { display: grid; gap: 1rem; }
.card {
  background: #E3EAE8; border: 1px solid var(--line);
  border-left: 3px solid #80AEA2;
  padding: 1.3rem 1.5rem; border-radius: 2px;
}
.card h3 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 0.35rem; }
.card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* Programmes: 3 columns with leaf icons */
.prog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem; margin-top: 3rem;
}
.prog {
  background: #FAFAF7; border: 1px solid var(--line);
  padding: 1.6rem 1.5rem; border-radius: 2px;
}
.prog .ico { width: 46px; height: 46px; margin-bottom: 1rem; }
.prog h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.5rem; }
.prog p { color: var(--ink-soft); font-size: 0.94rem; }

/* Our Staff — "先生の領域" (the scroll trigger lives here) */
.staff-feature {
  display: grid; grid-template-columns: 0.8fr 1.2fr;
  gap: 3.5rem; margin-top: 3rem; align-items: center;
}
.staff-feature .portrait {
  border: 1px solid var(--line);
  background: #e7e1d4; padding: 10px; border-radius: 2px;
  box-shadow: 0 18px 40px -24px rgba(0,0,0,0.5);
}
.staff-feature h3 { font-family: var(--serif); font-size: 2rem; }
.staff-feature .role {
  color: var(--green-dark); letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.78rem; margin: 0.4rem 0 1.2rem;
}
.staff-feature .bio { color: var(--ink-soft); max-width: 52ch; }
.staff-feature blockquote {
  margin: 1.6rem 0 0; padding: 1.1rem 1.4rem;
  border-left: 3px solid #80AEA2;
  background: var(--cream-2);
  font-family: var(--serif); font-style: italic;
  font-size: 1.1rem; color: var(--ink);
}

/* ---------- Footer ---------- */
.foot {
  background: var(--navy); color: #aeb8c0;
  padding: 3rem 0; font-size: 0.84rem;
}
.foot .container { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.foot a { color: #aeb8c0; }
.foot a:hover { color: #fff; }
.foot small { color: #7d8893; }

/* =========================================================
   The dissolve — hospital "bleeds" into VIGNETTE
   ========================================================= */
#bleed-overlay {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0; transition: opacity 4s ease-in;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(90,0,0,0) 0%, rgba(60,0,0,0.0) 35%, rgba(35,0,0,0.85) 100%),
    linear-gradient(180deg, rgba(20,0,0,0.0), rgba(20,0,0,0.55));
  mix-blend-mode: multiply;
}
#bleed-flash {
  position: fixed; inset: 0; z-index: 91; pointer-events: none;
  background: #000; opacity: 0; transition: opacity 1.4s ease-in 3.1s;
}

body.dissolving { cursor: progress; }
body.dissolving #page {
  filter: url(#bleed) blur(6px) saturate(0.4) contrast(1.15) brightness(0.7);
}
body.dissolving #bleed-overlay { opacity: 1; }
body.dissolving #bleed-flash { opacity: 1; }

/* reduced motion: no warp, simple fade to black */
@media (prefers-reduced-motion: reduce) {
  body.dissolving #page { filter: none; opacity: 0; }
  #bleed-flash { transition: opacity 0.4s ease-in; }
}

/* ---------- Testimonials ---------- */
.test-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem; margin-top: 3rem;
}
.quote {
  margin: 0; padding: 1.8rem; background: var(--cream);
  border: 1px solid var(--line); border-top: 3px solid var(--green);
  border-radius: 2px;
}
.quote blockquote {
  margin: 0 0 1.1rem; font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; color: var(--ink); line-height: 1.55;
}
.quote figcaption {
  font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Mobile menu (hamburger + overlay) ---------- */
.menu-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: none; border: none; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 6px;
}
.menu-toggle span {
  display: block; width: 26px; height: 2px; background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 50;
  background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.6rem; text-align: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
}
body.menu-open { overflow: hidden; }
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu ul { display: flex; flex-direction: column; gap: 1.4rem; }
.mobile-menu a {
  font-family: var(--serif); font-size: 1.5rem; color: var(--ink);
  letter-spacing: 0.02em;
}
.mobile-menu a:hover { color: var(--green-dark); }
.mobile-menu .btn { margin-top: 0.6rem; font-size: 0.82rem; }
.mobile-menu .lang { margin-top: 1rem; }
.mobile-menu .lang-btn { color: var(--ink-soft); font-size: 0.9rem; }
.mobile-menu .lang-btn.active { color: var(--green-dark); }
.mobile-menu .lang-sep { color: var(--line); }
.menu-close {
  position: absolute; top: 1rem; right: 1.4rem;
  background: none; border: none; cursor: pointer;
  font-size: 2.4rem; line-height: 1; color: var(--ink-soft);
}
.menu-close:hover { color: var(--ink); }

/* keep the overlay out of the way on desktop */
@media (min-width: 861px) {
  .mobile-menu { display: none; }
  .menu-toggle { display: none; }
}

/* ---------- Japanese typography ---------- */
body.lang-ja { font-family: "Noto Serif JP", "Lora", serif; --serif: "Noto Serif JP", serif; }
body.lang-ja .nav a,
body.lang-ja .eyebrow,
body.lang-ja .quote figcaption,
body.lang-ja .staff-feature .role { letter-spacing: 0.04em; }
body.lang-ja .hero h1,
body.lang-ja .section h2 { line-height: 1.3; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .masthead .btn { display: none; }      /* Schedule a Visit lives in the menu */
  .menu-toggle { display: flex; }
  .util-login { display: none; }         /* Patient Login moves into the menu */
  .masthead .container { height: 64px; }
  .mission-grid,
  .prog-grid,
  .staff-feature,
  .test-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { min-height: 460px; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .section { padding: 4rem 0; }
}
