/* floresta laboratory — 設計の根拠は docs/DESIGN.md */

:root {
  --ink: #1E2830;
  --ink-2: #26323B;
  --paper: #F5F7F6;
  --white: #FFFFFF;
  --mist: #E3EBE8;
  --moss: #057872;
  --moss-deep: #04615C;
  --indigo: #013672;
  --slate: #56636D;
  --rule: #CCD6D2;
  --on-ink: #E9EEF0;
  --on-ink-dim: #A9B6BD;
  --moss-light: #4DB3A8;
  --indigo-light: #7C9ADB;

  --font-ja: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --font-latin: "Fira Sans", var(--font-ja);

  --gutter: clamp(20px, 5vw, 48px);
  --section-space: clamp(64px, 10vw, 120px);
  --measure: 36em;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.02em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) {
  body { font-size: 1.0625rem; }
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

p, li, dd, figcaption { word-break: auto-phrase; text-wrap: pretty; }

a { color: var(--moss); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--moss-deep); }

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

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--white);
  color: var(--ink);
}
.skip-link:focus { top: 12px; }

/* ───────── ヘッダー（ヒーローの上に重ねる） ───────── */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  padding-top: max(20px, env(safe-area-inset-top));
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--white);
  text-decoration: none;
}
.brand:hover { color: var(--white); }
.brand__mark { width: auto; height: 34px; }
/* 社名はロゴから切り出した画像（書体 Lisboa Sans OSF） */
.brand__name { width: auto; height: 22px; margin-top: 4px; }
.brand--footer .brand__mark { height: 28px; }
.brand--footer .brand__name { height: 18px; margin-top: 3px; }

.site-header__cta {
  color: var(--on-ink);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid rgba(233, 238, 240, 0.4);
}
.site-header__cta:hover { color: var(--white); border-bottom-color: var(--white); }

/* ───────── ヒーロー ───────── */

.hero {
  background: var(--ink);
  color: var(--on-ink);
  padding-top: clamp(112px, 24vw, 184px);
  padding-bottom: clamp(56px, 10vw, 112px);
}

.hero :focus-visible { outline-color: var(--moss-light); }

.hero__title {
  font-size: clamp(1.625rem, 7.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.04em;
  font-feature-settings: "palt";
  color: var(--white);
}
.hero__title span { display: inline-block; }

.hero__sub {
  margin-top: clamp(20px, 4vw, 32px);
  max-width: 30em;
  color: var(--on-ink);
  font-size: 0.9375rem;
  line-height: 2;
  word-break: auto-phrase;
}
@media (min-width: 900px) {
  .hero__sub { font-size: 1.0625rem; }
}

/* 名刺別の出し分け。ref.js が <html data-ref> を描画前に設定する */
.hero__sub[data-ref-variant="kgs"],
.hero__sub[data-ref-variant="ygm"] { display: none; }
html[data-ref="kgs"] .hero__sub[data-ref-variant="neutral"],
html[data-ref="ygm"] .hero__sub[data-ref-variant="neutral"] { display: none; }
html[data-ref="kgs"] .hero__sub[data-ref-variant="kgs"],
html[data-ref="ygm"] .hero__sub[data-ref-variant="ygm"] { display: block; }

/* 特定の名刺から来たときだけ足す文 */
[data-ref-only] { display: none; }
html[data-ref="kgs"] [data-ref-only="kgs"],
html[data-ref="ygm"] [data-ref-only="ygm"] { display: block; }

/* クロマトグラム：このページで唯一の「大胆な」要素 */
.chroma {
  margin-top: clamp(40px, 8vw, 72px);
  margin-inline: calc(var(--gutter) * -0.25);
}

.chroma__svg { width: 100%; overflow: visible; }

.chroma__line {
  stroke-width: 3.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .chroma__line { animation: chroma-draw 2.4s cubic-bezier(0.45, 0, 0.2, 1) 0.3s both; }
}
@keyframes chroma-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

.chroma__labels text {
  fill: var(--on-ink-dim);
  font-family: var(--font-ja);
  font-size: 21px; /* 390px幅で約12px */
  letter-spacing: 0.08em;
}
@media (min-width: 640px) {
  .chroma__line { stroke-width: 2.2; }
  .chroma__labels text { font-size: 15px; }
}
@media (min-width: 1100px) {
  .chroma__line { stroke-width: 1.6; }
  .chroma__labels text { font-size: 11px; }
}

.chroma__caption {
  margin-top: 8px;
  text-align: right;
  color: var(--on-ink-dim);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.hero__foot {
  margin-top: clamp(40px, 8vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(233, 238, 240, 0.16);
}

.hero__person { display: flex; flex-direction: column; gap: 2px; }
.hero__name { color: var(--white); font-size: 1.125rem; font-weight: 500; letter-spacing: 0.12em; }
.hero__role { color: var(--on-ink-dim); font-size: 0.8125rem; }

/* ───────── ボタン ───────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--moss);
  color: var(--white);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--moss-deep); color: var(--white); }
.hero .button { min-width: 200px; }
@media (max-width: 559px) {
  .hero .button { width: 100%; }
}

/* ───────── セクション共通 ───────── */

.section { padding-block: var(--section-space); }
.section + .section { padding-top: 0; }
.section + .section .section__grid { padding-top: var(--section-space); border-top: 1px solid var(--rule); }
.section--contact { background: var(--white); }
.section + .section--contact { padding-top: var(--section-space); }
.section + .section--contact .section__grid { padding-top: 0; border-top: 0; }

.section__grid {
  display: grid;
  gap: 28px;
}
@media (min-width: 900px) {
  .section__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px;
  }
  /* 専門領域は3列を並べるため、見出しを上に置いて全幅を使う */
  .section--wide .section__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .section--wide .field--food {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 0 48px;
    padding: 56px;
  }
  .section--wide .field--food > * { grid-column: 1; }
  .section--wide .field--food .tags { grid-column: 2; grid-row: 1 / span 3; align-self: start; flex-direction: column; align-items: flex-start; margin-top: 8px; }
  .section--wide .field--food .field__partner { grid-column: 1 / -1; }
}

.section__title {
  font-size: clamp(1.375rem, 4.6vw, 1.75rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.section__aside .note { margin-top: 16px; }

.lead {
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 2;
}
@media (min-width: 900px) {
  .lead { font-size: 1.1875rem; }
}

.note {
  max-width: var(--measure);
  color: var(--slate);
  font-size: 0.875rem;
  line-height: 1.9;
}

.subhead {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 経営支援の4項目：ヒーローの基線を静かに繰り返す */
.baseline-list {
  margin-block: 40px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
@media (min-width: 640px) {
  .baseline-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.baseline-list li {
  position: relative;
  padding: 14px 0 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.baseline-list li::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--moss), var(--indigo));
}

/* ───────── 4つの専門領域 ───────── */

.field p + p { margin-top: 0.6em; }
.field p { max-width: var(--measure); }

.field__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.field--food {
  background: var(--mist);
  padding: clamp(28px, 6vw, 48px);
  margin-inline: calc(var(--gutter) * -1);
  border-radius: 0;
}
@media (min-width: 900px) {
  .field--food { margin-inline: 0; border-radius: 4px; }
}
.field--food .field__title {
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.field__partner {
  margin-top: 28px !important;
  padding-top: 20px;
  border-top: 1px solid rgba(30, 40, 48, 0.14);
  color: var(--slate);
  font-size: 0.875rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.tag {
  padding: 4px 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--indigo);
  font-size: 0.8125rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
}
.field--food .tag { background: rgba(255, 255, 255, 0.55); border-color: rgba(1, 54, 114, 0.45); }

.field-row {
  margin-top: 48px;
  display: grid;
  gap: 0;
}
.field-row .field { padding-block: 28px; border-top: 1px solid var(--rule); }
.field-row .field:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 760px) {
  .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field-row .field {
    padding: 0 24px;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
  .field-row .field:first-child { padding-left: 0; border-left: 0; }
  .field-row .field:last-child { padding-right: 0; }
}

/* ───────── 自社事業：IMO head ─────────
   カードで囲む。IMO head 独自の色はロゴの中だけに留める */

.product {
  margin-top: 32px;
  display: grid;
  gap: 24px;
  padding: clamp(24px, 6vw, 40px);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
@media (min-width: 640px) {
  .product { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; align-items: start; }
}
/* ロゴ（五角形）はカードの白地に直接置く。画像側に余白を含めてある */
.product__logo {
  width: 120px;
  aspect-ratio: 1;
}
@media (min-width: 640px) {
  .product__logo { width: 100%; }
}
.product__logo img { width: 100%; height: 100%; object-fit: contain; }
.product__name {
  font-family: var(--font-latin);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 12px;
}
.product__body p { max-width: var(--measure); }
.product__body p + p { margin-top: 0.6em; }
.product__local { color: var(--moss-deep); font-weight: 500; }
.tag--tech { color: var(--slate); border-color: var(--rule); font-family: var(--font-latin), var(--font-ja); }
.product__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.product__note { margin-top: 10px !important; font-size: 0.8125rem; }
.product__sns { font-weight: 500; text-underline-offset: 0.25em; }

/* 主役の「相談してみる」と競わないよう、外部サービスへのボタンは枠線だけにする */
.button--outline {
  min-height: 48px;
  padding: 10px 24px;
  background: transparent;
  color: var(--moss);
  border: 1px solid var(--moss);
}
.button--outline:hover { background: #EAF4F3; color: var(--moss-deep); }

/* ───────── プロフィール ───────── */

.profile__name {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}
.profile__roman {
  font-family: var(--font-latin);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--slate);
}

/* 経歴：時系列なので点と線で順序を見せる */
.timeline {
  position: relative;
  margin-block: 36px 56px;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--moss), var(--indigo));
}
.timeline__item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-block: 10px;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 19px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--moss);
}
.timeline__item--now::before { background: var(--indigo); border-color: var(--indigo); }
.timeline__what { font-weight: 500; }
.timeline__item--now .timeline__what { font-family: var(--font-latin); font-weight: 500; letter-spacing: 0.02em; }
.timeline__detail { color: var(--slate); font-size: 0.875rem; line-height: 1.7; }

.credentials {
  margin-top: 16px;
  display: grid;
  gap: 0 32px;
}
@media (min-width: 640px) {
  .credentials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.credentials li {
  padding-block: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

/* ───────── 屋号とロゴ ───────── */

.story__logo {
  margin-top: 32px;
  width: min(72%, 280px);
}
.story__logo img { width: 100%; }
.story p + p { margin-top: 1em; }
.story p { max-width: var(--measure); }
.story .lead { margin-bottom: 0.4em; }
@media (min-width: 900px) {
  .story__logo { margin-top: 40px; width: min(100%, 260px); }
}

/* ───────── 拠点 ───────── */

.bases {
  display: grid;
  gap: 0;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .bases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}
.base {
  display: flex;
  flex-direction: column;
  padding-block: 16px 18px;
  border-bottom: 1px solid var(--rule);
}
.base__city { font-size: 1.25rem; font-weight: 500; letter-spacing: 0.12em; }
.base__area { color: var(--slate); font-size: 0.875rem; }

/* ───────── ご相談の流れ ─────────
   順番のある内容なので番号を振る。経歴のタイムラインと同じ「点と線」でつなぐ */

.steps__heading {
  margin-top: 36px;
  color: var(--slate);
  font-size: 0.875rem;
  font-weight: 500;
}

.steps {
  position: relative;
  margin-top: 16px;
  padding-left: 40px;
  counter-reset: step;
}
.steps::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, var(--moss), var(--indigo));
}
.steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-block: 4px 18px;
  counter-increment: step;
}
.steps__item:last-child { padding-bottom: 0; }
.steps__item::before {
  content: counter(step);
  position: absolute;
  left: -40px;
  top: 2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--moss);
  color: var(--moss-deep);
  font-family: var(--font-latin);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}
.steps__item:last-child::before { border-color: var(--indigo); color: var(--indigo); }
/* 縦線を最後の丸で止める（問い合わせ欄の地色で、丸より下の線を隠す） */
.steps__item:last-child::after {
  content: "";
  position: absolute;
  left: -27px;
  top: 30px;
  bottom: -14px;
  width: 2px;
  background: var(--white);
}
.steps__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.steps__text { margin-top: 2px; color: var(--slate); font-size: 0.875rem; line-height: 1.75; }

/* ───────── 問い合わせフォーム ───────── */

.form { display: grid; gap: 24px; max-width: 40em; }

.form__row { display: grid; gap: 8px; }
.form__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.form__label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}
.form__req, .form__opt {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.form__req { color: var(--moss); }
.form__opt { color: var(--slate); }

.form__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #AEBBB7;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* iOS のズームを防ぐため 16px 以上 */
  line-height: 1.6;
}
.form__input:focus { border-color: var(--moss); outline: 2px solid rgba(5, 120, 114, 0.25); outline-offset: 0; }
.form__textarea { min-height: 180px; resize: vertical; }

.form__input[aria-invalid="true"] { border-color: #B3412E; }

.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border: 1px solid #AEBBB7;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.9375rem;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--moss);
}
.check:has(input:checked) { border-color: var(--moss); background: #EAF4F3; }
.check:has(input:focus-visible) { outline: 2px solid var(--moss); outline-offset: 2px; }

.form__trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form__turnstile.is-active { min-height: 65px; }

.form__privacy { color: var(--slate); font-size: 0.8125rem; }

.button--submit { width: 100%; }
@media (min-width: 560px) {
  .button--submit { width: auto; min-width: 240px; justify-self: start; }
}
.button--submit[disabled] { opacity: 0.6; cursor: progress; }

.form__status { min-height: 1.9em; font-size: 0.9375rem; }
.form__status[data-state="ok"] { color: var(--moss-deep); }
.form__status[data-state="error"] { color: #B3412E; }

/* 未確定の要素。公開前に確定させる */
.is-placeholder {
  justify-self: start;
  padding: 4px 10px;
  border: 1px dashed #C08A2B;
  color: #8A5F14;
  font-size: 0.875rem;
}

/* ───────── フッター ───────── */

.site-footer {
  background: var(--ink);
  color: var(--on-ink-dim);
  padding-block: 56px max(40px, env(safe-area-inset-bottom));
  font-size: 0.8125rem;
}
.site-footer__inner {
  display: grid;
  gap: 20px;
  align-items: center;
}
@media (min-width: 760px) {
  .site-footer__inner { grid-template-columns: auto 1fr auto; gap: 32px; }
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer__nav a { color: var(--on-ink); }
.site-footer__nav a:hover { color: var(--white); }
.site-footer__copy { font-family: var(--font-latin); letter-spacing: 0.04em; }
.site-footer :focus-visible { outline-color: var(--moss-light); }

/* ───────── 下層ページ（プライバシーポリシーなど） ───────── */

.page-head {
  background: var(--ink);
  color: var(--white);
  padding-top: clamp(112px, 20vw, 160px);
  padding-bottom: clamp(40px, 8vw, 72px);
}
.page-head h1 {
  font-size: clamp(1.5rem, 5.6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-feature-settings: "palt";
}

.prose { max-width: 40em; padding-block: clamp(56px, 10vw, 104px); }
.prose h2 {
  margin-top: 48px;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.prose h2:first-child { margin-top: 0; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 0.8em; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose .note { margin-top: 48px; }
