/* =========================================================
   筑後運転代行  style.css
   ========================================================= */
:root {
  --bg: #ffffff;
  --text: #1f1f1f;
  --muted: #707070;
  --faint: #bdbdbd;
  --line: #e4e4e4;
  --soft: #f5f5f3;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --latin: "Cormorant Garamond", "Times New Roman", serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --header-h: 72px;
  --wrap: 1040px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .04em;
  font-feature-settings: "palt";
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
picture { display: block; height: 100%; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* ---------------------------------------------------------
   header
   --------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  transition: background-color .5s var(--ease), box-shadow .5s var(--ease);
  animation: fadeDown 1s var(--ease) .2s both;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  height: 100%;
  padding-inline: clamp(16px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: 1.15rem; letter-spacing: .18em; line-height: 1;
}
.nav { display: flex; gap: clamp(16px, 3vw, 36px); font-size: .82rem; letter-spacing: .12em; }
.nav a { position: relative; padding-block: 6px; color: var(--muted); transition: color .3s; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav a:hover, .nav a:focus-visible { color: var(--text); }
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; }
.progress span {
  display: block; height: 100%; background: var(--text);
  transform: scaleX(var(--progress, 0)); transform-origin: left;
}

/* ---------------------------------------------------------
   hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 400px);
  min-height: min(100svh, 900px);
  padding-top: var(--header-h);
}
.hero-media {
  position: relative; overflow: hidden;
  margin: 16px 0 72px;
  animation: wipe 1.6s var(--ease-io) .3s both;
}
.hero-media-inner { height: 100%; animation: settle 2.6s var(--ease) .3s both; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero-text {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 72px;
}
.hero-en {
  display: none;
  position: absolute; top: 20px; left: 16px; margin: 0;
  font-family: var(--latin); font-style: italic; font-size: .95rem; line-height: 1.3;
  color: var(--faint); text-align: left; letter-spacing: .06em;
  animation: fadeIn 1.4s var(--ease) 1.8s both;
}
.hero-vertical {
  writing-mode: vertical-rl;
  /* 縦書きでは column が右→左の並びになる */
  display: flex; flex-direction: column; align-items: flex-start;
}
.hero-title {
  margin: 0 0 0 1.4em;
  font-family: var(--serif); font-weight: 500;
  /* 画面の幅と高さの両方に合わせて縮め、1行が必ず収まるようにする */
  font-size: clamp(1.3rem, min(1rem + 1.5vw, (100svh - 240px) / 15), 2.25rem);
  line-height: 1.9; letter-spacing: .28em;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-title .line + .line { padding-top: 2.2em; }
.hero-title .ch {
  display: inline-block;
  animation: charIn 1.1s var(--ease) both;
  animation-delay: calc(.9s + var(--i) * .07s);
}
.hero-lead, .hero-cert { margin: 0; white-space: nowrap; font-size: .8rem; color: var(--muted); letter-spacing: .2em; line-height: 2.2; }
.hero-lead { margin-left: 1.6em; padding-top: 5em; animation: fadeIn 1.4s var(--ease) 2.2s both; }
.hero-cert {
  padding-top: 5em; padding-left: .2em;
  border-right: 1px solid var(--line); padding-right: 1.4em;
  animation: fadeIn 1.4s var(--ease) 2.4s both;
}

.scroll-cue {
  position: absolute; left: clamp(16px, 4vw, 48px); bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--latin); font-size: .78rem; letter-spacing: .2em; color: var(--muted);
  animation: fadeIn 1s var(--ease) 2.6s both;
}
.scroll-cue span { writing-mode: vertical-rl; }
.scroll-cue i { position: relative; display: block; width: 1px; height: 64px; background: var(--line); overflow: hidden; }
.scroll-cue i::after {
  content: ""; position: absolute; inset: 0; background: var(--text);
  animation: scrollLine 2.2s var(--ease-io) infinite;
}

/* ---------------------------------------------------------
   sections
   --------------------------------------------------------- */
.section { padding-block: clamp(88px, 12vw, 160px); }
.section--safety { background: var(--soft); }

.section-head {
  display: grid; grid-template-columns: auto 1fr; align-items: end;
  column-gap: 20px; margin-bottom: clamp(40px, 6vw, 72px);
}
.section-num {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 2rem + 4vw, 5.5rem); line-height: .8;
  color: transparent; -webkit-text-stroke: 1px var(--faint);
}
.section-en {
  margin: 0; font-family: var(--latin); font-style: italic;
  font-size: 1rem; color: var(--muted); letter-spacing: .1em; line-height: 1;
}
.section-title {
  margin: 8px 0 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); letter-spacing: .16em; line-height: 1.5;
}
.section-rule {
  grid-column: 1 / -1; height: 1px; margin-top: 24px; background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.4s var(--ease-io) .3s;
}
.section-head.is-visible .section-rule { transform: scaleX(1); }

/* about */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px); align-items: start;
}
.cert-card {
  position: relative; padding: 36px 32px 32px;
  border: 1px solid var(--text);
  background: var(--bg);
}
.cert-card::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none;
}
.cert-label { margin: 0; font-size: .8rem; letter-spacing: .2em; color: var(--muted); }
.cert-number {
  margin: 14px 0 18px; display: flex; align-items: baseline; gap: .3em;
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: .1em;
}
.odometer {
  display: inline-flex; font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.2rem, 1.8rem + 1.6vw, 2.9rem); line-height: 1; letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.odometer .digit { display: inline-block; height: 1.2em; overflow: hidden; }
.odometer .reel {
  display: flex; flex-direction: column;
  transition: transform 2s var(--ease-io);
  transition-delay: calc(.2s + var(--d) * .12s);
}
.odometer .reel span { height: 1.2em; line-height: 1.2; text-align: center; }
.cert-note { margin: 0; font-size: .74rem; color: var(--muted); line-height: 1.8; }

.info { margin: 0; border-top: 1px solid var(--text); }
.info div {
  position: relative;
  display: grid; grid-template-columns: 9em 1fr; gap: 16px;
  padding: 20px 4px;
}
.info div::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease-io);
  transition-delay: calc(var(--i, 0) * .09s + .2s);
}
.info.is-visible div::after { transform: scaleX(1); }
.info dt { color: var(--muted); font-size: .86rem; }
.info dd { margin: 0; }
.tel { font-variant-numeric: tabular-nums; letter-spacing: .1em; }

/* safety */
.safety-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; }
.frame-inner { position: absolute; inset: -8% 0; }
.frame img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.safety-catch {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); line-height: 1.8; letter-spacing: .12em;
}
.safety-text p { margin: 0 0 1.2em; }
.safety-text p:not(.safety-catch) { font-size: .94rem; color: #444; }

/* ---------------------------------------------------------
   footer
   --------------------------------------------------------- */
.site-footer { padding-block: clamp(64px, 10vw, 120px) 32px; overflow: hidden; }
.footer-mark {
  margin: 0 0 32px; font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.4rem, 1rem + 7vw, 6.5rem); line-height: 1.1; letter-spacing: .2em;
  color: transparent; -webkit-text-stroke: 1px var(--line);
  white-space: nowrap;
}
.footer-info {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .76rem;
}
.footer-info p { margin: 0; }
.footer-info p:first-child span::before { content: "／"; margin-inline: .6em; color: var(--faint); }

/* ---------------------------------------------------------
   scroll reveal（JS有効時のみ）
   --------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-stagger] { opacity: 1; transform: none; }
.js .reveal[data-stagger] > * {
  opacity: 0; transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--i, 0) * .09s);
}
.js .reveal[data-stagger].is-visible > * { opacity: 1; transform: none; }

/* 写真はフェードインで現れる（内側の画像は視差効果のため個別に動かす） */
.js .frame.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.js .frame.reveal.is-visible { opacity: 1; transform: none; }

.js .footer-mark.reveal { transform: translateX(-40px); transition-duration: 1.8s; }
.js .footer-mark.reveal.is-visible { transform: none; }

/* ---------------------------------------------------------
   keyframes
   --------------------------------------------------------- */
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { transform: scale(1.18); } to { transform: scale(1); } }
@keyframes charIn {
  from { opacity: 0; transform: translateY(-.5em); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes scrollLine {
  0%   { transform: translateY(-100%); }
  50%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* ---------------------------------------------------------
   responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .cert-card { max-width: 420px; }
}
@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { order: -1; padding: 56px 16px 40px; }
  .hero-en { display: block; }
  .hero-text { justify-content: flex-end; padding: 48px 24px 40px; }
  .hero-title { font-size: 1.4rem; margin-left: 1em; }
  .hero-lead, .hero-cert { padding-top: 3em; font-size: .74rem; }
  .hero-lead { margin-left: 1em; }
  .hero-media { margin: 0; aspect-ratio: 4 / 3; }
  .scroll-cue { display: none; }
  .safety-grid { grid-template-columns: 1fr; }
  .info div { grid-template-columns: 1fr; gap: 0; padding: 14px 4px; }
  .footer-info { flex-direction: column; }
  .footer-info p:first-child span { display: block; }
  .footer-info p:first-child span::before { content: none; }
}

@media (max-width: 420px) {
  .hero-en { display: none; }
}
/* 動きを減らす設定の利用者にはアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  html { scroll-behavior: auto; }
}
@media print {
  .site-header { position: static; }
  .js .reveal, .js .reveal[data-stagger] > * { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
