/* ============================================================
   base.css — 全ページ共通スタイル
   株式会社岡田金属工作所 / OKADA METAL WORKS
   ============================================================ */

/* ---------- Page Transition ---------- */
/* body に直接 animation を掛けることで、
   JS 読み込み前から opacity:0 が効きちらつきを防ぐ */
body {
  animation: page-enter 250ms cubic-bezier(0, 0, .2, 1) both;
}
@keyframes page-enter {
  from { opacity: 0 }
}
/* 離脱時: JS が付与するクラス */
body.is-leaving {
  opacity: 0 !important;
  transition: opacity 120ms ease-in;
}

/* ---------- Design Tokens ---------- */
:root {
  --ink: #14304a;
  --ink-deep: #0e2236;
  --ink-mid: #23496b;
  --paper: #f4f3ee;
  --paper-2: #ecebe4;
  --fog: #e6e4dd;
  --line: #d8d6cd;
  --slate: #5a6470;
  --slate-2: #8a8f97;
  --white: #ffffff;
  --serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --jp: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  --en: 'Barlow Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', ui-monospace, monospace;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box }
html, body { margin: 0; padding: 0 }
html {
  scrollbar-gutter: stable;
  background: var(--ink);
}
body {
  font-family: var(--jp);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100% }
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer }

/* ---------- Header ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 84px; min-height: 84px; max-height: 84px;
  display: flex; align-items: center;
  padding: 0 40px;
  margin: 0;
  background: rgba(244, 243, 238, .96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(20, 48, 74, .08);
  transition: background .3s, border-color .3s, color .3s;
}
.topbar.is-hero {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, .12);
  color: #fff;
}
.brand { display: flex; align-items: center; flex-shrink: 0 }
.brand-logo {
  height: 36px; width: auto;
  display: block; overflow: visible;
}
.brand-logo .logo-en {
  fill: #2c5aa0;
  transition: fill .3s;
}
.brand-logo .logo-jp {
  fill: var(--ink);
  transition: fill .3s;
}
.topbar.is-hero .brand-logo .logo-en { fill: #7db8e8 }
.topbar.is-hero .brand-logo .logo-jp { fill: #fff }

.nav {
  margin-left: auto; display: flex; align-items: center; gap: 34px;
  flex-shrink: 0;
}
.nav-link {
  font-size: 13px; font-weight: 500; letter-spacing: .06em;
  line-height: 1;
  position: relative; padding: 8px 0;
  white-space: nowrap;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: currentColor; transition: right .35s ease;
}
.nav-link:hover::after { right: 0 }
.nav-link .num {
  font-family: var(--mono); font-size: 10px; color: var(--slate-2);
  margin-right: 6px; line-height: 1;
}
.topbar.is-hero .nav-link .num { color: rgba(255, 255, 255, .5) }

.cta-pill {
  margin-left: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--ink); color: #fff;
  font-size: 12px; letter-spacing: .14em; font-weight: 600;
  line-height: 1;
  border: 1px solid var(--ink);
  transition: background .25s, color .25s, border-color .25s;
}
.cta-pill .arr { font-family: var(--en); font-weight: 400 }
.cta-pill:hover { background: var(--ink-mid); border-color: var(--ink-mid) }
.topbar.is-hero .cta-pill { background: #fff; color: var(--ink); border-color: #fff }
.topbar.is-hero .cta-pill:hover { background: rgba(255, 255, 255, .85); border-color: rgba(255, 255, 255, .85) }

.menu-btn { display: none }

/* ---------- Shared Section Chrome ---------- */
section { position: relative }
.container {
  width: min(1320px, 100% - 96px);
  margin-inline: auto;
}
.sec-num {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--slate-2);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.sec-num::before {
  content: ""; width: 24px; height: 1px; background: currentColor;
}
.sec-title {
  font-family: var(--en); font-weight: 500;
  font-size: clamp(56px, 7vw, 110px);
  line-height: .95;
  letter-spacing: .01em;
  margin: 0;
  text-transform: uppercase;
}
.sec-title-ja {
  font-size: 14px; letter-spacing: .34em; color: var(--slate);
  font-weight: 500; margin-top: 14px;
}
.sec-watermark {
  position: absolute;
  font-family: var(--en); font-weight: 600;
  font-size: clamp(180px, 22vw, 360px);
  line-height: .85; letter-spacing: .01em;
  color: rgba(20, 48, 74, .04);
  pointer-events: none;
  text-transform: uppercase;
  user-select: none;
}
.on-dark .sec-watermark { color: rgba(255, 255, 255, .04) }

/* ---------- Zigzag Divider ---------- */
.zig {
  width: 100%; height: 24px; display: block;
}
.zig path { stroke: currentColor; stroke-width: 1.2; fill: none; opacity: .45 }

/* ---------- Shared Buttons ---------- */
.btn-line {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 18px 28px 18px 24px;
  border: 1px solid rgba(255, 255, 255, .5);
  color: #fff;
  font-size: 13px; letter-spacing: .16em; font-weight: 500;
  transition: background .3s, border-color .3s, padding .3s;
}
.btn-line .arrow {
  width: 36px; height: 1px; background: #fff; position: relative; transition: width .3s;
}
.btn-line .arrow::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 8px; height: 8px; border-top: 1px solid #fff; border-right: 1px solid #fff;
  transform: rotate(45deg);
}
.btn-line:hover { background: rgba(255, 255, 255, .1); padding-right: 34px }
.btn-line:hover .arrow { width: 48px }
.btn-line.is-ink { border-color: var(--ink); color: var(--ink) }
.btn-line.is-ink .arrow { background: var(--ink) }
.btn-line.is-ink .arrow::after { border-top-color: var(--ink); border-right-color: var(--ink) }
.btn-line.is-ink:hover { background: rgba(20, 48, 74, .06) }

.btn-fill {
  flex: 1; min-width: 200px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 24px;
  background: #fff; color: var(--ink);
  font-size: 13px; letter-spacing: .16em; font-weight: 600;
  border: 1px solid #fff;
  transition: background .25s, color .25s;
}
.btn-fill:hover { background: transparent; color: #fff }
.btn-fill.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4) }
.btn-fill.ghost:hover { background: #fff; color: var(--ink); border-color: #fff }

/* ---------- Placeholder Images ---------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(0, 0, 0, .06) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #c8c5bb 0%, #a8a59b 100%);
  overflow: hidden;
}
.ph.dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, .05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #1f3a55 0%, #0e2236 100%);
}
.ph .ph-cap {
  position: absolute; left: 14px; bottom: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  color: rgba(255, 255, 255, .85);
  background: rgba(20, 48, 74, .7);
  padding: 6px 10px;
}
.ph.light .ph-cap {
  color: var(--ink); background: rgba(255, 255, 255, .85);
}
.ph .ph-mark {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  color: rgba(255, 255, 255, .6);
}

/* ---------- Fade-in Animation ---------- */
.fade { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease }
.fade.visible { opacity: 1; transform: none }
.fade.d1 { transition-delay: .08s }
.fade.d2 { transition-delay: .16s }
.fade.d3 { transition-delay: .24s }
.fade.d4 { transition-delay: .32s }

/* ---------- Footer ---------- */
footer {
  background: var(--ink-deep); color: rgba(255, 255, 255, .75);
  padding: 80px 0 32px;
  font-size: 13px; letter-spacing: .06em;
}
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 60px;
  padding-bottom: 60px; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.foot-brand .brand-logo {
  height: 32px; width: auto;
  display: block; overflow: visible;
  margin-bottom: 20px;
}
.foot-brand .brand-logo .logo-en { fill: #7db8e8 }
.foot-brand .brand-logo .logo-jp { fill: #fff }
.foot-brand p { margin: 0; line-height: 2; color: rgba(255, 255, 255, .7); font-size: 13px }
.foot-col h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; font-weight: 500;
  color: rgba(255, 255, 255, .55); margin: 0 0 18px; text-transform: uppercase;
}
.foot-col ul { margin: 0; padding: 0; list-style: none }
.foot-col li { padding: 6px 0; font-size: 13px }
.foot-col li a { color: rgba(255, 255, 255, .85); transition: color .2s }
.foot-col li a:hover { color: #fff }
.foot-bottom {
  padding-top: 28px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: rgba(255, 255, 255, .45);
  text-transform: uppercase;
}

/* ============================================================
   Responsive — Shared breakpoints
   ============================================================ */
@media (max-width: 1100px) {
  .nav { gap: 22px }
  .nav-link .num { display: none }
  .container { width: min(1320px, 100% - 56px) }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px }
}
@media (max-width: 720px) {
  html { overflow-x: hidden }
  .topbar { padding: 0 18px; height: 64px; min-height: 64px; max-height: 64px }
  .brand-logo { height: 28px }
  .nav { display: none }
  .menu-btn {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid currentColor; margin-left: auto;
    flex-shrink: 0;
  }
  .menu-btn span { display: block; width: 18px; height: 1px; background: currentColor; position: relative; transition: transform .3s, opacity .3s }
  .menu-btn span::before, .menu-btn span::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 1px; background: currentColor;
    transition: transform .3s, top .3s;
  }
  .menu-btn span::before { top: -6px }
  .menu-btn span::after { top: 6px }
  .cta-pill { display: none }
  .container { width: min(1320px, 100% - 36px) }
  .sec-watermark { display: none }
  .sec-title { font-size: clamp(36px, 10vw, 56px) }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px }
  .foot-bottom { flex-direction: column; gap: 12px; text-align: center }
}

/* ---------- Mobile Menu Overlay ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: var(--ink-deep);
  color: #fff;
  padding: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.mobile-menu.is-open {
  opacity: 1; visibility: visible;
}
.mobile-menu-header {
  height: 64px; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.mobile-menu-header .brand-logo { height: 28px }
.mobile-menu-header .brand-logo .logo-en { fill: #7db8e8 }
.mobile-menu-header .brand-logo .logo-jp { fill: #fff }
.mobile-menu-close {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff; background: none; cursor: pointer;
}
.mobile-menu-close svg { width: 18px; height: 18px }
.mobile-menu-body {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 0; padding: 0 36px;
}
.mobile-menu-link {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 18px; font-weight: 500; letter-spacing: .1em;
  color: #fff; text-decoration: none;
}
.mobile-menu-link .num {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  color: rgba(255,255,255,.45); min-width: 28px;
}
.mobile-menu-cta {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; margin-top: 36px; padding: 20px 24px;
  background: #fff; color: var(--ink);
  font-size: 14px; letter-spacing: .16em; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
}
.mobile-menu-cta .arr { font-family: var(--en); font-weight: 400 }

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transform: none; transition: none }
  body { animation: none }
  body.is-leaving { transition: none }
}
