/* =====================================================
   QOL v7 — Base
   デザインコンセプト:
     「Chapter仕立ての静謐な奉仕」
     セリフ英字 × 明朝日本語 × 番号付き章立て
   攻めたリスク:
     福祉サイトなのに、まるでスイスの高級ホテル/教育機関
     のような "章仕立て（Chapter 01, 02...）" 構成。
     日本語見出しは明朝で控えめに、英字だけが極大に。
     派手な色は最小限、"品格" で信頼を勝ち取る。
===================================================== */

/* ─────────────────────────────────────
   Design Tokens
───────────────────────────────────── */
:root{
  /* Colors — Chic & Warm Neutral */
  --paper:      #F4F1EB;   /* オフホワイト・和紙 */
  --paper-2:    #EAE5D9;   /* 暖かグレージュ（セクション交互） */
  --paper-3:    #E1DBCB;   /* もう1段深い */
  --ink:        #1B1F1A;   /* 深緑寄り墨（本文・見出し） */
  --ink-70:     rgba(27, 31, 26, .70);
  /* .50 → .62 に調整：--paper (#F4F1EB) 上でのコントラスト比が
     旧値では約3.19:1（WCAG AA不合格）だったため、約4.6:1まで引き上げ。
     ラベルや補足文言など小さな文字サイズでの使用が多いための対応 */
  --ink-50:     rgba(27, 31, 26, .62);
  --ink-30:     rgba(27, 31, 26, .30);
  --ink-12:     rgba(27, 31, 26, .12);
  --ink-06:     rgba(27, 31, 26, .06);

  /* Sage — primary accent（セージグリーン） */
  --sage:       #4A6B4E;
  --sage-d:     #2C4632;
  --sage-l:     #B9C9B3;
  --sage-pale:  #E1EADE;

  /* Terracotta — 採用CTA・注意喚起（温かみ） */
  --terra:      #B5623C;
  --terra-d:    #7A3E22;
  --terra-l:    #EFCFBC;

  /* Gold — 認定・祝い金の稀少色 */
  --gold:       #A88B4E;
  --gold-d:     #6E5A2C;
  --gold-l:     #EADAB4;

  /* Silver / Deep dark */
  --silver:     #8A8579;
  --silver-l:   #B7B2A5;
  --dark:       #14170F;      /* 採用・エントリーの暗背景 */
  --dark-2:     #1F231A;
  --white-90:   rgba(255,255,255,.90);
  --white-70:   rgba(255,255,255,.70);
  --white-50:   rgba(255,255,255,.50);
  --white-30:   rgba(255,255,255,.30);
  --white-12:   rgba(255,255,255,.12);

  /* Fonts */
  --f-serif:  'Fraunces', 'Cormorant Garamond', 'Times New Roman', serif;
  --f-mincho: 'Shippori Mincho B1', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --f-sans:   'Zen Kaku Gothic New', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono:   'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Radius */
  --r-2: 2px;
  --r-4: 4px;
  --r-8: 8px;
  --r-16: 16px;
  --r-full: 999px;

  /* Elevations — 微細で物理的な陰影 */
  --sh-1: 0 1px 2px rgba(27, 31, 26, .04), 0 1px 3px rgba(27, 31, 26, .04);
  --sh-2: 0 6px 20px rgba(27, 31, 26, .07), 0 2px 6px rgba(27, 31, 26, .05);
  --sh-3: 0 18px 48px rgba(27, 31, 26, .11), 0 6px 16px rgba(27, 31, 26, .06);
  --sh-4: 0 32px 80px rgba(27, 31, 26, .16);

  /* Layout */
  --wrap-max: 1240px;
  --wrap-pad: clamp(1.5rem, 3.5vw, 3.5rem);
  --section-y: clamp(6rem, 12vw, 10rem);

  /* Easings — 重量感と切れ味を使い分ける */
  --ease-weight: cubic-bezier(.77, 0, .175, 1);   /* 重量感 */
  --ease-snap:   cubic-bezier(.34, 1.56, .64, 1); /* 弾力 */
  --ease-soft:   cubic-bezier(.22, 1, .36, 1);    /* しなやか */

  /* Noise (和紙質感) */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─────────────────────────────────────
   Reset
───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--f-sans);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt";
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
ol, ul { list-style: none; }
table { border-collapse: collapse; }
h1, h2, h3, h4, h5, h6 { font-weight: 400; line-height: 1.35; }
em { font-style: normal; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: var(--r-2);
}

/* ─────────────────────────────────────
   Noise overlay
───────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: var(--noise);
  opacity: .28;
  mix-blend-mode: multiply;
}

/* ─────────────────────────────────────
   Layout
───────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
  position: relative;
}

.chapter {
  position: relative;
  padding: var(--section-y) 0;
}

/* ─────────────────────────────────────
   Typography Utilities
───────────────────────────────────── */
.chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  font-family: var(--f-mono);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-70);
  margin-bottom: 2.4rem;
}
.chapter-label__rule {
  display: block;
  width: 3rem;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}
.chapter-label--white,
.chapter-label--white .chapter-label__rule {
  color: var(--white-70);
}
.chapter-label--new .new-flag {
  margin-left: 1.4rem;
  padding: .3rem 1rem;
  border: 1px solid var(--terra);
  color: var(--terra);
  border-radius: var(--r-2);
  font-size: 1rem;
  letter-spacing: .18em;
}

.chapter__title {
  font-family: var(--f-mincho);
  font-size: clamp(3rem, 5.2vw, 5.6rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 2.4rem;
  text-wrap: pretty;
}
.chapter__title em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--sage-d);
  font-size: 0.95em;
  letter-spacing: -0.01em;
  margin: 0 .05em;
}
.chapter__title--white { color: #F5F1E8; }
.chapter__title--white em { color: var(--gold-l); }
.chapter__title--town em { color: var(--sage-d); }

.chapter__sub {
  font-family: var(--f-sans);
  font-size: clamp(1.4rem, 1.5vw, 1.6rem);
  font-weight: 300;
  line-height: 1.95;
  color: var(--ink-70);
  max-width: 62ch;
  margin-top: 1.6rem;
  text-wrap: pretty;
}
.chapter__sub--white { color: var(--white-70); }

/* Chapter anchor — セクション左に浮遊する巨大な章番号 */
.chapter__anchor {
  position: absolute;
  top: calc(var(--section-y) - 1rem);
  left: var(--wrap-pad);
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  z-index: 1;
  pointer-events: none;
  color: var(--ink-12);
  transform: translateY(-.4em);
}
.chapter__anchor--dark { color: var(--white-12); }
.chapter__anchor-num {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(6rem, 11vw, 13rem);
  line-height: .8;
  letter-spacing: -0.04em;
  color: currentColor;
}
.chapter__anchor-en {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 3vw, 3.4rem);
  letter-spacing: -0.01em;
  color: currentColor;
  transform: translateY(-.15em);
}
.chapter__anchor-en em { font-style: normal; font-family: var(--f-serif); }

/* Chapter head */
.chapter__head {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(4rem, 7vw, 7rem);
  max-width: 90rem;
}
.chapter__head--kids,
.chapter__head--kitchen {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: end;
  max-width: 100%;
}
.chapter__head--dark {
  color: #F5F1E8;
  max-width: 90rem;
}

/* Chapter brand — 副題（英字＋日本語） */
.chapter__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  padding-left: 2rem;
  border-left: 1px solid var(--ink-12);
  min-width: 24rem;
}
.chapter__brand--inline {
  align-items: flex-start;
  border-left: none;
  padding-left: 0;
  border-top: 1px solid var(--ink-12);
  padding-top: 1.6rem;
  margin: 2.4rem 0 3.2rem;
  flex-direction: row;
  gap: 1.6rem;
  align-items: baseline;
  min-width: unset;
}
.chapter__brand--town {
  align-items: flex-start;
  border-left: none;
  padding-left: 0;
  min-width: unset;
  margin: 2rem 0;
}
.chapter__brand-name {
  font-family: var(--f-mincho);
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.chapter__brand-en {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--ink-50);
  letter-spacing: -0.01em;
}
.chapter__brand-badge {
  margin-top: .6rem;
  font-family: var(--f-mono);
  font-size: 1rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sage-d);
  padding: .3rem .9rem;
  border: 1px solid var(--sage);
  border-radius: var(--r-2);
}
.chapter__brand-badge--warm {
  color: var(--terra-d);
  border-color: var(--terra);
}

/* ─────────────────────────────────────
   Reveal Animations
───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(2.4rem);
  transition:
    opacity 1s var(--ease-soft),
    transform 1s var(--ease-soft),
    filter 1s var(--ease-soft);
  filter: blur(4px);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal-l { opacity: 0; transform: translateX(-2.4rem); transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft); }
.reveal-r { opacity: 0; transform: translateX(2.4rem);  transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft); }
.reveal-l.is-in, .reveal-r.is-in { opacity: 1; transform: none; }

.d-1 { transition-delay: .08s; }
.d-2 { transition-delay: .16s; }
.d-3 { transition-delay: .24s; }
.d-4 { transition-delay: .32s; }
.d-5 { transition-delay: .40s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-l, .reveal-r { opacity: 1; transform: none; filter: none; }
}
