/* ITtech Works — base styles */

:root {
  --primary: #14224a;
  --primary-700: #0e1a3d;
  --primary-600: #1a2a5c;
  --primary-500: #2a4691;
  --primary-100: #e6edf9;
  --primary-50: #f3f6fc;

  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --bg-soft-2: #eef2f8;
  --surface: #ffffff;
  --border: #e8ecf2;
  --border-strong: #cdd5e2;
  --hairline: rgba(15, 26, 46, 0.08);

  --fg: #0b1426;
  --fg-2: #2a3853;
  --fg-3: #5b6781;
  --fg-4: #8a93a8;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  --font-jp: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --font-en: "Inter", system-ui, sans-serif;
  --font-serif: "Noto Serif JP", "Cormorant Garamond", "Times New Roman", serif;

  --container: 1200px;

  --shadow-sm: 0 1px 1px rgba(15, 26, 46, 0.03), 0 1px 2px rgba(15, 26, 46, 0.02);
  --shadow-md: 0 1px 2px rgba(15, 26, 46, 0.03), 0 8px 24px rgba(15, 26, 46, 0.05);
  --shadow-lg: 0 4px 12px rgba(15, 26, 46, 0.05), 0 24px 48px rgba(15, 26, 46, 0.08);
  --shadow-cta: 0 6px 18px rgba(20, 34, 74, 0.18);
}

[data-theme="dark"] {
  --bg: #0a1124;
  --bg-soft: #0f1830;
  --bg-soft-2: #131e3b;
  --surface: #131c36;
  --border: #1f2a47;
  --border-strong: #2c3a5d;

  --fg: #eef2fb;
  --fg-2: #c8d1e6;
  --fg-3: #8c98b5;
  --fg-4: #65718e;

  --primary-100: #1c2b54;
  --primary-50: #16223f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-cta: 0 8px 24px rgba(59, 98, 201, 0.5);
}

[data-density="compact"] { --density: 0.85; }
[data-density="regular"] { --density: 1; }
[data-density="comfy"]   { --density: 1.15; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-jp);
  font-feature-settings: "palt";
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

.eyebrow {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--primary-600);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  display: inline-block;
}

.section-title {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-align: center;
  margin: 0 0 calc(48px * var(--density));
  line-height: 1.32;
}

.section-title .accent { color: var(--primary-600); }

.section {
  padding: calc(112px * var(--density)) 0;
  position: relative;
}

.section.tight { padding: calc(80px * var(--density)) 0; }

.section + .section.alt {
  background: var(--bg-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 26px;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--primary-700); box-shadow: 0 10px 24px rgba(20, 34, 74, 0.28); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
[data-theme="dark"] .btn-outline { color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-soft); border-color: var(--fg); color: var(--fg); }

.btn-ghost {
  background: transparent;
  color: var(--fg-2);
}
.btn-ghost:hover { color: var(--primary-600); }

.btn-lg { padding: 17px 30px; font-size: 15px; }
.btn-block { width: 100%; }

/* Card primitive */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius, 16px);
  transition: border-color 0.25s, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s;
}
.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Section divider — thin hairline with center dot */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 80px;
  margin: 0 auto 32px;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.section-divider span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary-600);
  flex: 0 0 auto;
}

/* Image refinements */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.img-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s;
}
.img-frame:hover img { transform: scale(1.04); }
.img-frame::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 26, 46, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  color: var(--fg-2);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover { color: var(--primary-600); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--primary-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-600);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--btn-radius, 10px);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-cta); }

/* Mobile nav toggle */
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-links, .nav .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Footer */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
  color: var(--fg-3);
  font-size: 14px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.footer-col h4 {
  font-size: 13px;
  color: var(--fg);
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a:hover { color: var(--primary-600); }
.footer-bottom {
  padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 12px;
  color: var(--fg-4);
}
@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ─── Grid defaults (CSS-only, no inline override) ─────────────────────── */

.hero-feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pains-grid    { grid-template-columns: repeat(5, 1fr); }
.reasons-grid  { grid-template-columns: repeat(4, 1fr); }
.svc-grid      { grid-template-columns: repeat(4, 1fr); }
.pricing-grid  { grid-template-columns: repeat(3, 1fr); }
.flow-grid     { grid-template-columns: repeat(6, 1fr); }
.faq-grid      { grid-template-columns: 1fr 1fr; }

/* ─── Tablet (≤900px) ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .pains-grid   { grid-template-columns: repeat(2, 1fr); }
  .reasons-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-grid     { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .flow-grid    { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .flow-line    { display: none; }
}

@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .faq-grid   { grid-template-columns: 1fr; }
}

/* ─── Mobile (≤640px) ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Hero feature cards: 3col → 1col */
  .hero-feat-grid { grid-template-columns: 1fr !important; max-width: 100% !important; }
  /* Hero buttons: stack vertically */
  .hero-btns { flex-direction: column !important; }
  .hero-btns .btn { width: 100%; justify-content: center; }
  /* Services & Reasons: 2col → 1col */
  .svc-grid     { grid-template-columns: 1fr !important; }
  .reasons-grid { grid-template-columns: 1fr !important; }
  /* Flow: 2col → 1col */
  .flow-grid    { grid-template-columns: 1fr !important; }
}

/* ─── Small mobile (≤600px) ─────────────────────────────────────────────── */

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .section { padding: calc(64px * var(--density)) 0; }
  .section.tight { padding: calc(48px * var(--density)) 0; }
  .section-title { margin-bottom: calc(28px * var(--density)); }
  .btn-lg { padding: 14px 20px; }
  .lb-image-wrap { padding: 0 16px 16px !important; }
}

/* ─── Very small (≤480px) ───────────────────────────────────────────────── */

@media (max-width: 480px) {
  .pains-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .nav { height: 60px; }
}

/* ─── Mobile polish ─────────────────────────────────────────────────────── */

/* Hero: タイトルが3行に崩れないようフォントを縮小 */
@media (max-width: 640px) {
  #top h1 {
    font-size: clamp(24px, 7.2vw, 30px) !important;
    line-height: 1.3 !important;
    margin-bottom: 16px !important;
  }

  /* Hero サブテキスト */
  .hero-content p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px !important;
  }

  /* Hero feature カードをコンパクトに */
  .hero-feat-grid .card { padding: 10px 12px !important; }

  /* セクションタイトル: モバイルで少し小さく */
  .section-title {
    font-size: clamp(22px, 6.4vw, 28px);
    margin-bottom: calc(32px * var(--density));
  }

  /* eyebrow: モバイル中央揃えの余白調整 */
  .eyebrow { font-size: 10px; }

  /* カードのパディングを縮小 */
  .reasons-grid .card { padding: 20px 16px !important; }
  .pains-grid .card   { padding: 20px 14px !important; }
  .pricing-grid .card { padding: 22px 18px !important; }

  /* Worksセクション: ヘッダー部分の縦並び */
  .works-section-header { flex-direction: column !important; align-items: flex-start !important; }

  /* フッター: ロゴ+説明の余白 */
  .site-footer .container > .footer-top > div:first-child p {
    max-width: 100%;
  }

  /* 問い合わせフォームのパディング縮小 */
  .contact-form { padding: 24px 16px !important; border-radius: 14px !important; }

  /* ナビゲーション: ロゴとハンバーガーの余白確保 */
  .brand { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; font-size: 12px; }
}

/* ─── Pricing タブ: 小さい画面でフォントを縮小 ──────────────────────────── */
@media (max-width: 400px) {
  /* pricing toggle button text */
  #pricing .section .container button[style*="border-radius: 999px"] {
    padding: 9px 14px !important;
    font-size: 12px !important;
  }
}

/* ─── Flow: モバイルでステップカードを左揃えレイアウトに ─────────────────── */
@media (max-width: 640px) {
  .flow-grid > * > div[style*="text-align: center"] {
    display: flex;
    align-items: flex-start;
    text-align: left !important;
    gap: 16px;
  }
  .flow-grid > * > div > div:first-child {
    flex: 0 0 auto;
  }
}

/* ─── CTA ボタン文字折り返し防止 ────────────────────────────────────────── */
@media (max-width: 380px) {
  .nav-cta { font-size: 12px; padding: 9px 12px; }
  .btn-lg   { font-size: 14px; padding: 13px 18px; }
}
