/* Chase Lab — 事業者サイト共通のスタイル。
   CSP は style-src 'self' / script-src 'none'。インライン style と JS を使わず、動きはこのファイルの CSS だけで作る。
   書体は Noto Serif JP（OFL）を使用文字だけにサブセット化して /fonts/ から配信する（scripts/subset-font.sh）。 */

@font-face {
  font-family: "CL Serif";
  src: url("/fonts/cl-serif.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f2f1ea;      /* 生成りの地 */
  --sheet: #fbfaf5;      /* 図面の用紙 */
  --ink: #1c2124;
  --muted: #5a6266;
  --rule: #d8d5ca;
  --accent: #2f5d62;     /* 従来サイトのアクセント */
  --red: #b42318;        /* AI の赤入れ */
  --dwg: #23303a;        /* 図面の線 */
  --dwg-thin: #5f6d74;
  --serif: "CL Serif", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --dwg-font: "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131718; --sheet: #182022; --ink: #e7e5dd; --muted: #9ba4a7; --rule: #2d3537;
    --accent: #8cbcc1; --red: #f07462; --dwg: #c9d6da; --dwg-thin: #869599;
  }
}
:root[data-theme="dark"] {
  --paper: #131718; --sheet: #182022; --ink: #e7e5dd; --muted: #9ba4a7; --rule: #2d3537;
  --accent: #8cbcc1; --red: #f07462; --dwg: #c9d6da; --dwg-thin: #869599;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  font-weight: 400;
  font-kerning: normal;
  font-variant-numeric: lining-nums proportional-nums;
  text-autospace: normal;          /* 和欧間のアキ（対応ブラウザのみ） */
  line-break: strict;
  overflow-wrap: anywhere;
}
h1, h2, h3, .brand, .nav, .entry-title, .label, .step-no {
  font-feature-settings: "palt";
  word-break: auto-phrase;
  text-wrap: balance;
}
p, li, dd { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--sheet); padding: 4px 10px; z-index: 2; }

/* ---- 枠組み ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.site-header { padding: 22px 0 0; }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 600; letter-spacing: .06em; color: var(--ink); text-decoration: none; }
.brand img { width: 24px; height: 24px; position: relative; top: 1px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 26px; flex-wrap: wrap; font-size: .95rem; letter-spacing: .06em; }
.nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }

main { display: block; }
.label { display: block; font-size: .8rem; letter-spacing: .16em; color: var(--muted); margin: 0 0 14px; }

/* ---- トップ：一画面目 ---- */
.hero { padding: clamp(28px, 6vh, 72px) 0 clamp(40px, 7vh, 88px); }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(28px, 4vw, 64px);
  grid-template-areas: "title fig" "sub fig" "lead fig" "entries fig"; grid-template-rows: auto auto auto 1fr;
}
.hero .text { display: contents; }
.hero h1 { grid-area: title; }
.hero .sub { grid-area: sub; }
.hero .lead { grid-area: lead; }
.hero .entries { grid-area: entries; align-self: start; }
.hero .drawing { grid-area: fig; align-self: center; }
.nb { display: inline-block; white-space: nowrap; }
.cap-short { display: none; }
.hero h1 {
  font-size: clamp(1.75rem, 1rem + 2.4vw, 3.05rem);
  line-height: 1.38;
  font-weight: 600;
  letter-spacing: .03em;
  margin: 0 0 .5em;
}
.hero .sub { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); letter-spacing: .08em; color: var(--accent); margin: 0 0 22px; font-feature-settings: "palt"; }
.hero .lead { margin: 0 0 32px; max-width: 30em; }
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.entries li { border-bottom: 1px solid var(--rule); }
.entries a { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 14px 2px; color: var(--ink); text-decoration: none; }
.entries a:hover .entry-title { color: var(--accent); }
.entry-title { font-size: 1.12rem; font-weight: 600; letter-spacing: .06em; }
.entry-desc { grid-column: 1; font-size: .88rem; color: var(--muted); line-height: 1.7; }
.entries .arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-family: var(--dwg-font); transition: transform .25s ease; }
.entries a:hover .arrow { transform: translateX(4px); }

/* ---- 図面 ---- */
.drawing { margin: 0; }
.sheet-frame { background: var(--sheet); border: 1px solid var(--rule); }
.sheet-frame svg { display: block; width: 100%; height: auto; }
.drawing figcaption { font-size: .82rem; color: var(--muted); line-height: 1.75; margin-top: 12px; }
.drawing figcaption strong { color: var(--red); font-weight: 600; }

.dwg { fill: none; stroke: var(--dwg); stroke-linecap: round; stroke-linejoin: round; }
.dwg .thin { stroke: var(--dwg-thin); stroke-width: .6; }
.dwg .tb { stroke-width: .8; }
.dwg.narrow { display: none; }
.dwg .paper { fill: var(--sheet); stroke: var(--dwg-thin); stroke-width: .8; }
.dwg .card { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
.dwg .thead { fill: var(--rule); stroke: none; opacity: .55; }
.dwg .t-title { font-size: 21px; font-weight: 600; letter-spacing: .1em; }
.dwg .t-b { font-size: 12.5px; font-weight: 600; }
.dwg .t-s2 { font-size: 10.5px; }
.dwg .t-body { font-size: 11.5px; }
.dwg text { fill: var(--dwg); stroke: none; font-family: var(--dwg-font); font-size: 12px; font-variant-numeric: lining-nums; }
.dwg .t-s { font-size: 10px; fill: var(--dwg-thin); }
.dwg .t-m { font-size: 11.5px; }
.dwg .ai { stroke: var(--red); fill: none; stroke-width: 1.6; }
.dwg .ai-dot { fill: var(--red); stroke: none; }
.dwg .ai-text { fill: var(--red); font-family: var(--serif); font-size: 16px; font-weight: 600; font-feature-settings: "palt"; }
.dwg .ai-note { fill: var(--red); font-family: var(--serif); font-size: 11.5px; }

/* メールが届き、AI が注文書とメールの該当箇所を赤で結ぶ（一度だけ再生して止まる） */
.dwg .ai-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.dwg .ai-draw.d1 { animation: cl-draw .8s cubic-bezier(.45,.05,.3,1) 2.6s backwards; }
.dwg .ai-draw.d2 { animation: cl-draw .9s cubic-bezier(.45,.05,.3,1) 3.4s backwards; }
.dwg .ai-draw.d3 { animation: cl-draw .8s cubic-bezier(.45,.05,.3,1) 4.3s backwards; }
.dwg .mail-in { animation: cl-in .9s ease 1.2s backwards; }
.dwg .ai-after { opacity: 1; animation: cl-in .8s ease 5.1s backwards; }
.dwg .sheet-in { animation: cl-in 1.1s ease .1s backwards; }
@keyframes cl-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dwg .ai-draw, .dwg .mail-in, .dwg .ai-after, .dwg .sheet-in { animation: none; }
  .entries .arrow { transition: none; }
}

/* ---- 下層・共通の本文 ---- */
.section { padding: clamp(40px, 7vw, 80px) 0; border-top: 1px solid var(--rule); }
.section h2 { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); font-weight: 600; letter-spacing: .05em; line-height: 1.5; margin: 0 0 20px; }
.section h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: .04em; margin: 32px 0 8px; line-height: 1.6; }
.two { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 16px clamp(28px, 5vw, 72px); }
.prose { max-width: 38em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: 0 0 .5em; }
.prose li::marker { color: var(--accent); }
.note { font-size: .88rem; color: var(--muted); }
.more { margin-top: 18px; }
.more a { letter-spacing: .04em; }

.page-head { padding: clamp(36px, 7vw, 84px) 0 clamp(28px, 5vw, 56px); }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem); font-weight: 600; letter-spacing: .05em; line-height: 1.4; margin: 0 0 18px; }
.page-head .lead { max-width: 34em; margin: 0; font-size: 1.05rem; }

.examples { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); }
.examples li { padding: 16px 0 18px; border-top: 1px solid var(--rule); }
.examples b { display: block; font-weight: 600; letter-spacing: .04em; margin-bottom: 4px; font-feature-settings: "palt"; }
.examples span { font-size: .94rem; color: var(--muted); line-height: 1.8; }

.price { margin: 22px 0 0; padding: 14px 18px; border-left: 2px solid var(--accent); background: var(--sheet); }
.price p { margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 0 16px; padding: 22px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.step-no { font-size: 1.6rem; line-height: 1.3; color: var(--accent); font-variant-numeric: tabular-nums; }
.steps h3 { margin: 0 0 4px; font-size: 1.12rem; }
.steps p { margin: 0; }

.case { max-width: 46em; }
.case-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .86rem; color: var(--muted); margin: 0 0 18px; }
.case .result { font-size: 1.15rem; line-height: 1.75; margin: 6px 0 20px; padding: 0 0 0 16px; border-left: 2px solid var(--accent); }
.tag { display: inline-block; font-size: .78rem; letter-spacing: .1em; color: var(--red); border: 1px solid currentColor; padding: 0 8px; border-radius: 2px; margin-bottom: 10px; }

.facts { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 12px 24px; margin: 0; max-width: 40em; }
.facts dt { color: var(--muted); font-size: .94rem; }
.facts dd { margin: 0; }

.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 44px; font-size: .86rem; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0; }

/* ---- 幅ごとの調整 ---- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "sub" "fig" "entries" "lead"; grid-template-rows: none; }
  .hero .drawing { margin: 8px 0 28px; }
  .hero .lead { margin: 28px 0 0; max-width: 36em; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.9; }
  .site-header .wrap { flex-direction: column; gap: 6px; }
  .nav ul { gap: 4px 20px; font-size: .92rem; }
  .hero { padding-top: 22px; }
  .hero .sub { margin-bottom: 16px; }
  .hero .drawing { margin: 0 0 22px; }
  .cap-short { display: inline; }
  .cap-long { display: none; }
  /* スマホでは、指摘の部分だけを縦に並べた別の図に切り替える */
  .dwg.wide { display: none; }
  .dwg.narrow { display: block; }
  .examples { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 14px; }
  .steps li { grid-template-columns: 2.4em minmax(0, 1fr); gap: 0 10px; }
}
