/* ============================================================
   DeAi協同組合 — Design System "出会い / Encounter"
   Washi paper × sumi ink × shu vermilion.
   Mincho voice, hairline structure, generous ma (間).
   ============================================================ */

:root {
  /* --- Paper & Ink --- */
  --paper:        #f7f4ee;   /* washi off-white canvas */
  --paper-2:      #efebe1;   /* tonal lift (alternating sections) */
  --surface:      #fffdf8;   /* cards, form fields */
  --ink:          #1c1b17;   /* sumi — primary text */
  --ink-2:        #57534a;   /* warm gray — body text */
  --ink-3:        #655f52;   /* muted — captions, meta (5.8:1 on paper;
                                stays ≥4.5:1 over the 16% season decor) */
  --hair:         #e0dbcf;   /* hairline rules */
  --hair-strong:  #c8c1b0;   /* structural rules */

  /* --- Dark band (warm ink) --- */
  --dark:         #191712;
  --dark-text:    #f0ede4;
  --dark-text-2:  #a8a293;
  --dark-hair:    rgba(240, 237, 228, 0.14);

  /* --- The one accent: shu vermilion (from the pinwheel) ---
     Brand reference (logo pinwheel): red #dd3a2e, blue #2b4a9e,
     yellow #f2c230, green #4d9a44 — reserved for the logo itself. */
  --shu:          #c73a24;

  /* --- Type --- */
  --font-display: 'Fraunces', 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-heading: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-body: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;

  /* --- Motion tokens --- */
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout:     cubic-bezier(0.76, 0, 0.24, 1);
  --dur-hover: 180ms;
  --dur-ui: 250ms;
  --dur-reveal: 700ms;
  --dur-hero: 900ms;

  /* --- Texture: static paper grain (feTurbulence data-URI) --- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
}

/* ============================================================
   Base
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 18px base (browser default 16px × 1.125) for older readers; a relative
     value so visitors' own browser text-size setting still applies. */
  font-size: 112.5%;
  /* Paper lives on the root so fixed z-index:-1 season motifs
     (themes.css) can sit between the paper and the content */
  background-color: var(--paper);
}

/* Scroll lock while an overlay (drawer / modal) is open */
body.menu-open,
body.modal-open {
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background-color: transparent;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: 0.05em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain over the whole canvas — subliminal */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  background-size: 182px;
  background-repeat: repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 2147483000;
}

/* Japanese has no italics — kill synthesized obliques */
em, i, cite, blockquote {
  font-style: normal;
}
em, strong {
  font-weight: 600;
  color: var(--ink);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

::selection {
  background-color: var(--shu);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
}

/* Accent hues can sit close to the dark band — use light ink there */
.band-dark :focus-visible {
  outline-color: var(--dark-text);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 3000;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 0.86rem;
  transition: top var(--dur-ui) var(--ease-out-cubic);
}

.skip-link:focus {
  top: 12px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  width: 100%;
  position: relative;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: 'palt' 1;
  font-kerning: normal;
  letter-spacing: 0.06em;
  line-height: 1.45;
  word-break: auto-phrase;
  text-spacing-trim: trim-start;
}

/* English accents: quiet, tracked, uppercase micro-labels */
.en {
  font-family: var(--font-display);
  font-feature-settings: normal;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ============================================================
   Page loader — the pinwheel turns, once
   ============================================================ */

/* Shown only when JS is running (html.js set by the inline head script);
   .no-loader (repeat visit this session) hands the transition to
   @view-transition instead. A 5s failsafe animation guarantees the page
   is never stranded behind the overlay if script.js fails to load. */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out-quart), visibility 0.6s;
}

html.js .page-loader {
  display: flex;
  animation: loaderFailsafe 0.6s ease 5s forwards;
}

html.js.no-loader .page-loader {
  display: none;
}

@keyframes loaderFailsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Crop the pinwheel mark out of the horizontal logo lockup */
.loader-mark {
  width: 56px;
  height: 56px;
  overflow: hidden;
  animation: pinwheel 2.8s var(--ease-inout) infinite;
}

.loader-mark img {
  height: 56px;
  width: auto;
  max-width: none;
  object-fit: cover;
  object-position: left center;
}

@keyframes pinwheel {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-line {
  width: 96px;
  height: 1px;
  background: var(--hair-strong);
  position: relative;
  overflow: hidden;
}

.loader-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--shu);
  animation: lineLoading 1.4s var(--ease-inout) infinite;
}

@keyframes lineLoading {
  0%   { left: -100%; }
  50%  { left: 0; }
  100% { left: 100%; }
}

/* ============================================================
   Header
   ============================================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 22px 0;
  background-color: rgba(247, 244, 238, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
  transition: padding var(--dur-ui) var(--ease-out-quart);
}

.header.scrolled {
  padding: 14px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 44px;
  width: auto;
  transition: opacity var(--dur-hover) var(--ease-out-cubic);
}

.logo-wrapper:hover .logo-img {
  opacity: 0.75;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 36px);
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  letter-spacing: 0.08em;
  padding: 4px 0;
  transition: color var(--dur-hover) var(--ease-out-cubic);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform var(--dur-ui) var(--ease-inout);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.nav-link.active {
  color: var(--ink);
}

.nav-link.active::after {
  transform: scaleX(1);
  background-color: var(--shu);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 1.5px;
  background-color: var(--ink);
  transition: transform var(--dur-ui) var(--ease-inout),
              opacity var(--dur-ui) var(--ease-inout),
              background-color var(--dur-ui) var(--ease-inout);
}

/* ============================================================
   Buttons — editorial, square, quiet
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 34px;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: background-color var(--dur-hover) var(--ease-out-cubic),
              color var(--dur-hover) var(--ease-out-cubic),
              border-color var(--dur-hover) var(--ease-out-cubic);
}

.btn .btn-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out-cubic);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-primary {
  background-color: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background-color: var(--shu);
  border-color: var(--shu);
  color: #fff;
}

.btn-outline:hover {
  border-color: var(--shu);
  color: var(--shu);
}

/* Inverted set for dark bands */
.band-dark .btn {
  border-color: var(--dark-text);
  color: var(--dark-text);
}

.band-dark .btn-primary {
  background-color: var(--dark-text);
  color: var(--dark);
}

.band-dark .btn-primary:hover {
  background-color: var(--shu);
  border-color: var(--shu);
  color: #fff;
}

/* Text link with drawn underline */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink);
  position: relative;
  padding-bottom: 6px;
}

.text-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--hair-strong);
}

.text-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--shu);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform var(--dur-ui) var(--ease-inout);
  z-index: 1;
}

.text-link:hover::before {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.text-link .btn-arrow {
  transition: transform 200ms var(--ease-out-cubic);
}

.text-link:hover .btn-arrow {
  transform: translateX(4px);
}

/* ============================================================
   Section scaffolding — index number + JP title + EN label
   ============================================================ */

.section {
  padding: clamp(96px, 12vw, 168px) 0;
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--hair);
}

.sec-head {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: clamp(48px, 7vw, 88px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hair-strong);
}

.sec-index {
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.2em;
  color: var(--shu);
  line-height: 1;
  padding-bottom: 10px;
}

.sec-titles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sec-en {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sec-title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

.band-dark .sec-title { color: var(--dark-text); }
.band-dark .sec-en { color: var(--dark-text-2); }
.band-dark .sec-head { border-bottom-color: var(--dark-hair); }

/* Dark band shared surface */
.band-dark {
  background-color: var(--dark);
  color: var(--dark-text-2);
  position: relative;
}

.band-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 182px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.band-dark > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Hero — asymmetric editorial split
   ============================================================ */

.hero {
  position: relative;
  padding: clamp(150px, 19vh, 220px) 0 0;
  /* transparent over the html paper so season motifs show through */
  overflow: hidden;
}

/* Giant Latin word as background texture */
.hero-en-bg {
  position: absolute;
  top: clamp(70px, 9vh, 120px);
  right: -0.06em;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(6.2rem, 22vw, 16.9rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  /* Fraunces is a variable font whose glyphs are built from overlapping
     contours; a bare text-stroke traces every overlap inside the letters.
     Stroking first and filling on top with the paper colour hides those inner
     lines and leaves a clean 1px outline. */
  color: var(--paper);
  -webkit-text-stroke: 2px var(--hair-strong);
  paint-order: stroke fill;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.88fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
  padding-bottom: clamp(64px, 9vw, 120px);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  margin-bottom: clamp(28px, 4vw, 44px);
  padding: 8px 0;
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair-strong);
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--shu);
  flex-shrink: 0;
}

.hero-title {
  /* The minimum is held at the pre-18px-base size (~37px): any larger and
     「出会いましょう。」no longer fits one line on a 375px phone. */
  font-size: clamp(2.08rem, 4.9vw, 3.5rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.06em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* Narrow Android phones (320–400px): scale with the viewport instead. */
@media (max-width: 400px) {
  .hero-title {
    font-size: min(2.08rem, 9.4vw);
  }
}

.hero-title .accent {
  color: var(--shu);
}

/* masked line reveal */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.line-inner {
  display: block;
  transition: transform 800ms var(--ease-out-quint);
  transition-delay: calc(var(--i, 0) * 110ms);
}

html.js .line-inner {
  transform: translateY(112%);
}

html.js .lines-visible .line-inner {
  transform: translateY(0);
}

.hero-desc {
  max-width: 34em;
  font-size: 1rem;
  line-height: 2.1;
  margin-bottom: clamp(36px, 5vw, 52px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Vertical tategaki accent */
.hero-tate {
  position: absolute;
  top: clamp(150px, 20vh, 230px);
  right: clamp(16px, 2.6vw, 40px);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.42em;
  color: var(--ink-3);
  z-index: 2;
}

.hero-tate::after {
  content: '';
  display: block;
  width: 1px;
  height: 56px;
  background: var(--hair-strong);
  margin: 18px auto 0;
}

/* Hero figure — hairline frame, clip-path wipe reveal */
.hero-figure {
  position: relative;
  z-index: 2;
  margin: 0;
}

.img-frame {
  border: 1px solid var(--hair-strong);
  padding: 10px;
  background: var(--surface);
}

.img-reveal {
  overflow: hidden;
}

html.js .img-reveal {
  clip-path: inset(0 0 100% 0);
}

.img-reveal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.js .img-reveal img {
  transform: scale(1.18);
}

html.js .img-revealed .img-reveal {
  animation: imgWipe var(--dur-hero) var(--ease-out-quint) forwards;
}

html.js .img-revealed .img-reveal img {
  transition: transform 1200ms var(--ease-out-quint);
  transform: scale(1);
}

@keyframes imgWipe {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.hero-figure .img-reveal img {
  aspect-ratio: 4 / 3;
}

.fig-caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.fig-caption .en {
  font-size: 0.74rem;
  color: var(--shu);
}

/* Marquee — quiet ticker under the hero */
.marquee {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

/* gap:0 + padding-right on the items keeps the loop period exactly
   half the track, so translateX(-50%) wraps seamlessly */
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 46s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.28em;
  color: var(--ink-3);
  white-space: nowrap;
}

.marquee-item .en {
  font-size: 0.86rem;
  color: var(--hair-strong);
}

.marquee-item .sep {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--shu);
  opacity: 0.55;
}

/* ============================================================
   Stats band — numerals as artwork
   ============================================================ */

.stats {
  padding: clamp(72px, 9vw, 120px) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 8px 32px;
  border-left: 1px solid var(--dark-hair);
}

.stat:first-child {
  border-left: none;
  padding-left: 0;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--dark-text);
  font-feature-settings: 'tnum' 1;
  display: inline-block;
}

.stat-unit {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--dark-text);
  margin-left: 6px;
  letter-spacing: 0.1em;
}

.stat-label {
  display: block;
  margin-top: 16px;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-family: var(--font-display);
  color: var(--dark-text-2);
}

.stat-note {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--dark-text-2);
}

/* ============================================================
   About — 代表挨拶
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(48px, 7vw, 104px);
  align-items: start;
}

.about-image-column {
  position: sticky;
  top: 130px;
}

.about-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: var(--paper-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  gap: 12px;
}

.about-placeholder .en {
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--ink-3);
}

.about-placeholder span {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.about-caption-card {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.about-caption-card h4 {
  font-size: 1.02rem;
  letter-spacing: 0.1em;
}

.about-caption-card p {
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: 0.06em;
}

.about-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1em;
  line-height: 1.7;
  margin-bottom: clamp(32px, 4vw, 48px);
  padding-left: 26px;
  border-left: 2px solid var(--shu);
}

.about-text {
  font-size: 1rem;
  margin-bottom: 26px;
  line-height: 2.1;
}

.about-signature {
  margin-top: clamp(36px, 5vw, 56px);
  text-align: right;
  border-top: 1px solid var(--hair);
  padding-top: 26px;
}

.about-signature-title {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.about-signature-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: 0.14em;
}

/* ============================================================
   Services — full-width editorial rows
   ============================================================ */

.service-rows {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(44px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--hair);
  position: relative;
}

.service-row:first-child {
  border-top: 1px solid var(--hair);
}

.service-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  transition: color var(--dur-ui) var(--ease-out-cubic);
  align-self: start;
  padding-top: 8px;
}

.service-row:hover .service-num {
  color: var(--shu);
}

.service-name {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.1em;
}

.service-name .en {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.service-desc {
  font-size: 0.94rem;
  line-height: 2;
  margin-bottom: 28px;
  max-width: 36em;
}

.service-media .img-reveal img {
  aspect-ratio: 16 / 10;
}

.service-media .fig-caption {
  justify-content: flex-end;
}

/* Typographic media cell (countries list, no photo) */
.service-media-type {
  border: 1px solid var(--hair-strong);
  padding: clamp(28px, 3.6vw, 44px);
  background: var(--surface);
}

.service-media-type ul {
  display: flex;
  flex-direction: column;
}

.service-media-type li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  font-family: var(--font-heading);
  font-size: 1.02rem;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.service-media-type li:last-child {
  border-bottom: none;
}

.service-media-type li .en {
  font-size: 0.74rem;
  color: var(--ink-3);
  letter-spacing: 0.26em;
}

/* ============================================================
   Disclosure — 団体概要 definition table
   ============================================================ */

.disclosure-table {
  width: 100%;
  border-top: 1px solid var(--hair-strong);
}

.disclosure-tr {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 26px 8px;
  border-bottom: 1px solid var(--hair);
  align-items: start;
}

.disclosure-th {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.94rem;
  letter-spacing: 0.16em;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.disclosure-th::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hair-strong);
  flex-shrink: 0;
  position: relative;
  top: -2px;
}

.disclosure-td {
  font-size: 0.94rem;
  color: var(--ink-2);
  line-height: 2;
  letter-spacing: 0.05em;
}

.disclosure-td a {
  color: var(--ink);
  border-bottom: 1px solid var(--hair-strong);
  transition: color var(--dur-hover) var(--ease-out-cubic),
              border-color var(--dur-hover) var(--ease-out-cubic);
}

.disclosure-td a:hover {
  color: var(--shu);
  border-color: var(--shu);
}

.pdf-link i {
  margin-right: 8px;
  color: var(--shu);
}

/* ============================================================
   Access — office tabs + sticky map
   ============================================================ */

.access-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: start;
}

.office-selector {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hair-strong);
}

.office-tab {
  padding: 26px 22px 26px 26px;
  cursor: pointer;
  border-bottom: 1px solid var(--hair);
  border-left: 2px solid transparent;
  transition: border-color var(--dur-ui) var(--ease-out-cubic),
              background-color var(--dur-ui) var(--ease-out-cubic);
  background: transparent;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

.office-tab:hover {
  background-color: var(--surface);
}

.office-tab.active {
  border-left-color: var(--shu);
  background-color: var(--surface);
}

.office-tab-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  letter-spacing: 0.1em;
}

.office-tab-title .en {
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  transition: color var(--dur-ui) var(--ease-out-cubic);
}

.office-tab.active .office-tab-title .en {
  color: var(--shu);
}

.office-tab-addr {
  font-size: 0.86rem;
  color: var(--ink-2);
  margin-top: 10px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.map-pane-container {
  position: sticky;
  top: 130px;
  border: 1px solid var(--hair-strong);
  background: var(--surface);
  padding: 10px;
}

.map-pane {
  display: none;
}

.map-pane.active {
  display: block;
  animation: paneIn 500ms var(--ease-out-quart);
}

@keyframes paneIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.map-wrapper {
  position: relative;
  padding-top: 62%;
  overflow: hidden;
}

.map-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) contrast(1.04);
  transition: filter 600ms var(--ease-out-quart);
}

.map-pane:hover .map-wrapper iframe {
  filter: grayscale(0);
}

.map-pane-info {
  margin-top: 14px;
  padding: 0 6px 6px;
  font-size: 0.82rem;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.1em;
}

.map-pane-phone {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ============================================================
   Contact — dark band, editorial split
   ============================================================ */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: start;
}

.contact-lead .sec-head {
  border-bottom-color: var(--dark-hair);
}

.contact-lead p {
  font-size: 1rem;
  line-height: 2.1;
  margin-bottom: clamp(36px, 5vw, 52px);
}

.contact-method-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--dark-hair);
}

.contact-method-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--dark-hair);
  padding: 22px 4px;
}

.contact-method-label {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--dark-text-2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-method-label i {
  color: var(--shu);
  font-size: 0.86rem;
}

.contact-method-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--dark-text);
}

.contact-method-value a {
  color: inherit;
}

.contact-form-card {
  background-color: var(--paper);
  padding: clamp(32px, 4.4vw, 52px);
  color: var(--ink-2);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 26px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.form-group label .req {
  color: var(--shu);
  margin-left: 4px;
}

.form-control {
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--hair-strong);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  background-color: transparent;
  transition: border-color var(--dur-ui) var(--ease-out-cubic);
}

.form-control::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.form-control:focus {
  border-bottom-color: var(--shu);
}

.form-control:focus:not(:focus-visible) {
  outline: none;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
  line-height: 1.9;
}

.form-submit {
  width: 100%;
  margin-top: 12px;
}

/* ============================================================
   Footer — poster in ink
   ============================================================ */

.footer {
  padding: clamp(80px, 10vw, 140px) 0 0;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  padding-bottom: clamp(56px, 7vw, 88px);
}

.footer-brand h3 {
  font-size: 1.3rem;
  color: var(--dark-text);
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 2;
  max-width: 34em;
}

.footer-permits {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--dark-text-2);
}

.footer-links h4 {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dark-text-2);
  margin-bottom: 22px;
  font-weight: 400;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
}

.footer-links li {
  border-bottom: 1px solid var(--dark-hair);
}

.footer-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 2px;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--dark-text-2);
  transition: color var(--dur-hover) var(--ease-out-cubic),
              padding-left var(--dur-ui) var(--ease-out-cubic);
}

.footer-links a::after {
  content: '→';
  font-size: 0.86rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--dur-ui) var(--ease-out-cubic),
              transform var(--dur-ui) var(--ease-out-cubic);
}

.footer-links a:hover {
  color: var(--dark-text);
  padding-left: 8px;
}

.footer-links a:hover::after {
  opacity: 1;
  transform: none;
}

/* The poster wordmark */
.footer-poster {
  border-top: 1px solid var(--dark-hair);
  overflow: hidden;
  padding: clamp(16px, 3vw, 40px) 0 0;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  /* min() guard: the nowrap line (~5.9em) can never exceed the clip box */
  font-size: min(clamp(3rem, 11vw, 8.9rem), calc((100vw - 40px) / 5.9));
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 237, 228, 0.28);
  user-select: none;
  white-space: nowrap;
}

.footer-wordmark .shu {
  -webkit-text-stroke: 1px rgba(199, 58, 36, 0.75);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--dark-hair);
  padding: 26px 0 30px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--dark-text-2);
}

/* ============================================================
   Modal — success dialog
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 27, 23, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  overflow-y: auto;
  padding: 32px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-ui) var(--ease-out-quart),
              visibility 0s linear var(--dur-ui);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-ui) var(--ease-out-quart), visibility 0s;
}

.modal-content {
  background: var(--paper);
  padding: 52px 44px;
  max-width: 480px;
  width: 90%;
  margin: auto;
  text-align: center;
  border: 1px solid var(--hair-strong);
  transform: translateY(14px);
  transition: transform var(--dur-ui) var(--ease-out-quart);
}

@media (max-height: 520px) {
  .modal-content {
    padding: 32px 24px;
  }
}

.modal.active .modal-content {
  transform: none;
}

.modal-icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--shu);
  color: var(--shu);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 26px;
}

.modal-title {
  font-size: 1.25rem;
  margin-bottom: 14px;
  letter-spacing: 0.12em;
}

.modal-desc {
  color: var(--ink-2);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 2;
  text-align: left;
}

/* ============================================================
   Subpage scaffolding
   ============================================================ */

.subpage-hero {
  padding: clamp(150px, 20vh, 210px) 0 clamp(48px, 6vw, 72px);
  /* transparent over the html paper so season motifs show through */
  border-bottom: 1px solid var(--hair-strong);
  position: relative;
  overflow: hidden;
}

.subpage-hero .hero-en-bg {
  top: auto;
  bottom: -0.18em;
  font-size: clamp(4.1rem, 14vw, 9.8rem);
}

.subpage-breadcrumbs {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  display: flex;
  gap: 12px;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.subpage-breadcrumbs a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--hair-strong);
  transition: color var(--dur-hover) var(--ease-out-cubic);
}

.subpage-breadcrumbs a:hover {
  color: var(--shu);
}

.subpage-en {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--shu);
  display: block;
  margin-bottom: 14px;
}

.subpage-title {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.subpage-lead {
  max-width: 44em;
  margin-top: clamp(20px, 3vw, 32px);
  font-size: 1rem;
  line-height: 2.1;
}

/* Scroll progress hairline */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--shu);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1200;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: progressGrow linear;
    animation-timeline: scroll();
  }
  @keyframes progressGrow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
}

/* ============================================================
   Timeline — 日本語教育 steps
   ============================================================ */

.editorial-timeline {
  border-top: 1px solid var(--hair-strong);
}

.timeline-step {
  display: grid;
  grid-template-columns: 96px minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(20px, 3.4vw, 48px);
  padding: clamp(36px, 5vw, 56px) 0;
  border-bottom: 1px solid var(--hair);
  align-items: start;
}

.timeline-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: var(--ink-3);
  transition: color var(--dur-ui) var(--ease-out-cubic);
}

.timeline-step:hover .timeline-num {
  color: var(--shu);
}

.timeline-step-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

.timeline-step-title .en {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.timeline-step-text {
  font-size: 0.94rem;
  line-height: 2.05;
}

/* ============================================================
   Archival cards — schools & activities
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--hair-strong);
  border-left: 1px solid var(--hair-strong);
}

.card-grid > * {
  border-right: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--hair-strong);
}

/* Orphan cells in the last row stretch so the ruled frame stays rectangular */
@media (min-width: 993px) {
  .card-grid > *:nth-child(3n+1):last-child {
    grid-column: 1 / -1;
  }

  .card-grid > *:nth-child(3n+2):last-child {
    grid-column: span 2;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .card-grid > *:nth-child(2n+1):last-child {
    grid-column: 1 / -1;
  }
}

/* A stretched activity card would blow its 16:10 photo up to the full row
   height, so it lays out sideways instead: photo left, text right. */
@media (min-width: 993px) {
  .card-grid > .blog-card:nth-child(3n+1):last-child,
  .card-grid > .blog-card:nth-child(3n+2):last-child {
    flex-direction: row;
  }

  .card-grid > .blog-card:nth-child(3n+1):last-child .blog-media,
  .card-grid > .blog-card:nth-child(3n+2):last-child .blog-media {
    border-bottom: 0;
    border-right: 1px solid var(--hair);
  }

  .card-grid > .blog-card:nth-child(3n+1):last-child .blog-media {
    flex: 0 0 66.667%;
  }

  .card-grid > .blog-card:nth-child(3n+2):last-child .blog-media {
    flex: 0 0 50%;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .card-grid > .blog-card:nth-child(2n+1):last-child {
    flex-direction: row;
  }

  .card-grid > .blog-card:nth-child(2n+1):last-child .blog-media {
    flex: 0 0 50%;
    border-bottom: 0;
    border-right: 1px solid var(--hair);
  }
}

.school-card {
  background: var(--surface);
  padding: clamp(28px, 3.4vw, 42px);
  display: flex;
  flex-direction: column;
  transition: background-color var(--dur-ui) var(--ease-out-cubic);
}

.school-card:hover {
  background-color: var(--paper-2);
}

.school-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  margin-bottom: 22px;
}

.school-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--shu);
}

.school-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  line-height: 1.6;
}

.school-desc {
  font-size: 0.9rem;
  line-height: 2;
  margin-bottom: 26px;
}

.school-info-list {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  border-top: 1px solid var(--hair);
}

.school-info-item {
  display: flex;
  gap: 16px;
  font-size: 0.86rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
  line-height: 1.8;
}

.school-info-item:last-child {
  border-bottom: none;
}

.school-info-item span:first-child {
  font-weight: 500;
  color: var(--ink);
  width: 76px;
  flex-shrink: 0;
  letter-spacing: 0.14em;
}

/* Activity / blog card */
.blog-card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: background-color var(--dur-ui) var(--ease-out-cubic);
}

.blog-card:hover {
  background-color: var(--paper-2);
}

.blog-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background-color: var(--paper-2);
  border-bottom: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
}

.blog-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Intrinsic-ratio fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 1) {
  .blog-media::before {
    content: '';
    float: left;
    padding-top: 62.5%;
  }
  .blog-media::after {
    content: '';
    display: block;
    clear: both;
  }
}

.blog-media i {
  font-size: 1.5rem;
  color: var(--hair-strong);
  transition: color var(--dur-ui) var(--ease-out-cubic);
}

.blog-card:hover .blog-media i {
  color: var(--shu);
}

.blog-media span {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
}

.blog-index {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--hair);
  padding: 3px 8px;
}

.blog-content {
  padding: clamp(22px, 2.6vw, 32px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-date {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--shu);
  margin-bottom: 12px;
}

.blog-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.7;
  letter-spacing: 0.06em;
}

.blog-excerpt {
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.95;
  margin-bottom: 20px;
}

.blog-tag {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   News list — hairline rows
   ============================================================ */

.news-list .news-row:first-child {
  border-top: 1px solid var(--hair-strong);
}

.news-row {
  display: grid;
  grid-template-columns: 150px 130px 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: 30px 8px;
  border-bottom: 1px solid var(--hair);
  align-items: baseline;
}

.news-date {
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.news-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-2);
  border: 1px solid var(--hair-strong);
  padding: 4px 12px;
  justify-self: start;
  white-space: nowrap;
}

.news-cat.is-system {
  border-color: var(--shu);
  color: var(--shu);
}

.news-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
  line-height: 1.7;
  margin-bottom: 8px;
}

.news-body {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 2;
}

/* Loading / error states for CMS-rendered lists */
.data-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
}

.data-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 20px;
  color: var(--shu);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

/* Shown when a JSON feed is intentionally empty (no posts yet) */
.data-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(40px, 6vw, 68px) 24px;
  border: 1px dashed var(--hair-strong);
  color: var(--ink-3);
  font-size: 0.94rem;
  line-height: 2.1;
}

/* Info note (schools page) */
.info-note {
  margin-top: clamp(40px, 6vw, 64px);
  border: 1px solid var(--hair-strong);
  border-left: 2px solid var(--shu);
  background: var(--surface);
  padding: clamp(24px, 3vw, 36px);
  font-size: 0.9rem;
  line-height: 2;
}

.info-note strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

/* Page CTA row */
.page-cta {
  margin-top: clamp(48px, 7vw, 80px);
  text-align: center;
}

/* ============================================================
   Reveal system (IntersectionObserver adds .is-visible)
   Hidden initial states apply only under html.js (set by the
   inline head script) — without JS the page is fully static.
   ============================================================ */

html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-reveal) var(--ease-out-quart),
              transform var(--dur-reveal) var(--ease-out-quart);
  transition-delay: calc(var(--i, 0) * 80ms);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   View transitions between pages (progressive enhancement)
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .header {
    view-transition-name: site-header;
  }
}

/* ============================================================
   Reduced motion — calm by default
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .reveal,
  .line-inner {
    opacity: 1 !important;
    transform: none !important;
  }
  .img-reveal {
    clip-path: none !important;
  }
  .img-reveal img {
    transform: none !important;
  }
  .marquee-track {
    animation: none !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  .hero-tate {
    display: none;
  }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
  }

  .hero-figure {
    max-width: 560px;
  }

  .hero-en-bg {
    font-size: clamp(5.3rem, 24vw, 10.7rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 0;
  }

  .stat:nth-child(odd) {
    border-left: none;
    padding-left: 0;
  }

  .stat:nth-child(even) {
    padding-left: 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-image-column {
    position: static;
    max-width: 420px;
  }

  .service-row {
    grid-template-columns: 48px 1fr;
  }

  .service-media {
    grid-column: 2;
  }

  .disclosure-tr {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .access-split {
    grid-template-columns: 1fr;
  }

  .map-pane-container {
    position: static;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-step {
    grid-template-columns: 64px 1fr;
  }

  .timeline-step-text {
    grid-column: 2;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* Header collapses to the drawer at 1000px — the full desktop nav
   (logo + 5 JP links + CTA) does not fit below ~960px */
@media (max-width: 1000px) {
  .header {
    padding: 16px 0;
  }

  .logo-img {
    height: 38px;
  }

  /* Full-screen ink drawer */
  .nav-menu {
    position: fixed;
    inset: 0;
    left: auto;
    width: min(84%, 360px);
    height: 100vh;
    height: 100dvh;
    background-color: var(--dark);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 32px 44px;
    gap: 8px;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 480ms var(--ease-out-quint), visibility 0s 480ms;
    border-left: 1px solid var(--dark-hair);
  }

  .nav-menu.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 480ms var(--ease-out-quint), visibility 0s;
  }

  /* Centered when it fits, scrollable from the top when it doesn't */
  .nav-menu .nav-link:first-child {
    margin-top: auto;
  }

  .nav-menu .nav-link:last-child {
    margin-bottom: auto;
  }

  .nav-link {
    font-family: var(--font-heading);
    color: var(--dark-text-2);
    font-size: 1.15rem;
    letter-spacing: 0.16em;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--dark-hair);
    flex-shrink: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--dark-text);
  }

  .nav-link.active {
    border-bottom-color: var(--shu);
  }

  .nav-cta {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span {
    background-color: var(--dark-text);
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 128px;
  }

  .sec-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .sec-index {
    padding-bottom: 0;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .service-num {
    padding-top: 0;
  }

  .service-media {
    grid-column: 1;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .news-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 24px 4px;
  }

  .news-cat {
    order: -1;
  }

  .timeline-step {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .timeline-step-text {
    grid-column: 1;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .stat,
  .stat:nth-child(even) {
    border-left: none;
    padding-left: 0;
    padding-right: 0;
    border-top: 1px solid var(--dark-hair);
    padding-top: 28px;
  }

  .stat:first-child {
    border-top: none;
    padding-top: 8px;
  }
}

/* ============================================================
   Print — dark bands become ink-on-white
   ============================================================ */

@media print {
  .band-dark,
  .band-dark::before {
    background: none !important;
  }

  .band-dark,
  .band-dark .sec-title,
  .band-dark .sec-en,
  .stat-num, .stat-unit, .stat-label, .stat-note,
  .contact-method-label, .contact-method-value,
  .footer-brand h3, .footer-brand p, .footer-permits,
  .footer-links h4, .footer-links a,
  .footer-bottom {
    color: #1c1b17 !important;
  }

  .band-dark .sec-head,
  .stat, .contact-method-card, .contact-method-list,
  .footer-links li, .footer-bottom, .footer-poster {
    border-color: #c8c1b0 !important;
  }

  .page-loader, .scroll-progress, .marquee,
  .footer-wordmark, .hero-en-bg, .menu-toggle, .nav-cta {
    display: none !important;
  }

  .header {
    position: static;
    background: none;
  }
}
