/* =========================================================================
   八ヶ岳動物クリニックみどり — ハンドメイド × フォレスト
   warm cream paper × forest-green ink / botanical herbarium tone
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --cp-primary: #166534;
  --cp-primary-deep: #0f4a26;
  --cp-accent: #65a30d;
  --cp-accent-ink: #3f6212;
  --cp-text: #052e16;
  --cp-muted: #5c5648;
  --cp-bg: #f4f0e5;
  --cp-surface: #fbf8f0;
  --cp-surface-2: #f0ead9;
  --cp-white: #ffffff;
  --cp-line: #dbd4c3;
  --cp-dash: #c9bfa8;

  --cp-radius: 12px;
  --sidebar-w: clamp(264px, 21vw, 320px);
  --cp-maxw: 1100px;
  --cp-pad: clamp(1rem, 3vw, 3rem);
  --cp-shadow: 0 2px 10px rgba(80, 60, 30, 0.06);
  --cp-shadow-hover: 0 14px 34px rgba(40, 60, 30, 0.14);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --font-display: "Cormorant Garamond", "Noto Serif JP", serif;
  --font-hand-jp: "Klee One", "Noto Serif JP", cursive;
  --font-hand-en: "Caveat", "Klee One", cursive;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.95;
  letter-spacing: 0.02em;
  color: var(--cp-text);
  background-color: var(--cp-bg);
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* paper fiber texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--cp-accent-ink); outline-offset: 3px; border-radius: 2px; }

/* ---------- 3. Skip link ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--cp-primary); color: #fff;
  padding: 0.6rem 1.2rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 4. Helpers ---------- */
.cp-container { max-width: var(--cp-maxw); margin-inline: auto; padding-inline: var(--cp-pad); }
.cp-section { padding-block: clamp(4rem, 8vw, 7.5rem); position: relative; }
.cp-section--tight { padding-block: clamp(3rem, 5vw, 4.5rem); }
.cp-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* eyebrow (handwriting) */
.cp-eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-hand-en);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cp-accent-ink);
  margin-bottom: 0.9rem;
}
.cp-eyebrow::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cp-accent); flex: none;
}
.cp-eyebrow--caps {
  font-family: var(--font-hand-en);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
}

/* section heading with hand-drawn underline */
.cp-head { margin-bottom: clamp(1.6rem, 3vw, 2.6rem); }
.cp-head__title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  position: relative; display: inline-block;
}
.cp-head__title .en {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  color: var(--cp-primary);
}
.cp-underline { display: block; width: 132px; height: 14px; margin-top: 0.35rem; color: var(--cp-accent); }
.cp-underline path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.cp-head__lead { margin-top: 1rem; max-width: 60ch; color: var(--cp-muted); }

/* ---------- 5. Buttons ---------- */
.cp-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 500; font-size: 1rem;
  padding: 0.85rem 1.6rem; border-radius: 4px;
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.4s var(--ease);
  white-space: nowrap;
}
.cp-btn svg { width: 18px; height: 18px; }
.cp-btn--primary { background: var(--cp-primary); color: #fff; box-shadow: var(--cp-shadow); }
.cp-btn--primary:hover { background: var(--cp-primary-deep); transform: translateY(-2px); box-shadow: var(--cp-shadow-hover); }
.cp-btn--outline { border: 1.5px solid var(--cp-primary); color: var(--cp-primary); }
.cp-btn--outline:hover { background: color-mix(in oklab, var(--cp-primary) 8%, transparent); transform: translateY(-2px); }
.cp-btn--ghost { color: var(--cp-text); border-bottom: 1.5px solid currentColor; border-radius: 0; padding: 0.2rem 0.1rem; }
.cp-btn--lg { padding: 1rem 2rem; font-size: 1.05rem; }
.cp-link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-hand-en); font-size: 1.1rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cp-primary);
}
.cp-link-arrow svg { transition: transform 0.4s var(--ease); }
.cp-link-arrow:hover svg { transform: translateX(5px); }

/* =========================================================================
   6. Layout shell — fixed sidebar (PC) + responsive header
   ========================================================================= */
.cp-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1.8rem, 2.5vw, 2.6rem) clamp(1.4rem, 2vw, 2.1rem);
  background: var(--cp-bg);
  border-right: 1px solid var(--cp-line);
  z-index: 40;
}
.cp-sidebar::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: repeating-linear-gradient(to bottom, var(--cp-dash) 0 6px, transparent 6px 13px);
  opacity: 0.6;
}
.cp-brand { display: flex; align-items: center; gap: 0.7rem; }
.cp-brand__logo { width: 50px; height: 50px; flex: none; }
.cp-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.cp-brand__name { font-size: 1.06rem; font-weight: 600; color: var(--cp-text); letter-spacing: 0.01em; }
.cp-brand__en {
  font-family: var(--font-hand-en); font-size: 0.95rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cp-accent-ink);
}
.cp-sidebar__nav { margin-top: clamp(2rem, 5vh, 3.4rem); }
.cp-nav__list { display: flex; flex-direction: column; gap: 0.2rem; }
.cp-nav__link {
  display: flex; align-items: baseline; gap: 0.7rem;
  font-size: 1.12rem; padding: 0.6rem 0; color: var(--cp-text);
  position: relative; transition: color 0.3s var(--ease), padding-left 0.35s var(--ease);
}
.cp-nav__link .idx {
  font-family: var(--font-hand-en); font-size: 0.85rem; color: var(--cp-accent-ink);
  letter-spacing: 0.05em;
}
.cp-nav__link::before {
  content: ""; position: absolute; left: -2px; bottom: 0.55rem; width: 0; height: 1px;
  background: var(--cp-primary); transition: width 0.4s var(--ease);
}
.cp-nav__link:hover, .cp-nav__link[aria-current="page"] { color: var(--cp-primary); padding-left: 4px; }
.cp-nav__link:hover::before, .cp-nav__link[aria-current="page"]::before { width: 24px; }
.cp-sidebar__foot { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 2rem; }
.cp-sidebar__cta { margin-bottom: 1.1rem; }
.cp-mini {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.86rem; color: var(--cp-muted); line-height: 1.5;
}
.cp-mini svg { width: 16px; height: 16px; color: var(--cp-primary); flex: none; }
.cp-mini--tel { font-size: 1.02rem; font-weight: 600; color: var(--cp-text); }
.cp-social { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.cp-social a {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--cp-line); border-radius: 8px 4px 8px 4px; color: var(--cp-primary);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.cp-social a:hover { background: var(--cp-primary); color: #fff; }
.cp-social svg { width: 18px; height: 18px; }

/* mobile/tablet header */
.cp-header { display: none; }
.cp-hamburger { display: none; }

/* main */
.cp-main { margin-left: var(--sidebar-w); min-height: 100vh; }

/* topbar inside main (eyebrow + CTA) */
.cp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.4rem, 2vw, 2rem) var(--cp-pad);
  border-bottom: 1px solid var(--cp-line);
}
.cp-topbar__eyebrow {
  font-family: var(--font-hand-en); text-transform: uppercase; letter-spacing: 0.24em;
  font-size: 0.86rem; color: var(--cp-accent-ink);
}
.cp-topbar__cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-bottom: 1.5px solid var(--cp-primary); padding-bottom: 3px; color: var(--cp-primary);
  font-size: 0.98rem; transition: gap 0.35s var(--ease);
}
.cp-topbar__cta:hover { gap: 0.85rem; }

/* =========================================================================
   7. Hero (vertical writing + image + news)
   ========================================================================= */
.cp-hero { padding: clamp(2rem, 4vw, 3.4rem) var(--cp-pad) clamp(2.5rem, 5vw, 4rem); }
.cp-hero__inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(210px, 270px);
  gap: clamp(1.4rem, 3vw, 2.8rem);
  align-items: stretch;
}
.cp-hero__heading {
  writing-mode: vertical-rl; text-orientation: upright;
  font-feature-settings: "palt" 1, "vert" 1;
  font-size: clamp(2.2rem, 4.6vw, 3.7rem); font-weight: 600;
  line-height: 1.5; letter-spacing: 0.08em; color: var(--cp-text);
  justify-self: end; padding-block: 0.5rem;
}
.cp-hero__heading .accent { color: var(--cp-primary); }
.cp-hero__visual { position: relative; border-radius: 16px 5px 16px 5px; overflow: hidden; box-shadow: var(--cp-shadow); }
.cp-hero__img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; object-position: center; }
.cp-hero__visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15, 36, 20, 0.28), transparent 42%);
  pointer-events: none;
}
.cp-hero__tag {
  position: absolute; left: 1.1rem; bottom: 1rem; z-index: 1;
  font-family: var(--font-hand-jp); color: #fff; font-size: 1.05rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.cp-hero__aside { display: flex; flex-direction: column; }
.cp-hero__lead { color: var(--cp-muted); font-size: 0.98rem; margin-bottom: 1.4rem; }
/* news list */
.cp-news__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
.cp-news__label { font-family: var(--font-hand-en); text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.86rem; color: var(--cp-accent-ink); }
.cp-news__list { display: flex; flex-direction: column; }
.cp-news__item { padding: 0.85rem 0; border-top: 1px solid var(--cp-line); }
.cp-news__item:last-child { border-bottom: 1px solid var(--cp-line); }
.cp-news__date { font-family: var(--font-hand-en); font-size: 0.95rem; letter-spacing: 0.06em; color: var(--cp-muted); }
.cp-news__title { font-size: 0.99rem; line-height: 1.55; margin-top: 0.15rem; }
.cp-news__badge {
  display: inline-block; font-size: 0.72rem; font-family: var(--font-hand-jp);
  background: color-mix(in oklab, var(--cp-accent) 16%, transparent);
  color: var(--cp-accent-ink); padding: 0.05rem 0.5rem; border-radius: 999px; margin-left: 0.4rem;
}

/* =========================================================================
   8. Features (strength 3-up)
   ========================================================================= */
.cp-features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.2rem, 2.5vw, 1.8rem); }
.cp-card {
  position: relative; background: var(--cp-surface); border: 1px solid var(--cp-line);
  padding: 1.7rem 1.6rem 1.9rem; box-shadow: var(--cp-shadow);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.cp-card::after {
  content: ""; position: absolute; inset: 9px; border: 1px dashed var(--cp-dash);
  border-radius: inherit; pointer-events: none; opacity: 0.85;
}
.cp-card:nth-child(3n+1) { border-radius: 16px 5px 14px 6px; }
.cp-card:nth-child(3n+2) { border-radius: 6px 14px 5px 16px; }
.cp-card:nth-child(3n+3) { border-radius: 14px 6px 16px 5px; }
.cp-features .cp-card { transform: rotate(-0.5deg); }
.cp-features .cp-card:nth-child(2) { transform: rotate(0.4deg); }
.cp-features .cp-card:hover { transform: rotate(0deg) translateY(-5px); box-shadow: var(--cp-shadow-hover); }
.cp-card__icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 1rem;
  border-radius: 14px 5px 14px 5px; background: color-mix(in oklab, var(--cp-primary) 10%, var(--cp-surface));
  color: var(--cp-primary);
}
.cp-card__icon svg { width: 26px; height: 26px; }
.cp-card__num { font-family: var(--font-hand-en); font-size: 1rem; color: var(--cp-accent-ink); letter-spacing: 0.08em; }
.cp-card__title { font-size: clamp(1.1rem, 1.8vw, 1.32rem); font-weight: 500; margin: 0.35rem 0 0.7rem; }
.cp-card__body { color: var(--cp-muted); font-size: 0.99rem; line-height: 1.85; }

/* =========================================================================
   9. Stats (number highlights)
   ========================================================================= */
.cp-stats { background: var(--cp-primary); color: #fff; position: relative; overflow: hidden; }
.cp-stats__inner { position: relative; z-index: 1; }
.cp-stats .cp-eyebrow { color: #c8e6a8; }
.cp-stats .cp-eyebrow::before { background: var(--cp-accent); }
.cp-stats__title { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.cp-stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); margin-top: 2.4rem; }
.cp-stat { border-top: 1px solid rgba(255, 255, 255, 0.28); padding-top: 1.1rem; }
.cp-stat__num { font-family: var(--font-display); font-style: italic; font-weight: 600; line-height: 1; color: #fff; display: flex; align-items: baseline; gap: 0.3rem; }
.cp-stat__num .figure { font-size: clamp(2.6rem, 5vw, 4rem); }
.cp-stat__num .unit { font-family: var(--font-hand-jp); font-size: 1.05rem; color: #d6eeb8; }
.cp-stat__label { margin-top: 0.5rem; color: #e7efdc; font-size: 0.95rem; }
.cp-stats__leaf { position: absolute; right: -40px; top: -30px; width: 280px; color: rgba(255, 255, 255, 0.06); z-index: 0; }

/* =========================================================================
   10. Services
   ========================================================================= */
.cp-services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.1rem, 2.2vw, 1.6rem); }
.cp-svc {
  position: relative; background: var(--cp-surface); border: 1px solid var(--cp-line);
  padding: 1.5rem 1.5rem 1.7rem; box-shadow: var(--cp-shadow);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.cp-svc:nth-child(2n+1) { border-radius: 14px 5px 12px 6px; }
.cp-svc:nth-child(2n) { border-radius: 6px 14px 5px 14px; }
.cp-svc:hover { transform: translateY(-4px); box-shadow: var(--cp-shadow-hover); }
.cp-svc__icon { width: 44px; height: 44px; color: var(--cp-primary); display: grid; place-items: center; margin-bottom: 0.8rem; }
.cp-svc__icon svg { width: 28px; height: 28px; }
.cp-svc__title { font-size: 1.18rem; font-weight: 500; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.cp-svc__title .en { font-family: var(--font-hand-en); font-size: 0.85rem; color: var(--cp-accent-ink); letter-spacing: 0.08em; }
.cp-svc__body { color: var(--cp-muted); font-size: 0.96rem; line-height: 1.8; }
.cp-svc__list { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.35rem; }
.cp-svc__list li { display: flex; gap: 0.5rem; font-size: 0.94rem; color: var(--cp-text); }
.cp-svc__list li::before { content: ""; width: 7px; height: 7px; margin-top: 0.6em; flex: none; border-radius: 2px; background: var(--cp-accent); transform: rotate(45deg); }

/* image + text split (message / agility / homecare) */
.cp-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.cp-split--rev .cp-split__media { order: 2; }
.cp-split__media { position: relative; }
.cp-split__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px 5px 18px 5px; box-shadow: var(--cp-shadow); }
.cp-split__media::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1;
  border: 1px dashed var(--cp-dash); border-radius: 18px 5px 18px 5px;
}
.cp-split__body p { color: var(--cp-muted); margin-bottom: 1.1rem; }
.cp-split__body p strong { color: var(--cp-text); font-weight: 600; }
.cp-quote-sign { margin-top: 1.6rem; display: flex; align-items: center; gap: 1rem; }
.cp-quote-sign__name { font-family: var(--font-hand-jp); font-size: 1.35rem; color: var(--cp-primary); }
.cp-quote-sign__role { font-size: 0.85rem; color: var(--cp-muted); }

/* =========================================================================
   11. Testimonials
   ========================================================================= */
.cp-testi { position: relative; overflow: hidden; }
.cp-testi__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 2.5vw, 2rem); }
.cp-testi__card {
  position: relative; background: var(--cp-surface); border: 1px solid var(--cp-line);
  padding: 2rem 1.9rem; border-radius: 16px 6px 16px 6px; box-shadow: var(--cp-shadow);
}
.cp-testi__card:nth-child(2n) { border-radius: 6px 16px 6px 16px; }
.cp-testi__mark { font-family: var(--font-display); font-style: italic; font-size: 3.4rem; line-height: 0.6; color: var(--cp-accent); opacity: 0.5; }
.cp-testi__text { font-size: 1.06rem; line-height: 1.9; margin: 0.4rem 0 1.1rem; }
.cp-testi__who { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--cp-muted); }
.cp-testi__who::before { content: ""; width: 22px; height: 1px; background: var(--cp-accent); }

/* =========================================================================
   12. News section (details toggles)
   ========================================================================= */
.cp-newsfull { display: flex; flex-direction: column; gap: 0.7rem; max-width: 820px; }
.cp-details {
  background: var(--cp-surface); border: 1px solid var(--cp-line);
  border-radius: 12px 4px 12px 4px; overflow: hidden;
}
.cp-details > summary {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem;
  cursor: pointer; list-style: none; font-weight: 500;
}
.cp-details > summary::-webkit-details-marker { display: none; }
.cp-details__date { font-family: var(--font-hand-en); font-size: 0.92rem; color: var(--cp-muted); letter-spacing: 0.06em; flex: none; }
.cp-details__t { flex: 1; }
.cp-details__chev { width: 20px; height: 20px; color: var(--cp-primary); transition: transform 0.4s var(--ease); flex: none; }
.cp-details[open] .cp-details__chev { transform: rotate(180deg); }
.cp-details__body { padding: 0 1.4rem 1.3rem; color: var(--cp-muted); border-top: 1px dashed var(--cp-dash); margin-top: -1px; padding-top: 1rem; }

/* =========================================================================
   13. Access / hours / map
   ========================================================================= */
.cp-access__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 3vw, 2.6rem); align-items: start; }
.cp-infocard {
  background: var(--cp-surface); border: 1px solid var(--cp-line);
  border-radius: 14px 5px 14px 5px; padding: 1.7rem 1.8rem; box-shadow: var(--cp-shadow);
}
.cp-infocard + .cp-infocard { margin-top: 1.2rem; }
.cp-infocard__h { display: flex; align-items: center; gap: 0.6rem; font-size: 1.15rem; font-weight: 500; margin-bottom: 1rem; }
.cp-infocard__h svg { width: 22px; height: 22px; color: var(--cp-primary); }
.cp-hours { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.cp-hours th, .cp-hours td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px dashed var(--cp-dash); }
.cp-hours th { font-weight: 600; color: var(--cp-text); white-space: nowrap; }
.cp-hours td { color: var(--cp-muted); }
.cp-hours .closed { color: #9a3412; font-weight: 600; }
.cp-deflist { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.97rem; }
.cp-deflist dt { color: var(--cp-primary); font-weight: 600; white-space: nowrap; }
.cp-deflist dd { color: var(--cp-muted); }
.cp-map { border-radius: 14px 5px 14px 5px; overflow: hidden; border: 1px solid var(--cp-line); box-shadow: var(--cp-shadow); }
.cp-map iframe { display: block; width: 100%; height: 420px; border: 0; }

/* =========================================================================
   14. CTA band
   ========================================================================= */
.cp-cta { position: relative; overflow: hidden; background: var(--cp-primary-deep); color: #fff; isolation: isolate; }
.cp-cta__bg { position: absolute; inset: 0; z-index: -1; }
.cp-cta__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.32; }
.cp-cta::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, rgba(15, 74, 38, 0.92), rgba(15, 74, 38, 0.62)); }
.cp-cta__inner { text-align: center; max-width: 720px; margin-inline: auto; }
.cp-cta .cp-eyebrow { color: #c8e6a8; justify-content: center; }
.cp-cta__title { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin-bottom: 0.9rem; }
.cp-cta__lead { color: #e7efdc; margin-bottom: 2rem; }
.cp-cta__btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cp-cta .cp-btn--primary { background: #fff; color: var(--cp-primary-deep); }
.cp-cta .cp-btn--primary:hover { background: #f0ead9; }
.cp-cta .cp-btn--outline { border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.cp-cta .cp-btn--outline:hover { background: rgba(255, 255, 255, 0.12); }
.cp-cta__tel { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.4rem; font-family: var(--font-display); font-style: italic; font-size: 1.6rem; color: #fff; }

/* =========================================================================
   15. Footer
   ========================================================================= */
.cp-footer { position: relative; isolation: isolate; background: #0c3a1f; color: #e7efdc; padding-block: clamp(3rem, 6vw, 5rem) 2rem; overflow: hidden; }
.cp-footer__bg { position: absolute; inset: 0; z-index: -2; }
.cp-footer__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.22; }
.cp-footer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12, 58, 31, 0.86), rgba(8, 40, 21, 0.96)); }
.cp-footer__particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cp-footer__inner { position: relative; z-index: 1; }
.cp-footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(1.6rem, 3vw, 3rem); }
.cp-footer__brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.cp-footer__brand img { width: 56px; height: 56px; }
.cp-footer__brand .nm { font-size: 1.2rem; font-weight: 600; color: #fff; }
.cp-footer__brand .en { font-family: var(--font-hand-en); letter-spacing: 0.12em; text-transform: uppercase; color: #b6d49a; font-size: 0.9rem; }
.cp-footer__desc { color: #c7d6bb; font-size: 0.94rem; max-width: 34ch; }
.cp-footer__col h3 { font-family: var(--font-hand-en); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.92rem; color: #b6d49a; margin-bottom: 0.9rem; font-weight: 600; }
.cp-footer__col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.cp-footer__col a, .cp-footer__col p { color: #d4e3c9; font-size: 0.95rem; transition: color 0.3s var(--ease); }
.cp-footer__col a:hover { color: #fff; }
.cp-footer__contact li { display: flex; gap: 0.55rem; align-items: flex-start; margin-bottom: 0.55rem; font-size: 0.95rem; color: #d4e3c9; }
.cp-footer__contact svg { width: 17px; height: 17px; color: #9fce7a; flex: none; margin-top: 0.35em; }
.cp-footer__sign { margin-top: 2.4rem; }
.cp-footer__sign svg { width: 200px; max-width: 60vw; color: #9fce7a; }
.cp-footer__bottom {
  margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.cp-footer__bottom small { color: #aebfa3; font-size: 0.86rem; }
.cp-footer__bottom nav { display: flex; gap: 1.2rem; font-size: 0.86rem; }

/* =========================================================================
   16. Contact form
   ========================================================================= */
.cp-form { background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: 16px 5px 16px 5px; padding: clamp(1.6rem, 3vw, 2.6rem); box-shadow: var(--cp-shadow); }
.cp-form__row { display: grid; gap: 1.2rem; }
.cp-form__row--2 { grid-template-columns: 1fr 1fr; }
.cp-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.2rem; }
.cp-field label { font-size: 0.94rem; font-weight: 600; color: var(--cp-text); display: flex; align-items: center; gap: 0.4rem; }
.cp-field .req { font-size: 0.72rem; background: var(--cp-primary); color: #fff; padding: 0.05rem 0.45rem; border-radius: 4px; font-weight: 500; }
.cp-field .opt { font-size: 0.72rem; background: var(--cp-surface-2); color: var(--cp-muted); padding: 0.05rem 0.45rem; border-radius: 4px; border: 1px solid var(--cp-line); }
.cp-field input, .cp-field textarea, .cp-field select {
  font-family: inherit; font-size: 1rem; color: var(--cp-text);
  background: var(--cp-white); border: 1px solid var(--cp-line); border-radius: 8px 3px 8px 3px;
  padding: 0.75rem 0.9rem; width: 100%; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cp-field textarea { resize: vertical; min-height: 140px; line-height: 1.8; }
.cp-field input:focus, .cp-field textarea:focus, .cp-field select:focus {
  outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--cp-primary) 16%, transparent);
}
.cp-check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.94rem; color: var(--cp-text); cursor: pointer; }
.cp-check input { width: 18px; height: 18px; margin-top: 0.25em; accent-color: var(--cp-primary); flex: none; }
.cp-check a { color: var(--cp-primary); text-decoration: underline; }
#contact-otp-block { background: color-mix(in oklab, var(--cp-accent) 8%, var(--cp-surface)); border: 1px dashed var(--cp-dash); border-radius: 10px; padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
#contact-otp-block p { font-size: 0.85rem; color: var(--cp-muted); margin-top: 0.5rem; }
.cf-turnstile { margin: 0.4rem 0 1.2rem; }
.cp-form__submit { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#contact-status { font-size: 0.95rem; }
.cp-form__note { font-size: 0.86rem; color: var(--cp-muted); margin-top: 1rem; }

/* =========================================================================
   17. Subpage hero (generator injects --aihp-subpage-hero-image)
   ========================================================================= */
.cp-page-hero {
  position: relative; padding: clamp(4rem, 11vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
  background: var(--cp-primary); color: #fff; overflow: hidden;
}
.cp-page-hero.aihp-subpage-hero--with-image {
  background-image:
    linear-gradient(115deg, rgba(8, 40, 21, 0.9) 12%, rgba(15, 74, 38, 0.6) 60%, rgba(15, 74, 38, 0.35) 100%),
    var(--aihp-subpage-hero-image, none);
  background-size: cover; background-position: center;
}
.cp-page-hero__inner { position: relative; z-index: 1; }
.cp-page-hero .cp-eyebrow { color: #c8e6a8; }
.cp-page-hero .cp-eyebrow::before { background: var(--cp-accent); }
.cp-page-hero__title { font-size: clamp(2rem, 4vw, 3rem); color: #fff; margin-bottom: 0.8rem; }
.cp-page-hero__lead { color: #e7efdc; max-width: 56ch; }
.cp-crumbs { margin-top: 1.6rem; font-size: 0.85rem; color: #c7d6bb; display: flex; gap: 0.5rem; }
.cp-crumbs a:hover { color: #fff; }

/* timeline (about 沿革) */
.cp-timeline { position: relative; max-width: 760px; margin-left: 0.5rem; }
.cp-timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(to bottom, var(--cp-dash) 0 6px, transparent 6px 12px); }
.cp-tl { position: relative; padding: 0 0 1.8rem 2.4rem; }
.cp-tl:last-child { padding-bottom: 0; }
.cp-tl::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--cp-surface); border: 3px solid var(--cp-primary); box-shadow: 0 0 0 4px var(--cp-bg); }
.cp-tl__year { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.6rem; color: var(--cp-primary); line-height: 1; }
.cp-tl__title { font-size: 1.12rem; font-weight: 500; margin: 0.3rem 0 0.4rem; }
.cp-tl__body { color: var(--cp-muted); font-size: 0.98rem; }

/* equipment / feature tiles */
.cp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.5rem); }
.cp-tile { background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: 14px 5px 14px 5px; padding: 1.4rem 1.4rem 1.5rem; box-shadow: var(--cp-shadow); }
.cp-tile:nth-child(2n) { border-radius: 5px 14px 5px 14px; }
.cp-tile__icon { width: 42px; height: 42px; color: var(--cp-primary); margin-bottom: 0.7rem; display: grid; place-items: center; }
.cp-tile__icon svg { width: 100%; height: 100%; }
.cp-tile__title { font-size: 1.08rem; font-weight: 500; margin-bottom: 0.4rem; }
.cp-tile__body { color: var(--cp-muted); font-size: 0.95rem; line-height: 1.8; }
@media (max-width: 860px) { .cp-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .cp-tiles { grid-template-columns: 1fr; } }

/* alt section bg */
.cp-section--cream { background: var(--cp-surface-2); }
.cp-section--bg { position: relative; isolation: isolate; }
.cp-section__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.16; z-index: -1; }
.cp-section--bg::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--cp-bg), color-mix(in oklab, var(--cp-bg) 80%, transparent)); }

/* =========================================================================
   18. Animations
   ========================================================================= */
.fade-in { opacity: 1; transform: none; transition: transform 700ms var(--ease); will-change: transform; }
html.js-enabled .fade-in:not(.is-in) { transform: translateY(10px) rotate(-0.4deg); }
.fade-in.d1 { transition-delay: 0.08s; }
.fade-in.d2 { transition-delay: 0.16s; }
.fade-in.d3 { transition-delay: 0.24s; }

.back-to-top {
  position: fixed; right: clamp(1rem, 2vw, 2rem); bottom: clamp(1rem, 2vw, 2rem); z-index: 50;
  width: 48px; height: 48px; border-radius: 12px 4px 12px 4px;
  background: var(--cp-accent); color: #fff; display: grid; place-items: center;
  box-shadow: var(--cp-shadow-hover); opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background-color 0.3s var(--ease);
}
.back-to-top svg { width: 22px; height: 22px; }
.back-to-top.is-show { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--cp-accent-ink); }
.back-to-top[hidden] { display: grid; }

/* hand-drawn signature reveal */
.cp-sign-path { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
html.js-enabled .cp-sign-reveal.is-in .cp-sign-path { transition: stroke-dashoffset 1600ms var(--ease); stroke-dashoffset: 0; }

/* slowly rotating decorative leaf */
.cp-spin-leaf { animation: cp-spin 60s linear infinite; transform-origin: center; }
@keyframes cp-spin { to { transform: rotate(360deg); } }

/* warm sepia lazy-in for images */
.cp-img-warm { transition: filter 900ms var(--ease), opacity 900ms var(--ease); }
html.js-enabled .cp-img-warm:not(.is-loaded) { filter: sepia(0.35) saturate(0.85); }

/* =========================================================================
   19. Responsive
   ========================================================================= */
@media (max-width: 1023px) {
  .cp-sidebar { display: none; }
  .cp-main { margin-left: 0; }
  .cp-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: sticky; top: 0; z-index: 40;
    padding: 0.7rem var(--cp-pad);
    background: color-mix(in oklab, var(--cp-bg) 92%, transparent);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--cp-line);
  }
  .cp-header .cp-brand__logo { width: 40px; height: 40px; }
  .cp-header .cp-brand__name { font-size: 0.95rem; }
  .cp-header .cp-brand__en { display: none; }
  .cp-header__nav { display: flex; align-items: center; gap: 1.4rem; }
  .cp-header__nav a { font-size: 1rem; color: var(--cp-text); }
  .cp-header__nav a:hover, .cp-header__nav a[aria-current="page"] { color: var(--cp-primary); }
  .cp-header__cta { display: inline-flex; }
  .cp-hero__inner { grid-template-columns: max-content minmax(0, 1fr); }
  .cp-hero__aside { grid-column: 1 / -1; margin-top: 0.5rem; }
  .cp-hero__aside { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .cp-features__grid, .cp-services__grid { grid-template-columns: 1fr 1fr; }
  .cp-stats__grid { grid-template-columns: 1fr 1fr; }
  .cp-split { grid-template-columns: 1fr; }
  .cp-split--rev .cp-split__media { order: 0; }
  .cp-testi__grid { grid-template-columns: 1fr; }
  .cp-access__grid { grid-template-columns: 1fr; }
  .cp-footer__top { grid-template-columns: 1fr 1fr; }
  .cp-footer__brandcol { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .cp-header__nav { display: none; }
  .cp-header__cta { display: none; }
  .cp-hamburger {
    display: grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid var(--cp-line); border-radius: 10px 4px 10px 4px; color: var(--cp-primary);
  }
  .cp-hamburger svg { width: 24px; height: 24px; }
  .cp-header .cp-brand__name { font-size: 0.8rem; }
  .cp-header .cp-brand__logo { width: 38px; height: 38px; }
  .cp-topbar { display: none; }
  .cp-hero { padding-top: 1.2rem; }
  .cp-hero__inner { grid-template-columns: 1fr; gap: 1.4rem; }
  .cp-hero__heading {
    writing-mode: horizontal-tb; text-orientation: mixed; justify-self: start;
    font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.45; letter-spacing: 0.02em;
  }
  .cp-hero__visual { min-height: 0; }
  .cp-hero__img { min-height: 240px; aspect-ratio: 4 / 3; }
  .cp-features__grid, .cp-services__grid, .cp-stats__grid { grid-template-columns: 1fr; }
  .cp-features .cp-card, .cp-features .cp-card:nth-child(2) { transform: none; }
  .cp-footer__top { grid-template-columns: 1fr; }
  .cp-form__row--2 { grid-template-columns: 1fr; }
  .cp-cta__tel { font-size: 1.35rem; }
  .cp-map iframe { height: 280px; }
  .cp-section { padding-block: 4rem 0; }
  .cp-section { padding-block: clamp(3rem, 12vw, 4rem); }
  .cp-container { padding-inline: 1.25rem; }
  .cp-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* =========================================================================
   20. Drawer (mobile menu, body-level)
   ========================================================================= */
.cp-drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.cp-drawer.is-open { visibility: visible; }
.cp-drawer__overlay {
  position: absolute; inset: 0; background: rgba(8, 30, 16, 0.5);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.cp-drawer.is-open .cp-drawer__overlay { opacity: 1; }
.cp-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 360px);
  background: var(--cp-bg); border-left: 1px solid var(--cp-line);
  padding: 1.4rem 1.5rem; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.45s var(--ease);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18); overflow-y: auto;
}
.cp-drawer.is-open .cp-drawer__panel { transform: translateX(0); }
.cp-drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; }
.cp-drawer__close { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--cp-line); border-radius: 10px 4px 10px 4px; color: var(--cp-primary); }
.cp-drawer__close svg { width: 22px; height: 22px; }
.cp-drawer__nav { display: flex; flex-direction: column; gap: 0.2rem; }
.cp-drawer__nav a { display: flex; align-items: baseline; gap: 0.7rem; font-size: 1.25rem; padding: 0.75rem 0; border-bottom: 1px dashed var(--cp-dash); color: var(--cp-text); }
.cp-drawer__nav a .idx { font-family: var(--font-hand-en); font-size: 0.85rem; color: var(--cp-accent-ink); }
.cp-drawer__nav a[aria-current="page"] { color: var(--cp-primary); }
.cp-drawer__foot { margin-top: auto; padding-top: 1.6rem; }
.cp-drawer__foot .cp-btn { width: 100%; justify-content: center; }
.cp-drawer__tel { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: 1.1rem; font-weight: 600; color: var(--cp-text); justify-content: center; }
.cp-drawer__tel svg { width: 18px; height: 18px; color: var(--cp-primary); }

/* =========================================================================
   21. Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  html.js-enabled .fade-in:not(.is-in) { transform: none; }
  .cp-spin-leaf { animation: none; }
}

/* ai-hp enforced subpage hero backgrounds */
.aihp-subpage-hero--with-image {
  position: relative;
  background-image:
    linear-gradient(135deg, rgba(16, 72, 37, 0.9), rgba(16, 72, 37, 0.72)),
    var(--aihp-subpage-hero-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  overflow: hidden;
  isolation: isolate;
}
.aihp-subpage-hero--with-image > * {
  position: relative;
  z-index: 1;
}

