/* =========================================================
   株式会社しろざ コーポレートサイト（試作）
   外部フォント・CDNなし。色はすべてCSS変数で管理。
   ========================================================= */

/* ---------- 色・寸法 ---------- */
:root {
  color-scheme: light dark;
  --bg: #f6f5f0;
  --bg-alt: #eeede6;
  --surface: #ffffff;
  --ink: #1b2420;
  --muted: #56615a;
  --line: #d9dcd3;
  --brand: #2c6a4d;
  --brand-strong: #1f5139;
  --brand-ink: #ffffff;
  --brand-soft: #e3eee7;
  --frost: #ffffff;
  --accent: #b5892f;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgb(20 40 30 / .06), 0 8px 24px -12px rgb(20 40 30 / .18);
  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-h: 4.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "BIZ UDPMincho", "Noto Serif JP", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311; --bg-alt: #131a17; --surface: #18201c; --ink: #e7ece9; --muted: #a2ada6;
    --line: #2a3530; --brand: #7cc4a0; --brand-strong: #9ad6b7; --brand-ink: #0e1311;
    --brand-soft: #1d2c25; --frost: #dfe9e3; --accent: #d9b464; --danger: #f2a49c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -16px rgb(0 0 0 / .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1311; --bg-alt: #131a17; --surface: #18201c; --ink: #e7ece9; --muted: #a2ada6;
  --line: #2a3530; --brand: #7cc4a0; --brand-strong: #9ad6b7; --brand-ink: #0e1311;
  --brand-soft: #1d2c25; --frost: #dfe9e3; --accent: #d9b464; --danger: #f2a49c;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -16px rgb(0 0 0 / .7);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.9;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
svg.ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--brand); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .6em; font-feature-settings: "palt"; letter-spacing: .04em; }
p, ul, ol, dl { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .35em; }
small { font-size: .85em; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, 46rem); margin-inline: auto; }
.mt-2 { margin-top: 2rem; }

/* ---------- スクロール進捗（対応ブラウザのみ） ---------- */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
      background: var(--brand); transform-origin: 0 50%; transform: scaleX(0);
      animation: progress linear both; animation-timeline: scroll(root);
    }
    @keyframes progress { to { transform: scaleX(1); } }
  }
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name small { font-size: .68rem; color: var(--muted); letter-spacing: .12em; }
.brand-name strong { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; letter-spacing: .12em; }

.global-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.global-nav li + li { margin-top: 0; }
.global-nav a {
  display: block; padding: .5rem .7rem; border-radius: 999px; color: var(--ink);
  text-decoration: none; font-size: .92rem; white-space: nowrap;
}
.global-nav a:hover { background: var(--brand-soft); }
.global-nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: .5rem; flex: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.menu-toggle { display: none; }
.menu-toggle .bar { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.menu-toggle .bars { display: grid; gap: 4px; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 480px) {
  .header-inner { gap: .5rem; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name small { display: none; }
  .brand-name strong { font-size: 1rem; }
  .theme-toggle { display: none; } /* 狭い画面では端末の設定（ダーク/ライト）に従う */
  .icon-btn { width: 2.4rem; height: 2.4rem; }
}
/* メニューは2項目だけなので、畳むのは狭い画面のみ */
@media (max-width: 600px) {
  .menu-toggle { display: inline-grid; }
  .global-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  }
  .global-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .global-nav ul { flex-direction: column; padding: .75rem var(--gutter) 1.5rem; }
  .global-nav a { padding: .9rem .5rem; border-radius: 8px; font-size: 1rem; border-bottom: 1px solid var(--line); }
  /* JSが無効でもメニューに行けるよう、JSありの時だけ畳む */
  html:not(.js) .global-nav { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; border: 0; }
  html:not(.js) .header-inner { flex-wrap: wrap; }
  html:not(.js) .global-nav { width: 100%; order: 9; }
  html:not(.js) .menu-toggle { display: none; }
}

/* ---------- ボタン ---------- */
.btn {
  --btn-bg: var(--brand); --btn-ink: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-ink); font: inherit; font-weight: 700; font-size: 1rem;
  line-height: 1.4; letter-spacing: .04em; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:hover { background: var(--brand-strong); box-shadow: var(--shadow); }
.btn--block { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: scale(.98); }
}

/* ---------- セクション共通 ---------- */
main { display: block; }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
  color: var(--brand); font-size: .8rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 1.75rem; height: 1px; background: currentColor; }
.section-title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.4rem); }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

/* ---------- ヒーロー ---------- */
.hero { position: relative; overflow: clip; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 60vmax; height: 60vmax; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-title {
  font-family: var(--font-serif); font-weight: 600; letter-spacing: .06em; line-height: 1.5;
  font-size: clamp(2rem, 1.1rem + 4.2vw, 3.6rem); margin-bottom: .5em;
}
.hero-sub { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--muted); max-width: 32em; margin-bottom: 0; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 32em; font-size: .93rem; }
.hero-facts div { display: flex; gap: .75rem; }
.hero-facts dt { color: var(--muted); }
.hero-facts dd { margin: 0; font-weight: 700; }
.hero-visual { position: relative; aspect-ratio: 1; max-width: 30rem; width: 100%; justify-self: center; }
.hero-visual svg { width: 100%; height: 100%; overflow: visible; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 18rem; order: -1; }
}

/* ヒーローの図形アニメーション（動きを減らす設定では静止） */
.mark-ring { fill: none; stroke: var(--line); }
.mark-ring--brand { stroke: var(--brand); stroke-opacity: .35; }
.mark-stem { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.mark-leaf { fill: var(--brand); }
.mark-leaf--soft { fill: color-mix(in srgb, var(--brand) 55%, var(--bg)); }
.mark-frost { fill: var(--frost); }
.orbit-a { fill: none; stroke: color-mix(in srgb, var(--brand) 45%, var(--bg)); stroke-linecap: round; }
.orbit-b { fill: none; stroke: var(--accent); stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .js .hero-visual .mark-stem { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s .1s var(--ease) forwards; }
  .js .hero-visual .mark-leaf-g { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; animation: sprout .9s var(--ease) forwards; animation-delay: calc(.5s + var(--i, 0) * .12s); }
  .js .hero-visual .mark-frost { animation: twinkle 4.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.7s); }
  .js .hero-visual .mark-orbit { transform-origin: 200px 200px; animation: spin 60s linear infinite; }
  .js .hero-visual .mark-float { animation: float 7s ease-in-out infinite; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes sprout { from { opacity: 0; transform: scale(.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
  @keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
}

/* ---------- スクロールで現れる ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}

/* 定義リスト（会社情報） */
.info-list { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; margin: 0; border-top: 1px solid var(--line); }
.info-list dt, .info-list dd { padding: 1rem .25rem; border-bottom: 1px solid var(--line); margin: 0; }
.info-list dt { font-weight: 700; color: var(--muted); font-size: .93rem; }
.info-list dd ul { margin: 0; }
@media (max-width: 600px) {
  .info-list { grid-template-columns: 1fr; }
  .info-list dt { border-bottom: 0; padding-bottom: 0; }
  .info-list dd { padding-top: .25rem; }
}

/* トップの会社情報の下のリンク */
.link-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
.link-list li + li { margin-top: 0; }
.link-list a { font-weight: 700; }
.link-list a::after { content: " →"; }
.contact-note { margin: 1.5rem 0 0; color: var(--muted); font-size: .93rem; }

/* ---------- トップ：私たちについて・事業内容・大切にしていること ---------- */
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.about-text p:last-child { margin-bottom: 0; }

.work-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.work-list li + li { margin-top: 0; }
.work-item { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.75rem .25rem; border-bottom: 1px solid var(--line); }
.work-icon { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.work-icon svg { width: 24px; height: 24px; }
.work-item h3 { font-size: 1.08rem; margin-bottom: .35em; }
.work-item h3 small { display: inline-block; font-size: .8em; font-weight: 400; color: var(--muted); letter-spacing: .02em; }
.work-item p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.8; }
@media (max-width: 720px) {
  .work-list { grid-template-columns: 1fr; }
  .work-item { padding-block: 1.4rem; }
}

.value-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); counter-reset: value; }
.value-list li { margin: 0; padding: 1.5rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); counter-increment: value; }
.value-list li::before { content: counter(value, decimal-leading-zero); display: block; margin-bottom: .6rem; font-family: var(--font-serif); color: var(--brand); font-size: .95rem; letter-spacing: .12em; }
.value-list h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; margin-bottom: .4em; }
.value-list p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.8; }
@media (max-width: 760px) {
  .value-list { grid-template-columns: 1fr; }
}

/* ---------- 下層ページ ---------- */
.page-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); position: relative; overflow: clip; }
.page-hero h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); margin-bottom: .4em; }
.page-hero p { color: var(--muted); max-width: 40em; margin: 0; }
.page-hero-deco { position: absolute; right: max(var(--gutter), calc((100% - var(--wrap)) / 2)); top: 50%; translate: 0 -50%; width: clamp(5rem, 14vw, 9rem); opacity: .9; }
@media (max-width: 700px) { .page-hero-deco { display: none; } }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.breadcrumb a { color: inherit; }

.prose h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); margin-top: 2.6em; padding-top: .2em; }
.prose h2:first-child { margin-top: 0; }
.prose > * { max-width: 46rem; }
.prose .info-list { max-width: none; }


/* ---------- フォーム ---------- */
.form { display: grid; gap: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.4rem, 4vw, 2.5rem); }
.field { display: grid; gap: .45rem; }
.field label { font-weight: 700; font-size: .95rem; padding: 0; }
.req, .opt { display: inline-block; font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; margin-left: .5rem; vertical-align: .1em; font-weight: 700; }
.req { background: var(--brand); color: var(--brand-ink); }
.opt { background: var(--bg-alt); color: var(--muted); }
.input, .textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; min-height: 3rem;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 9rem; resize: vertical; line-height: 1.7; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.input:user-invalid, .textarea:user-invalid, .input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: .3rem 0 0; accent-color: var(--brand); flex: none; }
.form-title { margin: 0; font-size: 1.3rem; }
.form-status { margin: 0; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--brand-soft); font-weight: 600; }
.form-status[hidden] { display: none; }
.form-note { margin: 0; color: var(--muted); font-size: .93rem; }
.form .link-list { margin: 0; }
.field-hint { margin-left: .6rem; font-weight: 400; font-size: .82rem; color: var(--muted); }
.field-error { margin: 0; color: var(--danger); font-size: .9rem; font-weight: 600; }
/* 送信時の誤りのまとめ（サーバーから返したとき） */
.form-errors { padding: 1rem 1.25rem; border: 1px solid var(--danger); border-radius: var(--radius); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.form-errors p { margin: 0; font-weight: 700; }
.form-errors ul { margin: .5rem 0 0; font-size: .93rem; }
.form-errors a { color: inherit; }
/* 迷惑送信よけの欄（人には見せない） */
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { opacity: .6; cursor: progress; }

/* ---------- フッター ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h2 { font-size: .8rem; letter-spacing: .16em; color: var(--muted); margin-bottom: 1rem; font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li + li { margin-top: .5rem; }
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); text-decoration: underline; }
.footer-company address { font-style: normal; color: var(--muted); }
.footer-company .brand { margin-bottom: 1rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .82rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-company { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 印刷 ---------- */
@media print {
  .site-header, .progress, .site-footer .footer-grid nav, .hero-visual { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
