/* =========================================================
   有限会社Kroom — 共通スタイル
   ========================================================= */

:root {
  /* Palette - base */
  --c-bg: #F8F5F0;          /* Off White */
  --c-bg-alt: #64432D;      /* Dark Walnut (section alt) */
  --c-text: #2B2722;        /* Deep Charcoal */
  --c-text-sub: #7A736B;    /* Soft Gray */
  --c-line: #D9D2C7;
  --c-white: #FFFFFF;
  --c-shadow: rgba(43, 39, 34, 0.08);

  /* Accent (default = Walnut) */
  --c-accent: #8B6F4E;
  --c-accent-hover: #6F5839;
  --c-accent-sub: #B89B7A;
  --c-accent-real: #8B6F4E;

  /* Type */
  --ff-mincho: "Noto Serif JP", "Yu Mincho", "游明朝", serif;
  --ff-gothic: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --ff-mono: "JetBrains Mono", "Menlo", monospace;

  /* Easing */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Accent themes */
:root[data-accent="terracotta"] {
  --c-accent: #C68B5C;
  --c-accent-hover: #A66E40;
  --c-accent-sub: #D9A77F;
  --c-accent-real: #C68B5C;
}
:root[data-accent="wood"] {
  --c-accent: #B89B7A;
  --c-accent-hover: #8B6F4E;
  --c-accent-sub: #C9B393;
  --c-accent-real: #B89B7A;
}

* { box-sizing: border-box; }
:root { color-scheme: light; }
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-gothic);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Skip link */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  padding: 12px 20px;
  background: var(--c-text);
  color: #fff;
  font-family: var(--ff-mincho);
  font-size: 13px;
  letter-spacing: 0.2em;
  z-index: 1000;
  transform: translateY(-120%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Global focus-visible */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 80px;
}
@media (max-width: 1024px) { .container { padding: 0 48px; } }
@media (max-width: 640px)  { .container { padding: 0 24px; } }
@media (max-width: 380px)  { .container { padding: 0 18px; } }

.section { padding: 140px 0; }
@media (max-width: 1024px) { .section { padding: 96px 0; } }
@media (max-width: 640px)  { .section { padding: 72px 0; } }

/* Typography */
.font-mincho { font-family: var(--ff-mincho); }
.font-gothic { font-family: var(--ff-gothic); }

h1, h2, h3, h4 {
  font-family: var(--ff-mincho);
  font-weight: 500;
  margin: 0;
  color: var(--c-text);
  letter-spacing: 0.06em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

/* Section heading block (純和風 — 英文タグラインは使わない) */
.heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px;
}
.heading__label {
  font-family: var(--ff-mincho);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--c-accent);
  font-weight: 500;
}
.heading__title {
  font-family: var(--ff-mincho);
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.5;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.heading__title--lg { font-size: clamp(34px, 6vw, 56px); line-height: 1.4; }
.heading__lead {
  font-size: 15px;
  line-height: 2.0;
  color: var(--c-text-sub);
  max-width: 640px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .heading__title { font-size: 28px; }
  .heading__title--lg { font-size: 36px; }
}
@media (max-width: 480px) {
  .heading__title { font-size: 24px; }
  .heading__title--lg { font-size: 31px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 48px;
  font-family: var(--ff-mincho);
  font-size: 14px;
  letter-spacing: 0.2em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn--primary {
  background: var(--c-accent);
  color: #fff;
}
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-text);
}
.btn--outline:hover { background: var(--c-text); color: #fff; }

.tlink {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--ff-mincho);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--c-text);
  cursor: pointer;
}
.tlink__arrow {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--c-text);
  position: relative;
  transition: width 0.3s var(--ease);
}
.tlink__arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3px;
  width: 8px; height: 1px;
  background: var(--c-text);
  transform: rotate(35deg);
  transform-origin: right center;
}
.tlink:hover .tlink__arrow { width: 48px; }

/* Header */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 0;
  background: transparent;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), padding 0.4s var(--ease);
}
.header.is-scrolled {
  background: rgba(248, 245, 240, 0.96);
  backdrop-filter: blur(8px);
  padding: 16px 0;
  box-shadow: 0 1px 0 var(--c-line);
}
/* ヒーロー時：背景画像と文字が同化しないよう薄い暗幕を敷く */
.header.is-hero:not(.is-scrolled) {
  background: linear-gradient(
    to bottom,
    rgba(43, 39, 34, 0.62) 0%,
    rgba(43, 39, 34, 0.38) 60%,
    rgba(43, 39, 34, 0.06) 100%
  );
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.5em;
  white-space: nowrap;
}
.logo__sep {
  font-family: var(--ff-mincho);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  color: var(--c-text);
  opacity: 0.5;
}
.logo__mark {
  font-family: var(--ff-mincho);
  font-size: 23px;
  letter-spacing: 0.16em;
  color: var(--c-text);
  font-weight: 700;
  line-height: 1;
}
.logo__mark::first-letter { color: var(--c-accent-real); }
.logo__sub {
  font-family: var(--ff-mincho);
  font-size: 23px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}
.header.is-hero .logo__mark,
.header.is-hero .logo__sep,
.header.is-hero .nav__link { color: #fff; }
.header.is-hero.is-scrolled .logo__mark,
.header.is-hero.is-scrolled .logo__sep,
.header.is-hero.is-scrolled .nav__link { color: var(--c-text); }
.header.is-hero .logo__sub { color: rgba(255,255,255,0.92); }
.header.is-hero.is-scrolled .logo__sub { color: var(--c-text-sub); }

.nav {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav__link {
  font-family: var(--ff-mincho);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--c-text);
  position: relative;
  padding: 8px 0;
  transition: color 0.3s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--c-accent);
  transition: width 0.3s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__cta {
  font-family: var(--ff-mincho);
  font-size: 13px;
  letter-spacing: 0.2em;
  padding: 12px 28px;
  background: var(--c-accent);
  color: #fff;
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.3s var(--ease);
}
.nav__cta:hover { background: var(--c-accent-hover); }

.burger {
  display: none;
  width: 28px; height: 18px;
  position: relative;
  cursor: pointer;
  background: transparent; border: 0;
}
.burger span {
  position: absolute; left: 0; right: 0;
  height: 1px; background: var(--c-text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 50%; }
.burger span:nth-child(3) { bottom: 0; }
.header.is-hero:not(.is-scrolled) .burger span { background: #fff; }
.header.is-hero:not(.is-scrolled) .burger.is-open span { background: var(--c-text); }
.burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav { display: none; position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 32px; background: var(--c-bg); overscroll-behavior: contain; }
  .nav.is-open { display: flex; }
  .header.is-hero .nav.is-open .nav__link { color: var(--c-text); }
  .burger { display: block; z-index: 110; }
  .nav__link { font-size: 20px; }
}

body.is-menu-open { position: fixed; inset: 0; overflow: hidden; width: 100%; }

/* Footer */
.footer {
  background: var(--c-bg-alt);
  color: var(--c-text);
  padding: 96px 0 40px;
  font-family: var(--ff-gothic);
  font-size: 13px;
  border-top: 1px solid var(--c-line);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--c-line);
}
.footer__brand .logo__mark { color: var(--c-text); }
.footer__brand .logo__sep { color: var(--c-text); }
.footer__brand .logo__sub { color: var(--c-text-sub); }
.footer__brand p {
  margin-top: 24px;
  font-size: 13px;
  line-height: 2;
  color: var(--c-text-sub);
}
.footer__ig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 28px;
  background: var(--c-bg);
  border: 1px solid var(--c-bg);
  border-radius: 50%;
  color: #64432D;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer__ig svg { width: 18px; height: 18px; }
.footer__ig:hover { background: var(--c-accent-sub); border-color: var(--c-accent-sub); }
.footer__col h4 {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--c-text);
  margin-bottom: 24px;
  font-weight: 500;
}
.footer__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__list a { color: var(--c-text-sub); transition: color 0.3s var(--ease); letter-spacing: 0.1em; }
.footer__list a:hover { color: var(--c-accent); }
.footer__list li { color: var(--c-text-sub); letter-spacing: 0.1em; }
.footer__bottom {
  padding-top: 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; letter-spacing: 0.15em;
  color: var(--c-text-sub);
}
@media (max-width: 768px) {
  .footer__top { grid-template-columns: 1fr; gap: 48px; }
  .footer__bottom { flex-direction: column; gap: 16px; align-items: flex-start; }
}

/* Page header (sub pages) */
.pagehead {
  padding: 200px 0 100px;
  background: var(--c-bg-alt);
  position: relative;
}
.pagehead__label {
  font-family: var(--ff-mincho);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--c-accent);
  margin-bottom: 16px;
}
.pagehead__title {
  font-family: var(--ff-mincho);
  font-size: clamp(30px, 5.6vw, 56px);
  letter-spacing: 0.1em;
  font-weight: 500;
  margin: 0;
}
.pagehead__lead {
  margin-top: 24px;
  font-size: 15px;
  line-height: 2;
  color: var(--c-text-sub);
  max-width: 560px;
}
@media (max-width: 768px) {
  .pagehead { padding: 140px 0 64px; }
  .pagehead__title { font-size: 36px; }
}
@media (max-width: 480px) {
  .pagehead__title { font-size: 30px; }
}

/* =========================================================
   モバイルの改行調整
   本文・リード文の強制改行（<br>）はPCの行長に合わせたもの。
   スマホでは解除して自然な折り返しに任せる。
   （見出し・住所・電話番号・署名の改行は維持）
   ========================================================= */
@media (max-width: 768px) {
  .hero__lead br,
  .pagehead__lead br,
  .heading__lead br,
  .about-grid__body p br,
  .concept-grid__body p br,
  .message-grid__body p br,
  .intro__body p br,
  .cta-section__body p br,
  .footer__brand p br,
  .contact-info > p br,
  .done p br { display: none; }
}

/* Placeholder image (subtle striped SVG with monospace label) */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, #E8DFD0 0px, #E8DFD0 2px, #DDD2BD 2px, #DDD2BD 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(43, 39, 34, 0.55);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(43,39,34,0.18);
  pointer-events: none;
}
.ph__label {
  background: rgba(248, 245, 240, 0.85);
  padding: 8px 16px;
  border: 1px solid rgba(43,39,34,0.12);
  z-index: 1;
}
.ph--dark {
  background:
    repeating-linear-gradient(135deg, #4A3F32 0px, #4A3F32 2px, #3D3328 2px, #3D3328 4px);
  color: rgba(255,255,255,0.65);
}
.ph--dark .ph__label { background: rgba(43,39,34,0.7); border-color: rgba(255,255,255,0.15); color: #EFE8DD; }

/* =========================================================
   Reveal on scroll — variants
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), clip-path 1.2s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  clip-path: inset(0 0 0 0);
}

/* Direction variants */
.reveal--up    { transform: translateY(32px); }
.reveal--down  { transform: translateY(-32px); }
.reveal--left  { transform: translateX(40px); }
.reveal--right { transform: translateX(-40px); }

/* Scale-in (subtle zoom) */
.reveal--zoom {
  transform: scale(0.94);
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease);
}

/* Image curtain reveal (clips from bottom up) */
.reveal--curtain {
  opacity: 1;
  clip-path: inset(0 0 100% 0);
  transform: none;
}
.reveal--curtain.is-visible { clip-path: inset(0 0 0 0); }

/* Curtain from left (for media columns) */
.reveal--curtain-l {
  opacity: 1;
  clip-path: inset(0 100% 0 0);
  transform: none;
}
.reveal--curtain-l.is-visible { clip-path: inset(0 0 0 0); }

/* Letter / line stagger for headings */
.reveal--text { overflow: hidden; }
.reveal--text > * {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease);
}
.reveal--text.is-visible > * { transform: translateY(0); }

/* Stagger delay utility (apply on parent, children pick up via :nth-child) */
.stagger > .reveal { transition-delay: 0s; }
.stagger > .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.18s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.31s; }
.stagger > .reveal:nth-child(4) { transition-delay: 0.44s; }
.stagger > .reveal:nth-child(5) { transition-delay: 0.57s; }

/* Slow draw line (for separators / underlines) */
.reveal--line {
  position: relative;
  opacity: 1;
  transform: none;
}
.reveal--line::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--c-accent);
  transition: width 1.4s var(--ease);
}
.reveal--line.is-visible::after { width: 64px; }

/* Parallax-ish drift for hero sub elements (scroll-driven if supported) */
@supports (animation-timeline: view()) {
  .drift {
    animation: drift-up linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }
  @keyframes drift-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal--curtain,
  .reveal--curtain-l,
  .reveal--text > *,
  .reveal--zoom {
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
  }
}

/* Smooth scroll (disabled by media query above for reduced-motion users) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* =========================================================
   Dark-walnut alt sections — readable (light) text on #64432D
   ========================================================= */
.footer,
.pagehead,
.service-section,
.flow-section,
.group-card,
section[style*="c-bg-alt"] {
  color: #F8F5F0;
  --c-text: #F8F5F0;
  --c-text-sub: rgba(248, 245, 240, 0.72);
  --c-line: rgba(248, 245, 240, 0.22);
  --c-accent: var(--c-accent-sub);
}

/* Labels / numbers keep a warm light accent */
.pagehead__label,
.service-section .heading__label,
.flow-section .heading__label,
.group-card__label,
section[style*="c-bg-alt"] .heading__label,
section[style*="c-bg-alt"] .value__num {
  color: var(--c-accent-sub);
}

/* White cards inside dark sections → restore dark text */
.service-section .service-card {
  color: var(--c-text-base, #2B2722);
  --c-text: #2B2722;
  --c-text-sub: #7A736B;
  --c-accent: var(--c-accent-real);
}
.service-section .service-card .service-card__title { color: #2B2722; }

/* Flow step circles readable on dark */
.flow-section .flow__num {
  background: var(--c-bg);
  border-color: var(--c-bg);
  color: var(--c-accent-real);
  font-weight: 700;
}

/* --- ページトップボタン（右下固定・全ページ共通） --- */
.scroll-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 100;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--c-accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(43,39,34,0.18);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.scroll-top.is-visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--c-accent-hover); transform: translateY(-2px); }
.scroll-top svg { width: 18px; height: 18px; stroke: #fff; }
@media (max-width: 640px) {
  .scroll-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}
