/* =====================================================================
   SOCIAL HEARTFUL UNION — Shared Design Foundation
   Pattern A "温かみ系プロフェッショナル" refined (2026-07)

   Single source of truth for all public pages.
   Design language: 明朝の面構え × 紙の温かみ。
   - Planes over edges: sections divide by background planes and
     whitespace, never by accent bars or decorated borders.
   - Flat color only (no gradients). Depth comes from paper grain,
     ink-tinted shadows and layered planes.
   - One accent action per screen.
   ===================================================================== */

:root {
  /* --- Ink (brand navy, warm-leaning) --- */
  --ink-900: #10222f;
  --ink-800: #14344a;
  --ink-700: #17425f;
  --ink-600: #1a5276;   /* brand anchor (existing) */
  --ink-500: #2c6b93;
  --ink-400: #4d87ab;
  --ink-100: #dbe6ee;

  /* --- Paper (warm cream planes) --- */
  --paper:      #faf6ee;  /* page base */
  --paper-warm: #f3ebdd;  /* alternate plane */
  --paper-deep: #eadfc9;  /* strong plane (rare) */
  --surface:    #ffffff;  /* cards */

  /* --- Accent (柿色 persimmon — one action per screen) --- */
  --accent:      #c9661f;
  --accent-deep: #a8541a;
  --accent-soft: #f7e8d8;  /* accent tint plane */

  /* --- Text --- */
  --text:       #26333d;
  --text-sub:   #55656f;
  --text-faint: #64747f;  /* AA (4.5:1+) on white surfaces; not for text on paper-warm/deep */
  --text-on-ink: rgba(255, 255, 255, 0.92);
  --text-on-ink-sub: rgba(255, 255, 255, 0.68);

  /* --- Lines (hairlines instead of boxes) --- */
  --line:        rgba(20, 52, 74, 0.12);
  --line-strong: rgba(20, 52, 74, 0.28);
  --line-on-ink: rgba(255, 255, 255, 0.16);

  /* --- Ink-tinted elevation --- */
  --shadow-1: 0 1px 2px rgba(16, 34, 47, 0.05), 0 2px 8px rgba(16, 34, 47, 0.05);
  --shadow-2: 0 2px 6px rgba(16, 34, 47, 0.06), 0 10px 28px rgba(16, 34, 47, 0.09);
  --shadow-3: 0 8px 20px rgba(16, 34, 47, 0.12), 0 24px 56px rgba(16, 34, 47, 0.16);

  /* --- Radius (md/lg only; xl reserved for modals) --- */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* --- Typography --- */
  --font-display: 'Zen Old Mincho', 'Hiragino Mincho ProN', serif;
  --font-body: 'BIZ UDPGothic', 'Hiragino Kaku Gothic ProN', sans-serif;

  /* Fluid type scale */
  --fs-display: clamp(2.25rem, 1.1rem + 3.6vw, 3.6rem);   /* hero */
  --fs-title:   clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem);   /* section h2 */
  --fs-lead:    clamp(1rem, 0.95rem + 0.3vw, 1.125rem);   /* lede text */
  --fs-h3:      1.1875rem;
  --fs-body:    0.9375rem;   /* 15px */
  --fs-small:   0.8125rem;   /* 13px */
  --fs-caption: 0.75rem;     /* 12px */

  --lh-tight: 1.35;
  --lh-body:  1.9;

  /* --- Spacing (4px scale) --- */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px;  --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-28: 112px;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.3s;
  --dur-slow: 0.6s;

  /* --- Paper grain (SVG turbulence, flat-color safe) --- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E");

  /* --- Compat aliases (legacy inline CSS var names used across pages) --- */
  --primary: var(--ink-600);
  --primary-light: var(--ink-500);
  --primary-dark: var(--ink-800);
  --accent-light: #d97c33;
  --warm: var(--paper-deep);
  --warm-light: var(--paper-warm);
  --warm-dark: #d8c9ac;
  --text-light: var(--text-sub);
  --white: #ffffff;
  --bg: var(--paper);
  --card-shadow: var(--shadow-1);
  --card-hover: var(--shadow-2);
  --transition: all var(--dur-base) var(--ease-out);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* fixed header offset for anchor jumps */
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink-100); color: var(--ink-800); }

@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;
  }
}

/* Keyboard focus (focus-visible only) */
:focus-visible {
  outline: 3px solid var(--ink-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 10000;
  background: var(--ink-700);
  color: #fff;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 var(--radius-lg) 0;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* =====================================================================
   Shared primitives
   (Canonical versions. Pages adopt these by removing their inline
   duplicates — page CSS loaded after this file wins until removed.)
   ===================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ink-600);
  color: #fff;
  box-shadow: 0 2px 10px rgba(26, 82, 118, 0.24);
}
.btn-primary:hover { background: var(--ink-700); box-shadow: 0 4px 16px rgba(26, 82, 118, 0.3); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(201, 102, 31, 0.28);
}
.btn-accent:hover { background: var(--accent-deep); box-shadow: 0 4px 16px rgba(201, 102, 31, 0.34); }

.btn-outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-700);
}
.btn-outline:hover { border-color: var(--ink-600); background: rgba(26, 82, 118, 0.05); }

.btn-full { width: 100%; }

/* --- Section scaffolding --- */
.section {
  padding: var(--sp-28) var(--sp-6);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  max-width: 720px;
  margin: 0 auto var(--sp-16);
  text-align: center;
}

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-title);
  line-height: var(--lh-tight);
  letter-spacing: 0.02em;
  color: var(--ink-800);
  margin-bottom: var(--sp-5);
}

.section-desc {
  font-size: var(--fs-body);
  color: var(--text-sub);
  line-height: var(--lh-body);
}

/* --- Forms --- */
.form-group { margin-bottom: var(--sp-5); }

.form-label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.form-textarea { min-height: 110px; resize: vertical; line-height: 1.7; }

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--ink-500);
  box-shadow: 0 0 0 3px rgba(44, 107, 147, 0.12);
}

.form-error {
  background: #fdf1ee;
  border: 1px solid rgba(180, 60, 30, 0.25);
  color: #a03415;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-small);
  margin-bottom: var(--sp-4);
}

/* --- Scroll reveal (JS adds .visible via IntersectionObserver) --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* Staggered children (opt-in per container) */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal-stagger.visible > * { opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}

/* --- Plane utilities (section separation by surface, not edges) --- */
.plane-warm { background: var(--paper-warm); }
.plane-ink  { background: var(--ink-800); color: var(--text-on-ink); }

.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  pointer-events: none;
}
