/* ==========================================================================
   Base — reset / typography / 共通パーツ
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.9;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-ink);
  margin: 0 0 0.75em;
}

p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-accent); transition: color var(--transition), opacity var(--transition); }
a:hover { opacity: 0.75; }

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

ul, ol { margin: 0; padding: 0; }

figure { margin: 0; }

/* Layout */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--section-gap); }
.section--tint { background: var(--color-surface-2); }
.section--dark {
  background: linear-gradient(160deg, var(--color-deep) 0%, var(--color-deep-2) 100%);
  color: var(--color-on-dark);
}
.section--dark h2, .section--dark h3 { color: var(--color-on-dark); }
.section--dark p { color: var(--color-on-dark-muted); }

/* Section heading（英字ラベル＋日本語見出し） */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.9em;
}
.section-label::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: var(--color-accent-2);
}
.section--dark .section-label { color: var(--color-accent-2); }

.section-title { font-size: var(--fs-h2); margin-bottom: 0.6em; }
.section-lead  { max-width: 46em; color: var(--color-muted); }
.section--dark .section-lead { color: var(--color-on-dark-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85em 2.2em;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); opacity: 1; }

.btn--primary {
  background: var(--color-deep);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 42, 28, 0.25);
}
.btn--primary:hover { background: #245a41; color: #fff; }

/* 最重要CTA（お問い合わせ導線）用のオレンジ（TIDサイトのWEB出願ボタンに対応） */
.btn--orange {
  background: var(--color-orange);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 130, 0, 0.3);
}
.btn--orange:hover { background: #d97600; color: #fff; }

.btn--ghost {
  border: 1.5px solid currentColor;
  color: var(--color-deep);
  background: transparent;
}
.section--dark .btn--ghost { color: var(--color-on-dark); }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ページ共通ヒーロー（下層ページ） */
.page-hero {
  position: relative;
  padding: calc(4.5rem + 72px) 0 4rem; /* 固定ヘッダー分の余白 */
  background: linear-gradient(160deg, var(--color-deep) 0%, var(--color-deep-2) 100%);
  color: var(--color-on-dark);
  overflow: hidden;
}
/* トップと共通の背景写真（回路基板）を薄く敷く */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(14, 42, 28, 0.72) 0%, rgba(10, 30, 20, 0.9) 80%),
    url("../images/hero-bg.jpg") center / cover no-repeat;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(111, 186, 44, 0.35);
}
.page-hero-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent-2);
  margin-bottom: 0.6em;
}
.page-hero-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  color: var(--color-on-dark);
  margin-bottom: 0.35em;
}
.page-hero-lead { color: var(--color-on-dark-muted); max-width: 44em; margin-bottom: 0; }

/* テーブル（実績・アクセスなどで使用） */
.def-table { width: 100%; border-collapse: collapse; }
.def-table th, .def-table td {
  padding: 1em 1.25em;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.def-table th {
  white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-ink);
  width: 9em;
}

/* 補足注記 */
.note {
  font-size: var(--fs-small);
  color: var(--color-muted);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 0.75em 1.5em;
  background: var(--color-deep);
  color: #fff;
}
.skip-link:focus { left: 0; top: 0; }

/* Focus visible */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 2px;
}

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