/* ==========================================================================
   VectorCore AI — Design System
   --------------------------------------------------------------------------
   全ページ共通のデザイントークンとコンポーネント。
   方向性：和モダン・エディトリアル。紺（信頼）×代赭（体温）×暖色ニュートラル。
   見出し = Shippori Mincho / 本文 = Noto Sans JP の2書体構成。

   Breakpoints: 1024px / 768px / 480px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color — brand */
  --navy:         #2C4A6E;
  --navy-dark:    #1A2E45;
  --navy-deep:    #142338;
  --orange:       #C0603A;   /* 代赭 — アクセント */
  --orange-cta:   #B05530;   /* CTAボタン背景 — 白文字でコントラスト比4.5以上を確保 */
  --orange-hover: #A84E2E;
  --orange-soft:  #E8845C;   /* 暗背景上のアクセント */

  /* Color — neutrals（暖色系） */
  --offwhite:   #FAFAF8;
  --cream:      #F2F0EC;
  --cream-dark: #EAE7E1;
  --border:     #E0DDD8;

  /* Color — text */
  --ink:            #1A1A1A;
  --text-primary:   #1A1A1A;
  --text-secondary: #555555;
  --text-muted:     #6B6B6B;

  /* Color — semantic */
  --green:      #5C7A6B;
  --red-line:   #B84040;
  --green-line: #2E7D52;

  /* Typography — 2書体構成 */
  --font-display: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-body:    'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  /* 後方互換エイリアス（DM Sans は廃止し本文書体へ集約） */
  --font-mincho: var(--font-display);
  --font-sans:   var(--font-body);
  --font-dm:     var(--font-body);

  /* Type scale */
  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 15px;
  --fs-md:   16px;
  --fs-lg:   18px;
  --fs-h3:   clamp(18px, 2vw, 22px);
  --fs-h2:   clamp(26px, 3vw, 36px);
  --fs-h1:   clamp(36px, 4.5vw, 56px);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 96px;
  --section-pad: clamp(72px, 9vw, 112px);

  /* Layout */
  --container: 1160px;
  --header-h: 72px;

  /* Shape — 角は絞り、罫線で構造を見せる */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Elevation — 青墨系の繊細な影 */
  --shadow-sm: 0 1px 2px rgba(26, 46, 69, 0.05), 0 4px 16px rgba(26, 46, 69, 0.06);
  --shadow-md: 0 2px 8px rgba(26, 46, 69, 0.07), 0 14px 36px rgba(26, 46, 69, 0.10);
  --shadow-cta: 0 2px 10px rgba(192, 96, 58, 0.28);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.65s;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* 横スクロール防止 — .fade-left/.fade-right の translateX(±28px) が
   ビューポート外へはみ出すため、横方向のオーバーフローを切り落とす */
html,
body {
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--offwhite);
  line-height: 1.8;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 紙の質感 — 画面全体にごく薄い粒子を重ね、フラットな「AI感」を消す */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.028;
  mix-blend-mode: multiply;
}

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

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

::selection {
  background: rgba(192, 96, 58, 0.18);
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   3. Scroll Reveal（IntersectionObserver と対）
   -------------------------------------------------------------------------- */
.fade-in,
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.fade-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.fade-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.scale-in {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.fade-in.visible,
.fade-up.visible,
.fade-left.visible,
.fade-right.visible,
.scale-in.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in, .fade-up, .fade-left, .fade-right, .scale-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--orange-cta);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 13px 26px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-cta);
  transition: background 0.2s, transform 0.18s var(--ease-out), box-shadow 0.2s;
}

.btn-cta:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(192, 96, 58, 0.34);
}

.btn-cta:active {
  transform: translateY(0);
}

.btn-cta-lg {
  font-size: 16px;
  padding: 17px 38px;
  letter-spacing: 0.06em;
}

.btn-nav-cta {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Section Primitives — 罫線キッカー＋明朝見出し
   -------------------------------------------------------------------------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--orange);
  margin-bottom: 18px;
}

.section-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--orange);
  flex-shrink: 0;
}

.section-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: var(--navy-dark);
  margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(224, 221, 216, 0.6);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

#site-header.scrolled {
  border-color: var(--border);
  box-shadow: 0 2px 24px rgba(26, 46, 69, 0.08);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
}

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

.header-logo img {
  height: 34px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.header-nav a {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 4px 0;
  white-space: nowrap;
  transition: color 0.2s;
}

.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.header-nav a:hover {
  color: var(--navy);
}

.header-nav a:hover::after {
  transform: scaleX(1);
}

/* 暗いヒーローに重なるヘッダー（haken等） */
#site-header.header-dark {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#site-header.header-dark .header-logo img {
  filter: brightness(0) invert(1);
  transition: filter 0.35s ease;
}

#site-header.header-dark .hamburger span {
  background: #fff;
}

#site-header.header-dark.scrolled {
  background: rgba(250, 250, 248, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

#site-header.header-dark.scrolled .header-logo img {
  filter: none;
}

#site-header.header-dark.scrolled .hamburger span {
  background: var(--navy);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 28px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(26, 46, 69, 0.1);
}

.mobile-nav.open { display: block; }

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.mobile-nav ul li a {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.mobile-nav .btn-cta {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--orange);
  margin-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--offwhite);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(44, 74, 110, 0.08);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
#footer {
  position: relative;
  background: var(--navy-deep);
  padding: 56px 0 32px;
}

#footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange) 0%, rgba(192, 96, 58, 0) 65%);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 48px;
  align-items: center;
  margin-bottom: 40px;
}

.footer-logo img {
  height: 30px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-tagline {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 10px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  list-style: none;
}

.footer-nav a {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-copyright {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a,
.footer-links span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links span:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   9. Responsive — 共通
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-top .footer-nav {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .header-nav,
  .btn-nav-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-top .btn-cta {
    justify-content: center;
    width: 100%;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}
