/* 三次元工房（あたたかい手づくり） */

:root {
  --paper: #F8F2E6;      /* 生成り */
  --paper-alt: #F0E6D3;  /* 一段濃い生成り（交互の帯） */
  --card: #FFFCF6;
  --ink: #3B2A1E;        /* 焦げ茶（本文） */
  --ink-soft: #6A5444;   /* 補足 */
  --line: #DCCDB4;
  --orange: #F08A24;     /* アクセント（面に使う。上の文字は焦げ茶） */
  --orange-text: #A84B06;/* 生成りの上に載せるオレンジの文字 */
  --band: #4A3426;
  --tape: rgba(240, 200, 130, .75);
  --radius: 18px;
  --font-round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* 紙のざらつき（うっすら） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
body:has(.works-modal[open]) { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, .stats__label, .contact p, .works-card__title, .section__lead, .page-head__lead { word-break: auto-phrase; }
h1, h2, h3 { font-family: var(--font-round); line-height: 1.4; margin: 0; letter-spacing: .04em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
.wrap--narrow { width: min(100% - 32px, 760px); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 10px 26px;
  border-radius: 999px; border: 2px solid var(--ink);
  font-family: var(--font-round); font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn--primary { background: var(--orange); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn--primary:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn--primary:active { transform: translateY(4px); box-shadow: none; }
.btn--ghost { background: var(--card); color: var(--ink); }
.btn--ghost:hover { background: var(--paper-alt); }
.btn--light { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 0 4px 0 rgba(59,42,30,.35); }
.btn--light:hover { transform: translateY(2px); box-shadow: 0 2px 0 rgba(59,42,30,.35); }
.btn--sm { min-height: 44px; padding: 6px 18px; font-size: .95rem; box-shadow: 0 3px 0 var(--ink); }
.btn--lg { min-height: 56px; padding: 12px 44px; font-size: 1.15rem; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--orange-text); font-weight: 700; text-underline-offset: 4px; }

/* 1. ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 242, 230, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); width: min(100% - 32px, 1200px); margin-inline: auto; }
.logo { min-height: 44px; justify-content: center; font-family: var(--font-round); font-weight: 900; font-size: 1.5rem; text-decoration: none; letter-spacing: .02em; line-height: 1.1; display: flex; flex-direction: column; }
.logo small { font-size: .65rem; font-weight: 500; color: var(--ink-soft); letter-spacing: .1em; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:hover { background: var(--paper-alt); }
@media (max-width: 860px) {
  .site-header__bar { flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding-top: 8px; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; font-size: .85rem; padding: 0 6px; letter-spacing: 0; }
  :root { --header-h: 108px; }
}

/* 2. ファーストビュー */
.hero { padding: 40px 0 8px; overflow: hidden; }
.hero__inner { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 48px; } .hero__inner { grid-template-columns: 1fr 1.05fr; gap: 56px; } }
.hero__place {
  display: inline-block; margin-bottom: 20px; padding: 4px 14px;
  border: 1.5px dashed var(--ink-soft); border-radius: 999px;
  font-size: .9rem; color: var(--ink-soft);
}
.hero__title { font-size: clamp(1.75rem, 1.1rem + 3.2vw, 3.1rem); font-weight: 900; line-height: 1.45; }
.hero__title span { display: inline-block; }
.hero__lead { margin-top: 20px; max-width: 34em; font-size: 1.05rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.hero__collage { position: relative; padding: 8px 12% 40px 0; }
.polaroid { margin: 0; background: var(--card); padding: 10px 10px 8px; border-radius: 6px; box-shadow: 0 10px 28px -10px rgba(59,42,30,.5); }
.polaroid figcaption { font-family: var(--font-round); font-size: .8rem; text-align: center; padding-top: 6px; font-weight: 700; color: var(--ink); }
.polaroid img { border-radius: 3px; }
.polaroid--hero { position: relative; transform: rotate(-1.5deg); }
.polaroid--hero::before { /* マスキングテープ */
  content: ""; position: absolute; z-index: 2; top: -12px; left: 18%;
  width: 110px; height: 30px; background: var(--tape); transform: rotate(-6deg);
}
.polaroid--sub { position: absolute; right: 0; bottom: 0; width: 38%; transform: rotate(4deg); }
.polaroid--sub img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* セクション共通 */
.section { padding: 72px 0; }
.section--alt { background: var(--paper-alt); }
@media (min-width: 900px) { .section { padding: 104px 0; } }
.section__title {
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.2rem); font-weight: 900;
  display: flex; align-items: center; gap: 12px;
}
.section__title::before { /* 手描き風のドット（工房の目印） */
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px rgba(240,138,36,.25);
}
.section__lead { margin-top: 14px; max-width: 40em; color: var(--ink-soft); }
.section__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 40px; }

/* 3. 作例ピックアップ（ポラロイド風・少し傾ける） */
.pickup.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; margin-top: 36px; }
@media (min-width: 760px) { .pickup.works-grid { grid-template-columns: repeat(3, 1fr); gap: 40px 32px; } }
.pickup .works-card:nth-child(3n+1) { transform: rotate(-1.6deg); }
.pickup .works-card:nth-child(3n+2) { transform: rotate(1.2deg); }
.pickup .works-card:nth-child(3n) { transform: rotate(-.6deg); }
.pickup .works-card__btn { background: var(--card); padding: 8px 8px 4px; border-radius: 8px; box-shadow: 0 10px 24px -14px rgba(59,42,30,.55); }
.pickup .works-card__btn:hover { transform: translateY(-4px) rotate(0); }
.pickup .works-card__title { text-align: center; }

/* 作例カード（共通） */
.works-card__btn {
  display: flex; flex-direction: column; justify-content: flex-start; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: transform .2s ease;
}
.works-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--line); }
.works-card__title { display: block; padding: 8px 4px; font-family: var(--font-round); font-weight: 700; font-size: .95rem; line-height: 1.5; }

/* 4. 数字で見る実績 */
.stats { background: var(--band); color: var(--paper); padding: 36px 0; }
.stats__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.stats__list li + li { border-left: 1.5px dashed rgba(248,242,230,.35); }
.stats__num { display: block; font-family: var(--font-round); font-weight: 900; font-size: clamp(2rem, 1.2rem + 3.5vw, 3.4rem); line-height: 1.1; color: #FFC27D; }
.stats__num small { font-size: .4em; margin-left: .15em; color: var(--paper); }
.stats__label { display: block; margin-top: 6px; font-size: clamp(.78rem, .7rem + .4vw, .95rem); line-height: 1.5; }

/* 5. できること */
.services { display: grid; gap: 18px; margin-top: 36px; }
@media (min-width: 640px) { .services { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.service { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.service__icon { width: 44px; height: 44px; fill: none; stroke: var(--orange-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { margin-top: 12px; font-size: 1.2rem; }
.service p { margin-top: 8px; }

/* 6. つくり手の紹介（大きめ・吹き出し） */
.about__inner { display: grid; gap: 32px; align-items: center; margin-top: 36px; }
@media (min-width: 820px) { .about__inner { grid-template-columns: 280px 1fr; gap: 64px; } }
.about__who { text-align: center; }
.about__avatar { width: min(220px, 60vw); aspect-ratio: 1; margin-inline: auto; border-radius: 50%; border: 6px solid var(--card); box-shadow: 0 0 0 3px var(--orange), 0 16px 32px -16px rgba(59,42,30,.5); display: block; height: auto; object-fit: cover; background: var(--paper-alt); }
.about__name { margin-top: 18px; font-family: var(--font-round); font-weight: 900; font-size: 1.6rem; line-height: 1.3; }
.about__job { color: var(--ink-soft); }
.about__area { margin-top: 4px; font-size: .9rem; color: var(--ink-soft); }
.bubble {
  position: relative; margin-top: 24px; padding: 28px 28px 30px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 28px;
  font-size: 1.05rem;
}
.bubble p + p { margin-top: 14px; }
.bubble::before { /* しっぽ（スマホは上向き、PC は左向き） */
  content: ""; position: absolute; left: 50%; top: -14px; width: 24px; height: 24px; margin-left: -12px;
  background: var(--card); border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg);
}
@media (min-width: 820px) { .bubble::before { left: -14px; top: 48px; margin-left: 0; transform: rotate(-45deg); } }
.bubble__quote { font-family: var(--font-round); font-weight: 700; font-size: 1.2rem; color: var(--orange-text); }

/* 7. 料金の目安（手書きの値札のような一覧） */
.pricecard { margin-top: 32px; background: var(--card); border-radius: var(--radius); border: 1.5px solid var(--line); padding: 12px 24px 22px; }
.pricelist div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 0; border-bottom: 1.5px dashed var(--line); }
.pricelist dt { font-weight: 500; flex: 1 1 0; min-width: 9em; }
.pricelist dd { margin: 0; font-family: var(--font-round); font-weight: 900; font-size: 1.2rem; text-align: right; margin-left: auto; }
.pricelist dd small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
.pricecard__note { margin-top: 16px; font-size: .9rem; color: var(--ink-soft); }

/* 8. ご依頼の流れ（点線でつなぐ手順） */
.flow { display: grid; gap: 14px; margin-top: 36px; counter-reset: step; }
.flow li {
  position: relative; counter-increment: step;
  padding: 20px 22px 20px 78px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.flow li::before {
  content: counter(step); position: absolute; left: 20px; top: 18px;
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper-alt); border: 2px solid var(--ink); font-family: var(--font-round); font-weight: 900; font-size: 1.15rem;
}
.flow li + li::after { /* 前の手順からの点線 */
  content: ""; position: absolute; left: 40px; top: -16px; height: 18px; border-left: 2px dashed var(--ink-soft);
}
.flow h3 { font-size: 1.1rem; }
.flow p { margin-top: 4px; }
.flow .flow__key { border: 2px solid var(--orange); background: #FFF3E3; }
.flow .flow__key::before { background: var(--orange); }
@media (min-width: 1000px) {
  .flow { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .flow li { padding: 70px 18px 22px; }
  .flow li::before { left: 18px; top: 18px; }
  .flow li + li::after { left: -18px; top: 39px; width: 20px; height: 0; border-left: 0; border-top: 2px dashed var(--ink-soft); }
}
.flow__lead-time { margin-top: 28px; padding: 16px 20px; border-radius: 12px; background: var(--paper-alt); }
.flow__lead-time strong { display: inline-block; margin-right: 12px; font-family: var(--font-round); }

/* 9. 素材とサイズ（FAQ） */
.faq { margin-top: 32px; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; }
.faq summary {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 20px;
  font-family: var(--font-round); font-weight: 700; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); font-weight: 900; }
.faq summary::after { content: "＋"; margin-left: auto; color: var(--ink-soft); }
.faq details[open] summary::after { content: "－"; }
.faq details p { padding: 0 20px 20px 62px; }

/* 10. お問い合わせ */
.contact { background: var(--orange); padding: 80px 0; text-align: center; }
.contact__inner { display: grid; justify-items: center; gap: 22px; }
.contact__title { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); font-weight: 900; }
.contact p { max-width: 32em; }
.contact__sub { font-size: .92rem; }
.contact__sub a { font-weight: 700; text-underline-offset: 3px; display: inline-block; padding: 10px 2px; }

/* 11. フッター */
.site-footer { background: var(--band); color: var(--paper); padding: 40px 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.logo--footer { font-size: 1.4rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__copy { margin-left: auto; font-size: .85rem; text-align: right; }

/* 実績一覧ページ */
.page-head { padding: 48px 0 8px; }
.page-head__title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); font-weight: 900; }
.page-head__lead { margin-top: 12px; max-width: 40em; color: var(--ink-soft); }
.page-head__count { margin-top: 8px; font-family: var(--font-round); font-weight: 700; }
.page-head__count span { font-size: 1.5rem; color: var(--orange-text); }

.works-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 28px; }
.works-filter__btn {
  min-height: 44px; padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  font: 700 .92rem/1.3 var(--font-round); cursor: pointer;
}
.works-filter__btn:hover { background: var(--paper-alt); }
.works-filter__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.gallery.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .gallery.works-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 1000px) { .gallery.works-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery .works-card__btn { height: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; }
.gallery .works-card__btn:hover { transform: translateY(-3px); border-color: var(--ink-soft); }
.works-card[hidden] { display: none; }

.page-end { margin: 64px 0 80px; padding: 36px 24px; border-radius: var(--radius); background: var(--paper-alt); text-align: center; display: grid; justify-items: center; gap: 18px; }
.page-end p { font-family: var(--font-round); font-weight: 700; font-size: 1.15rem; }

/* モーダル */
.works-modal {
  width: min(100% - 24px, 640px); max-height: calc(100dvh - 24px); padding: 0;
  border: 2px solid var(--ink); border-radius: 24px; background: var(--card); color: var(--ink);
}
.works-modal::backdrop { background: rgba(59, 42, 30, .6); }
.works-modal__inner { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 24px; }
.works-modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.works-modal__gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; margin-bottom: 6px; }
.works-modal__img { flex: 0 0 90%; min-width: 0; max-height: 40dvh; scroll-snap-align: start; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper-alt); border-radius: 14px; }
.works-modal__img:only-child { flex-basis: 100%; }
.works-modal__tag { align-self: flex-start; padding: 2px 12px; border-radius: 999px; background: var(--paper-alt); font-size: .85rem; font-weight: 700; }
.works-modal__title { font-size: 1.4rem; font-weight: 900; }
.works-modal__meta { margin: 4px 0 0; display: grid; gap: 6px; }
.works-modal__meta-row { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; padding: 8px 0; border-top: 1.5px dashed var(--line); font-size: .92rem; }
.works-modal__meta dt { color: var(--ink-soft); }
.works-modal__meta dd { margin: 0; }
.works-modal__cta {
  margin-top: 10px; display: flex; align-items: center; justify-content: center; min-height: 52px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--orange); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); font-family: var(--font-round); font-weight: 700; text-decoration: none;
}
.works-modal__note { font-size: .82rem; color: var(--ink-soft); text-align: center; }
.works-modal__cta:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
