@charset "utf-8";

/* ==========================================================================
   山甲林業 — 配電線支障木伐採・災害倒木対応
   デザイン方針: 緑を使わない。写真を証拠として扱い、寸法線で信頼を組む。
   ========================================================================== */

:root {
  --paper: #f6f7f5;
  --paper-deep: #eceee9;
  --ink: #161a17;
  --ink-60: #5c6360;
  --steel: #9aa0a0;
  --rule: #d8dbd6;
  --hazard: #f2c230;

  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --body: "Yu Gothic", "YuGothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --scale-w: 34px; /* 左端スケールバーの幅 */
  --maxw: 1280px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  font-feature-settings: "palt" 1;
  padding-left: var(--scale-w);
}

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

a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   左端の縦スケール — 全ページを貫通する
   -------------------------------------------------------------------------- */
.scale {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--scale-w);
  border-right: 1px solid var(--rule);
  background: var(--paper);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scale__ticks {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--rule) 0 1px,
    transparent 1px 24px
  );
  opacity: 0.7;
}

.scale__label {
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-60);
  writing-mode: vertical-rl;
  text-transform: uppercase;
  background: var(--paper);
  padding: 14px 0;
}

/* --------------------------------------------------------------------------
   ヘッダ
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.masthead__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 4vw, 56px);
  min-height: 62px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.16em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-60);
  display: block;
  letter-spacing: 0.24em;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: clamp(14px, 2.6vw, 32px);
  margin-left: auto;
  list-style: none;
  padding: 0;
}

.nav a {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  border-bottom-color: var(--ink);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--hazard);
  border-bottom-width: 2px;
}

/* --------------------------------------------------------------------------
   レイアウト土台
   -------------------------------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.band {
  padding-block: clamp(64px, 9vw, 132px);
  border-top: 1px solid var(--rule);
}

.band--tight {
  padding-block: clamp(44px, 6vw, 80px);
}

.band--flush {
  border-top: 0;
}

/* セクション見出し: 番号ではなく実際の数値・記号を置く */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink-60);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.42;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(24px, 3.4vw, 40px);
  margin-bottom: 28px;
}

h3 {
  font-size: clamp(17px, 1.7vw, 21px);
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 1.1em;
  max-width: 62ch;
}

.lede {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 2.05;
}

.muted {
  color: var(--ink-60);
}

/* --------------------------------------------------------------------------
   ヒーロー — 写真の上に寸法線を引く
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.hero__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 380px;
  overflow: hidden;
  background: var(--paper-deep);
}

.hero__frame .photo-slot {
  position: absolute;
  inset: 0;
}

/* 電線ライン */
.hero__wire {
  position: absolute;
  left: 0;
  right: 0;
  top: 26%;
  height: 1px;
  background: var(--paper);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.hero__wire::before,
.hero__wire::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--paper);
  background: var(--ink);
}

.hero__wire::before {
  left: 14%;
}

.hero__wire::after {
  right: 14%;
}

/* 寸法線 */
.hero__dim {
  position: absolute;
  left: 10%;
  top: 26%;
  height: 30%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__dim-line {
  width: 1px;
  height: 100%;
  background: var(--hazard);
  position: relative;
  transform-origin: top center;
}

.hero__dim-line::before,
.hero__dim-line::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--hazard);
}

.hero__dim-line::before {
  top: 0;
}

.hero__dim-line::after {
  bottom: 0;
}

.hero__dim-value {
  font-family: var(--mono);
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.14em;
  color: var(--hazard);
  background: rgba(22, 26, 23, 0.72);
  padding: 3px 8px;
  white-space: nowrap;
}

.hero__copy {
  position: relative;
  z-index: 5;
  padding: var(--gutter);
  padding-top: clamp(120px, 22vh, 260px);
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero__title {
  font-size: clamp(27px, 5vw, 62px);
  line-height: 1.3;
  color: var(--paper);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.55);
  max-width: 22ch;
}

.hero__sub {
  margin-top: 20px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   写真スロット — 実写に差し替える前提のプレースホルダ
   -------------------------------------------------------------------------- */
.photo {
  margin: 0;
}

.photo-slot {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #b9bebc 0%, #7f8886 55%, #5f6765 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-slot__note {
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  padding: 0 14px;
  line-height: 1.9;
}

.photo-slot--tall {
  aspect-ratio: 3 / 4;
}

.photo-slot--wide {
  aspect-ratio: 16 / 9;
}

.photo-slot--square {
  aspect-ratio: 1 / 1;
}

/* キャプションは必ず実測値を持つ */
.photo figcaption {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  line-height: 1.7;
}

.photo figcaption b {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-60);
  white-space: nowrap;
  flex: none;
}

/* --------------------------------------------------------------------------
   写真グリッド
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(18px, 2.6vw, 34px);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--offset > *:nth-child(even) {
  transform: translateY(clamp(16px, 4vw, 56px));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.split--text-first {
  align-items: center;
}

/* --------------------------------------------------------------------------
   数値ブロック
   -------------------------------------------------------------------------- */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.figure {
  padding: 22px 18px 26px 0;
  border-right: 1px solid var(--rule);
}

.figure:last-child {
  border-right: 0;
}

.figure__n {
  font-family: var(--mono);
  font-size: clamp(24px, 3.2vw, 38px);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  display: block;
}

.figure__n small {
  font-size: 0.42em;
  letter-spacing: 0.14em;
  margin-left: 6px;
  color: var(--ink-60);
}

.figure__k {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-60);
}

/* --------------------------------------------------------------------------
   業務内容カード
   -------------------------------------------------------------------------- */
.work {
  border-top: 1px solid var(--ink);
  padding-top: 18px;
}

.work__tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-60);
  display: block;
  margin-bottom: 12px;
}

.work h3 {
  margin-bottom: 12px;
}

.work .photo {
  margin-top: 18px;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.spec th,
.spec td {
  text-align: left;
  vertical-align: top;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}

.spec th {
  width: 30%;
  color: var(--ink-60);
  font-family: var(--sans);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.spec td {
  font-family: var(--body);
}

.spec .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   出動フロー（順序が意味を持つので番号を使う）
   -------------------------------------------------------------------------- */
.flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  counter-reset: step;
}

.flow li {
  border-top: 2px solid var(--hazard);
  padding-top: 14px;
  counter-increment: step;
}

.flow li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-60);
  display: block;
  margin-bottom: 8px;
}

.flow strong {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  display: block;
  margin-bottom: 6px;
}

.flow span {
  font-size: 12.5px;
  color: var(--ink-60);
  line-height: 1.8;
}

.flow .t {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   ボタン・リンク
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 15px 26px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn:hover,
.btn:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.btn__arrow {
  font-family: var(--mono);
  font-size: 12px;
}

/* 緊急連絡 */
.urgent {
  border: 1px solid var(--ink);
  border-left: 4px solid var(--hazard);
  padding: clamp(20px, 3vw, 34px);
  display: flex;
  flex-wrap: wrap;
  gap: 20px 44px;
  align-items: center;
}

.urgent__k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-60);
  display: block;
  margin-bottom: 6px;
}

.urgent__tel {
  font-family: var(--mono);
  font-size: clamp(22px, 3.4vw, 34px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   フォーム
   -------------------------------------------------------------------------- */
.field {
  margin-bottom: 26px;
}

.field label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.field .req {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-60);
  margin-left: 10px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--steel);
  padding: 11px 2px;
  border-radius: 0;
  letter-spacing: 0.04em;
}

.field textarea {
  border: 1px solid var(--steel);
  padding: 12px;
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--hazard);
  outline-offset: 3px;
  border-bottom-color: var(--ink);
}

.field .hint {
  font-size: 12px;
  color: var(--ink-60);
  margin: 8px 0 0;
}

/* --------------------------------------------------------------------------
   フッタ
   -------------------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--ink);
  margin-top: clamp(60px, 8vw, 110px);
  padding-block: 44px 60px;
  font-size: 13px;
}

.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
  justify-content: space-between;
  align-items: flex-start;
}

.foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.foot a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot a:hover,
.foot a:focus-visible {
  border-bottom-color: var(--ink);
}

.foot__meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-60);
  line-height: 2;
}

/* --------------------------------------------------------------------------
   モーション — スクロール駆動。JSなし。
   -------------------------------------------------------------------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 26%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__dim-line {
    animation: measure 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both;
  }

  .hero__dim-value,
  .hero__title,
  .hero__sub {
    animation: fade 0.9s ease-out 0.6s both;
  }
}

@keyframes measure {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   アクセシビリティ
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--hazard);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 100;
  font-size: 13px;
}

.skip:focus {
  left: calc(var(--scale-w) + 8px);
}

/* --------------------------------------------------------------------------
   レスポンシブ
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure:nth-child(2) {
    border-right: 0;
  }

  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  :root {
    --scale-w: 22px;
  }

  body {
    font-size: 14.5px;
  }

  .scale__label {
    display: none;
  }

  .nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 12px;
    gap: 20px;
  }

  .masthead__in {
    padding-top: 12px;
    align-items: flex-start;
  }

  .hero__frame {
    aspect-ratio: 3 / 4;
    min-height: 460px;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--offset > *:nth-child(even) {
    transform: none;
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .figures {
    grid-template-columns: minmax(0, 1fr);
  }

  .figure {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
  }

  .spec th {
    width: 36%;
  }
}
