/* ==========================================================
   全ページ共通のスタイル
   色・文字の基本設定、共通部品、ヘッダー、お問い合わせの帯、フッター
   ページ固有のスタイルは各ページ用の CSS（例: top.css）に書く
   ========================================================== */

/* ─── 色・文字の基本設定 ─────────────────────── */
:root {
  --paper: #f7f5f0;        /* 生成りの地色 */
  --paper-deep: #efebe2;   /* 一段濃い地色 */
  --ink: #2b2a27;          /* 本文の墨色 */
  --ink-soft: #625f58;     /* 補助の文字色（地色に対して 4.5:1 以上） */
  --line: #d9d4c9;         /* 罫線 */
  --white: #fffefb;

  /* 積み木の差し色（くすませて落ち着かせる） */
  --terracotta: #c47a5e;
  --sage: #8ea58a;
  --mustard: #d6b25c;
  --sky: #8eaabd;

  /* 欧文を先に置く（ロゴに合わせた幾何学的なサンセリフ） */
  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-en: "Jost", "Helvetica Neue", Arial, var(--font-ja);

  --container: 1120px;
  --gutter: 24px;
  --radius: 18px;
}

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

html {
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }

/* 通読する本文 */
.prose { font-size: 15px; line-height: 2; letter-spacing: 0.02em; color: var(--ink); }
.prose p + p { margin-top: 1.2em; }

/* 英字の小見出し＋日本語の見出し */
.sec-head { display: grid; gap: 14px; align-content: start; align-self: start; }
.sec-head__en {
  font-family: var(--font-en); font-weight: 400; font-size: 13px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft);
  display: flex; align-items: center; gap: 12px;
}
.sec-head__en::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--terracotta)); }
.sec-head__ja {
  font-size: clamp(24px, 3.2vw, 34px); font-weight: 400; line-height: 1.5;
  letter-spacing: 0.08em; word-break: keep-all; font-feature-settings: "palt";
}

/* 矢印つきのリンク */
.link-arrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 14px; letter-spacing: 0.08em; line-height: 1.2;
  padding: 6px 0; border-bottom: 1px solid var(--ink);
  transition: gap .3s ease;
}
.link-arrow:hover { gap: 22px; }
.link-arrow svg { width: 16px; height: 16px; flex: none; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 28px; border-radius: 999px;
  font-size: 14px; letter-spacing: 0.08em; line-height: 1.2;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background .3s ease, color .3s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* 積み木の図形 */
.shape { position: absolute; display: block; pointer-events: none; }
.shape--half { border-radius: 999px 999px 0 0; }
.shape--circle { border-radius: 50%; }
.shape--quarter { border-radius: 100% 0 0 0; }
.shape--tri { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shape--house { clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%); }

/* 設計実績のカード（トップの設計実績・実績の一覧・実績ページの「ほかの設計実績」） */
.work { display: block; }
.work__photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-deep); }
.work__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.work:hover .work__photo img { transform: scale(1.04); }
.work__meta { margin-top: 20px; display: flex; gap: 16px; align-items: baseline; }
.work__no { font-family: var(--font-en); font-size: 13px; letter-spacing: 0.16em; color: var(--ink-soft); }
.work__title { font-size: 17px; font-weight: 500; line-height: 1.5; letter-spacing: 0.06em; }
.work__text { margin-top: 8px; padding-left: 37px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }

/* ─── ヘッダー ─────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.header__logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav__list { display: flex; gap: 30px; }
.nav__list a { font-size: 13px; letter-spacing: 0.08em; line-height: 1.2; padding: 8px 0; position: relative; white-space: nowrap; }
.nav__list a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav__list a:hover::after { transform: scaleX(1); }
.nav .btn { min-height: 42px; padding: 0 22px; font-size: 13px; }
.menu-btn { display: none; }

/* サブメニュー（PC: マウスを重ねるかキーボードで選ぶと開く） */
.nav__item { position: relative; }
/* 矢印の有無で文字の高さがずれないよう、項目はすべて同じ並べ方にする */
.nav__item > a { display: inline-flex; align-items: center; gap: 4px; }
.nav__chevron { width: 14px; height: 14px; flex: none; transition: transform .3s ease; }
.subnav {
  position: absolute; left: 50%; top: 100%; z-index: 60;
  min-width: 15em; padding: 10px; margin-top: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgb(43 42 39 / 10%);
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
/* メニューの項目とサブメニューの間をマウスが通っても閉じないようにする */
.subnav::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.has-sub:hover > .subnav, .has-sub:focus-within > .subnav { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.has-sub:hover .nav__chevron, .has-sub:focus-within .nav__chevron { transform: rotate(180deg); }
.subnav a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; letter-spacing: 0.04em; white-space: nowrap;
}
.subnav a::after { display: none; }
.subnav a:hover { background: var(--paper); }
.subnav a[aria-current="page"] { background: var(--paper-deep); }

/* ─── お問い合わせの帯（各ページの最後に置く） ─── */
.contact { position: relative; background: var(--paper-deep); }
.contact__inner { position: relative; background: var(--ink); color: var(--paper); border-radius: 56px 56px 0 0; padding: 104px 0 112px; overflow: hidden; }
.contact .s1 { width: 220px; height: 110px; background: var(--terracotta); right: -40px; bottom: 0; opacity: .9; }
.contact .s2 { width: 90px; height: 90px; background: var(--mustard); right: 200px; bottom: 0; }
.contact__grid { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: center; }
.contact .sec-head__en { color: #bdb8ad; }
.contact__lead { margin-top: 28px; font-size: 15px; line-height: 2; letter-spacing: 0.02em; color: #e4e0d6; }
.contact__box { display: grid; gap: 28px; justify-items: start; }
.contact__tel { display: inline-flex; align-items: center; gap: 16px; font-family: var(--font-en); font-weight: 300; font-size: clamp(30px, 4vw, 44px); letter-spacing: 0.06em; line-height: 1.2; }
.contact__tel svg { width: 26px; height: 26px; }
.contact__tel-note { font-size: 13px; color: #bdb8ad; line-height: 1.6; margin-top: -16px; }
.contact .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); min-height: 60px; padding: 0 36px; font-size: 15px; }
.contact .btn:hover { background: transparent; color: var(--paper); }
.contact :focus-visible { outline-color: var(--paper); }

/* ─── フッター ─────────────────────────────── */
.footer { background: var(--ink); color: #cfcabf; border-top: 1px solid #45433e; padding: 64px 0 36px; }
/* 背景が濃いので、フォーカスの枠は明るい色にする */
.footer :focus-visible { outline-color: var(--paper); }
.footer__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
.footer__logo { width: 190px; filter: invert(1) brightness(1.6); }
.footer__info { margin-top: 26px; font-size: 13px; line-height: 2; }
.footer__nav { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 40px; justify-content: end; align-content: start; font-size: 13px; letter-spacing: 0.06em; line-height: 1.6; }
.footer__nav a:hover { color: var(--paper); }
.footer__bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid #45433e; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12px; }
.footer__sns { display: flex; gap: 24px; font-family: var(--font-en); letter-spacing: 0.14em; }
.footer__copy { font-family: var(--font-en); letter-spacing: 0.1em; }

/* ─── ふわっと表示（JavaScript が動くときだけ） ─── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── タブレット ───────────────────────────── */
@media (max-width: 1000px) {
  .nav__list { gap: 20px; }
  .nav { gap: 20px; }
}

/* ─── スマートフォン ───────────────────────── */
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .header__inner { height: 64px; }
  .header__logo img { height: 32px; }

  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; color: var(--ink); cursor: pointer;
  }
  .menu-btn svg { width: 24px; height: 24px; }
  .menu-btn .icon-close { display: none; }
  .menu-btn[aria-expanded="true"] .icon-open { display: none; }
  .menu-btn[aria-expanded="true"] .icon-close { display: block; }

  .nav {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 24px;
    padding: 8px var(--gutter) 32px; background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
    /* サブメニューを並べると長くなるので、画面の高さを超えたら中でスクロールする */
    max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a { display: block; padding: 18px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .nav__list a::after { display: none; }
  /* スマホではサブメニューを開いた状態で並べる */
  .nav__chevron { display: none; }
  .subnav {
    position: static; min-width: 0; margin: 0; padding: 4px 0 8px 16px;
    background: none; border: 0; border-radius: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none; transition: none;
    border-bottom: 1px solid var(--line);
  }
  .subnav::before { display: none; }
  .has-sub > a { display: block; border-bottom: 0; padding-bottom: 8px; }
  .subnav a { padding: 10px 0; border-bottom: 0; font-size: 14px; color: var(--ink-soft); border-radius: 0; }
  .subnav a:hover { background: none; color: var(--ink); }
  .subnav a[aria-current="page"] { background: none; color: var(--ink); font-weight: 500; }
  .nav .btn { min-height: 52px; font-size: 14px; }

  .contact__grid, .footer__inner { grid-template-columns: 1fr; gap: 40px; }

  .contact__inner { border-radius: 32px 32px 0 0; padding: 72px 0 120px; }
  .contact .s1 { width: 150px; height: 75px; right: -30px; }
  .contact .s2 { width: 56px; height: 56px; right: 130px; }
  .contact .btn { width: 100%; }

  .footer__nav { grid-template-columns: repeat(2, 1fr); justify-content: start; }
  .footer__bottom { flex-direction: column; }
}
