/* 027 つむぎ司法書士事務所 ― 色はここだけ触れば差し替わる */
:root {
  --c-bg: #f7f1e8;
  --c-paper: #fffaf2;
  --c-main: #4a3628;
  --c-accent: #c08a52;
  --c-accent-text: #8a5a2b;
  --c-marker: #f6d68a;
  --c-text: #374151;
  --c-sub: #4b5563;
  --c-line: #e3d5bf;
  --tab1: #efe4d2;
  --tab2: #e8d9c2;
  --tab3: #e0cdb0;
  --tab4: #d8c09c;
  --font: "Zen Maru Gothic", sans-serif;
  --font-hand: "Klee One", "Zen Maru Gothic", cursive;
  --font-en: "Lora", serif;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); font-weight: 500; font-size: 16px; line-height: 1.95; color: var(--c-text); background: var(--c-bg); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dd, li { word-break: auto-phrase; }

.en { font-family: var(--font-en); font-style: italic; font-size: 17px; color: var(--c-accent-text); margin-bottom: 6px; }
.en--light { color: #f3e3c8; }
.h2 { font-weight: 700; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.5; color: var(--c-main); }
.sec-head { max-width: 1120px; margin: 0 auto 40px; padding: 0 20px; }
.sec-head__lead { margin-top: 12px; color: var(--c-sub); max-width: 36em; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; flex: none; transition: background-color .3s, color .3s, transform .3s; }
.btn--main { background: var(--c-main); color: #fff; }
.btn--main:hover, .btn--main:focus-visible { background: var(--c-accent-text); }
.btn--line { border: 2px solid var(--c-main); color: var(--c-main); }
.btn--line:hover, .btn--line:focus-visible { background: var(--c-main); color: #fff; }
.btn--paper { background: var(--c-paper); color: var(--c-main); }
.btn--paper:hover, .btn--paper:focus-visible { background: var(--c-marker); }

/* ===== ヘッダー ===== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: rgba(247, 241, 232, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); }
.header__inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); padding: 0 20px; max-width: 1280px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; min-height: 48px; text-decoration: none; color: var(--c-main); white-space: nowrap; flex: none; }
.logo__owl { width: 40px; height: 40px; }
.logo__text { display: flex; flex-direction: column; font-weight: 700; font-size: 22px; line-height: 1.1; }
.logo__text small { font-size: 15px; font-weight: 500; color: var(--c-sub); }
.gnav { display: none; }
.header__btn { margin-left: auto; min-height: 44px; padding: 0 16px; font-size: 15px; }
.spmenu { flex: none; }
.spmenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--c-main); }
.spmenu summary::-webkit-details-marker { display: none; }
.spmenu__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spmenu__bar, .spmenu__bar::before, .spmenu__bar::after { display: block; width: 22px; height: 3px; border-radius: 2px; background: currentColor; position: relative; }
.spmenu__bar::before, .spmenu__bar::after { content: ""; position: absolute; left: 0; }
.spmenu__bar::before { top: -7px; } .spmenu__bar::after { top: 7px; }
.spmenu[open] .spmenu__bar { background: transparent; }
.spmenu[open] .spmenu__bar::before { top: 0; transform: rotate(45deg); }
.spmenu[open] .spmenu__bar::after { top: 0; transform: rotate(-45deg); }
.spmenu__nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--c-paper); padding: 8px 20px 24px; display: flex; flex-direction: column; border-bottom: 4px solid var(--c-accent); box-shadow: 0 20px 40px rgba(74, 54, 40, .15); }
.spmenu__nav a { display: flex; align-items: center; min-height: 56px; color: var(--c-main); text-decoration: none; font-weight: 700; font-size: 17px; border-bottom: 1px dashed var(--c-line); }
@media (min-width: 1080px) {
  :root { --header-h: 84px; }
  .header__inner { padding: 0 40px; gap: 28px; }
  .gnav { display: flex; gap: 24px; margin-left: auto; }
  .gnav a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 700; color: var(--c-main); }
  .gnav a:hover { color: var(--c-accent-text); }
  .header__btn { margin-left: 0; padding: 0 24px; }
  .spmenu { display: none; }
}
@media (max-width: 380px) { .header__btn { padding: 0 12px; } .logo__owl { width: 34px; height: 34px; } }

/* ===== 演出①：読み込み（A06）＝ JS が hidden を外したときだけ出る ===== */
.loader { position: fixed; inset: 0; z-index: 100; background: var(--c-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.loader[hidden] { display: none; }
.loader__owl { width: 120px; height: 120px; }
.loader__owl .owl__eyes { transform-origin: 60px 50px; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%, 40%, 52%, 100% { transform: none; } 46% { transform: scaleY(.1); } }
.loader__num { font-family: var(--font-en); font-style: italic; font-size: 44px; line-height: 1; color: var(--c-main); font-variant-numeric: tabular-nums; }
.loader__text { font-family: var(--font-hand); font-size: 17px; color: var(--c-sub); }

/* ===== メインビジュアル ===== */
.hero { padding: calc(var(--header-h) + 36px) 20px 64px; display: grid; gap: 36px; max-width: 1280px; margin: 0 auto; }
.hero__title { font-weight: 700; font-size: clamp(30px, 5vw, 54px); line-height: 1.45; color: var(--c-main); letter-spacing: .02em; }
.hero__lead { margin-top: 20px; font-size: clamp(16px, 1.5vw, 18px); }
.hero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__photo { position: relative; }
.hero__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 200px 200px 24px 24px; background: var(--tab2); }
.hero__owl { position: absolute; width: 88px; height: 88px; left: -6px; bottom: -28px; filter: drop-shadow(0 8px 10px rgba(74, 54, 40, .2)); }
.hero__note { position: absolute; right: 12px; bottom: -22px; background: var(--c-paper); border: 2px solid var(--c-accent); border-radius: 999px; padding: 6px 18px; font-family: var(--font-hand); font-size: 16px; color: var(--c-main); }
@media (min-width: 1080px) {
  .hero { grid-template-columns: 5fr 6fr; align-items: center; gap: 56px; padding: calc(var(--header-h) + 64px) 40px 120px; min-height: 92vh; }
  .hero__photo img { aspect-ratio: 5 / 6; }
  .hero__owl { width: 120px; height: 120px; left: -40px; bottom: -36px; }
}

/* ===== 演出②：手紙（E06） ===== */
.letter-sec { padding: 64px 20px 96px; }
.letter { position: relative; max-width: 640px; margin: 0 auto; background: var(--c-paper); padding: 40px 22px 44px; border-radius: 6px; box-shadow: 0 2px 0 var(--c-line), 0 24px 50px rgba(74, 54, 40, .1); }
.letter::before { content: ""; position: absolute; top: -14px; left: 50%; width: 120px; height: 28px; transform: translateX(-50%) rotate(-2deg); background: rgba(192, 138, 82, .35); }
.letter .h2 { margin-bottom: 18px; }
.letter__body { --line: 2.3em; font-family: var(--font-hand); font-size: 17px; line-height: var(--line); color: var(--c-main);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--c-line) calc(var(--line) - 1px), var(--c-line) var(--line)); }
.ln { width: fit-content; max-width: 100%; }
.ln--gap { margin-top: var(--line); }
.mk { color: inherit; background: linear-gradient(transparent 58%, var(--c-marker) 58%, var(--c-marker) 92%, transparent 92%) no-repeat 0 0 / 100% 100%; padding: 0 2px; }
.letter__sign { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 24px; font-family: var(--font-hand); font-size: 16px; color: var(--c-sub); text-align: right; }
.letter__sign svg { width: 36px; height: 36px; flex: none; }
.pen { position: absolute; width: 34px; height: 34px; left: 0; top: 0; display: none; pointer-events: none; }
@media (min-width: 768px) { .letter { padding: 56px 64px 56px; } .letter__body { font-size: 20px; } }
/* 動く版：JS が is-motion を付けたときだけ、ペンを見せる（行の隠し方は JS が付ける） */
.is-motion .pen { display: block; }

/* ===== こんなとき ===== */
.cases { padding: 32px 0 96px; }
.cases__list { display: grid; gap: 28px; padding: 0 20px; max-width: 1120px; margin: 0 auto; }
.case { background: var(--c-paper); border-radius: 20px; overflow: hidden; }
.case img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--tab2); }
.case h3 { font-weight: 700; font-size: 19px; line-height: 1.6; color: var(--c-main); padding: 20px 22px 6px; }
.case p { padding: 0 22px 24px; }
@media (min-width: 768px) { .cases__list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .cases { padding-bottom: 140px; } .cases__list { grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 0 40px; } .case h3 { font-size: 18px; } }

/* ===== 演出③：付箋タブの積み重なり（B06・CSSだけ） ===== */
.steps-sec { padding: 96px 0 120px; background: linear-gradient(var(--c-bg), #f1e8da); }
.steps { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.step { position: sticky; top: calc(var(--header-h) + 16px); margin-bottom: 18vh; }
.step:last-child { margin-bottom: 0; }
.step__tab { display: flex; align-items: center; gap: 6px; width: 23%; min-width: 72px; margin-left: calc(var(--i) * 25.6%); height: 48px; padding: 0 12px; border-radius: 14px 14px 0 0; font-weight: 700; font-size: 16px; color: var(--c-main); background: var(--tab); border: 2px solid var(--c-accent); border-bottom: 0; position: relative; z-index: 1; margin-bottom: -2px; }
.step__tab span { font-family: var(--font-en); font-style: italic; font-size: 22px; line-height: 1; }
.step__body { position: relative; min-height: 400px; background: var(--tab); border: 2px solid var(--c-accent); border-radius: 0 18px 18px 18px; padding: 28px 22px 32px; box-shadow: 0 -10px 24px rgba(74, 54, 40, .08); }
.step:nth-child(2) .step__body, .step:nth-child(3) .step__body, .step:nth-child(4) .step__body { border-radius: 18px; }
.step:nth-child(1) { --tab: var(--tab1); }
.step:nth-child(2) { --tab: var(--tab2); }
.step:nth-child(3) { --tab: var(--tab3); }
.step:nth-child(4) { --tab: var(--tab4); }
.step__when { display: inline-block; font-size: 15px; font-weight: 700; color: var(--c-main); border-bottom: 2px solid var(--c-accent); margin-bottom: 10px; }
.step h3 { font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.55; color: var(--c-main); margin-bottom: 14px; }
.step__body p { color: var(--c-text); }
.step__hand { margin-top: 18px; font-family: var(--font-hand); font-size: 17px; }
.step__hand::before { content: "✎ "; }
@media (min-width: 768px) { .step__body { padding: 44px 48px; min-height: 360px; } .step__tab { font-size: 17px; padding: 0 18px; } }

/* ===== 料金 ===== */
.fee { padding: 96px 0; }
.fee__list { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.fee__list div { display: flex; justify-content: space-between; gap: 16px; padding: 18px 4px; border-bottom: 1px dashed var(--c-accent); }
.fee__list dt { color: var(--c-main); font-weight: 700; }
.fee__list dd { font-family: var(--font-en); font-style: italic; font-size: 18px; color: var(--c-main); white-space: nowrap; }
.fee__note { max-width: 760px; margin: 20px auto 0; padding: 0 20px; font-size: 15px; color: var(--c-sub); }

/* ===== 事務所 ===== */
.office { display: grid; gap: 32px; max-width: 1120px; margin: 0 auto; padding: 32px 20px 112px; }
.office__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 24px; background: var(--tab2); }
.office__text .h2 { margin-bottom: 16px; }
.office__hand { margin: 20px 0; font-family: var(--font-hand); font-size: 18px; color: var(--c-main); background: linear-gradient(transparent 62%, var(--c-marker) 62%); display: inline; }
.office__info { margin-top: 28px; border-top: 1px solid var(--c-line); }
.office__info div { display: grid; grid-template-columns: 5em 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--c-line); }
.office__info dt { font-weight: 700; color: var(--c-main); }
@media (min-width: 900px) { .office { grid-template-columns: 4fr 6fr; align-items: center; gap: 72px; padding: 64px 40px 140px; } }

/* ===== ご相談 ===== */
.contact { background: var(--c-main); color: #f3ece2; padding: 96px 20px; text-align: center; }
.contact__inner { max-width: 640px; margin: 0 auto; }
.contact__owl { width: 96px; height: 96px; margin: 0 auto 12px; display: block; }
.contact__title { font-weight: 700; font-size: clamp(26px, 4vw, 40px); line-height: 1.5; color: #fff; margin-bottom: 16px; }
.contact__tel { margin: 28px 0 20px; font-size: 18px; }
.contact__tel a { font-family: var(--font-en); font-style: italic; font-size: clamp(30px, 5vw, 44px); color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }

/* ===== フッター ===== */
.footer { padding: 56px 20px 28px; font-size: 15px; }
.footer__inner { max-width: 1120px; margin: 0 auto; display: grid; gap: 16px; }
.footer__logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; color: var(--c-main); }
.footer__logo svg { width: 40px; height: 40px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer__nav a { display: flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--c-main); font-weight: 700; }
.footer__fiction { text-align: center; margin-top: 32px; color: var(--c-sub); }
@media (min-width: 900px) { .footer__inner { grid-template-columns: auto 1fr; align-items: center; } .footer__nav { justify-content: flex-end; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
