/* =============================================================
   株式会社BlackOak — デザインシステム
   Tailwind CDN を補完するカスタムスタイル。
   カラー・タイポグラフィ・コンポーネント・アニメーションを定義。
   ============================================================= */

:root {
  --color-charcoal: #232323;
  --color-oak: #A88543;
  --color-oak-deep: #93743A;
  --color-ivory: #F6F4EF;
  --color-navy: #233142;
  --color-forest: #2F463B;
  --ease-out-quiet: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------- ベース */

body {
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-oak);
  color: #fff;
}

/* キーボードフォーカスの可視化（WCAG 2.4.7） */
:focus-visible {
  outline: 2px solid var(--color-oak);
  outline-offset: 3px;
  border-radius: 2px;
}

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 20px;
  background: var(--color-charcoal);
  color: var(--color-ivory);
  font-size: 0.85rem;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* スクリーンリーダー専用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------- ヘッダー */

.site-header {
  background: rgba(35, 35, 35, 0.97);
  color: var(--color-ivory);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: rgba(246, 244, 239, 0.1);
}

.brand {
  color: var(--color-ivory);
}

.nav-link {
  position: relative;
  color: rgba(246, 244, 239, 0.78);
  padding-bottom: 4px;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-oak);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out-quiet);
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-ivory);
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* モバイルメニュー */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  padding: 10px;
}
.menu-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--color-ivory);
  transition: transform 0.3s var(--ease-out-quiet);
}
.menu-toggle[aria-expanded="true"] .menu-bar:first-child {
  transform: translateY(4.25px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-bar:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

.mobile-menu {
  background: var(--color-charcoal);
  border-top: 1px solid rgba(246, 244, 239, 0.08);
}
.mobile-link {
  display: block;
  padding: 14px 4px;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(246, 244, 239, 0.85);
  border-bottom: 1px solid rgba(246, 244, 239, 0.06);
}
.mobile-link:hover {
  color: var(--color-oak);
}

/* ---------------------------------------------------- ボタン */

.btn-cta {
  background: var(--color-oak);
  color: var(--color-charcoal);
  letter-spacing: 0.06em;
  transition: background-color 0.25s ease, transform 0.25s var(--ease-out-quiet);
}
.btn-cta:hover {
  background: var(--color-oak-deep);
  color: var(--color-ivory);
}
.btn-cta:active {
  transform: scale(0.98);
}
.btn-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  border: 1px solid rgba(246, 244, 239, 0.35);
  color: var(--color-ivory);
  letter-spacing: 0.06em;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.btn-ghost:hover {
  border-color: rgba(246, 244, 239, 0.9);
  background: rgba(246, 244, 239, 0.06);
}

.btn-ghost-dark {
  border: 1px solid rgba(35, 35, 35, 0.25);
  color: var(--color-charcoal);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.btn-ghost-dark:hover {
  border-color: rgba(35, 35, 35, 0.6);
  background: rgba(35, 35, 35, 0.04);
}

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

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-oak);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------- カード */

.card {
  border-radius: 12px;
  transition: transform 0.4s var(--ease-out-quiet), box-shadow 0.4s ease,
    border-color 0.4s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -16px rgba(35, 35, 35, 0.25);
}

.service-card:hover {
  border-color: rgba(168, 133, 67, 0.45);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--color-charcoal);
  color: var(--color-oak);
}

/* リスト項目のマーカー（ゴールドのダッシュ） */
.concept-item,
.service-point {
  position: relative;
  padding-left: 22px;
}
.concept-item::before,
.service-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 12px;
  height: 1.5px;
  background: var(--color-oak);
}

/* ---------------------------------------------------- 会社概要テーブル */

.company-table th,
.company-table td {
  padding: 22px 28px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(35, 35, 35, 0.07);
}
.company-table tr:last-child th,
.company-table tr:last-child td {
  border-bottom: none;
}
.company-table th {
  width: 200px;
  font-weight: 600;
  color: rgba(35, 35, 35, 0.65);
  background: rgba(246, 244, 239, 0.6);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .company-table th,
  .company-table td {
    display: block;
    width: 100%;
    padding: 14px 20px;
  }
  .company-table th {
    padding-bottom: 4px;
    background: transparent;
    border-bottom: none;
    font-size: 0.8rem;
  }
  .company-table td {
    padding-top: 0;
  }
}

/* ---------------------------------------------------- フィルタタブ */

.filter-tab {
  padding: 9px 22px;
  border: 1px solid rgba(35, 35, 35, 0.18);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(35, 35, 35, 0.7);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.filter-tab:hover {
  border-color: rgba(35, 35, 35, 0.45);
  color: var(--color-charcoal);
}
.filter-tab.is-active {
  background: var(--color-charcoal);
  border-color: var(--color-charcoal);
  color: var(--color-ivory);
}

/* ---------------------------------------------------- News */

.news-item a,
.news-item .news-row {
  display: grid;
  grid-template-columns: 110px 140px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 22px 8px;
  transition: background-color 0.25s ease;
}
.news-item a:hover {
  background: rgba(246, 244, 239, 0.8);
}
@media (max-width: 640px) {
  .news-item a,
  .news-item .news-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 4px;
  }
}

.news-date {
  font-family: Manrope, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(35, 35, 35, 0.55);
  letter-spacing: 0.05em;
}

.news-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border: 1px solid rgba(168, 133, 67, 0.5);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-oak-deep);
  white-space: nowrap;
  justify-self: start;
}

.news-title {
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ---------------------------------------------------- FAQ */

.faq-item {
  background: #fff;
  border: 1px solid rgba(35, 35, 35, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.faq-item:hover {
  border-color: rgba(168, 133, 67, 0.4);
}

.faq-trigger {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 22px 26px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;
  cursor: pointer;
}

.faq-q-mark {
  flex-shrink: 0;
  font-family: Manrope, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-oak);
}

.faq-q-text {
  flex: 1;
}

/* +/− アイコン（CSSのみ） */
.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--color-charcoal);
  transition: transform 0.35s var(--ease-out-quiet);
}
.faq-icon::after {
  transform: rotate(90deg);
}
.faq-trigger[aria-expanded="true"] .faq-icon::after {
  transform: rotate(0deg);
}

.faq-answer {
  padding: 0 26px 24px 58px;
}
.faq-answer p {
  font-size: 0.92rem;
  line-height: 1.9;
  color: rgba(35, 35, 35, 0.75);
  animation: faq-open 0.4s var(--ease-out-quiet);
}
@keyframes faq-open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------- フォーム */

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-required {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--color-oak);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: 1px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(35, 35, 35, 0.2);
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input::placeholder {
  color: rgba(35, 35, 35, 0.35);
}
.form-input:focus {
  outline: none;
  border-color: var(--color-oak);
  box-shadow: 0 0 0 3px rgba(168, 133, 67, 0.18);
}
.form-input.is-invalid {
  border-color: #b3392f;
  box-shadow: 0 0 0 3px rgba(179, 57, 47, 0.12);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23232323' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.form-error {
  margin-top: 7px;
  font-size: 0.8rem;
  color: #b3392f;
}

/* 送信スピナー */
.submit-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.submit-spinner::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(35, 35, 35, 0.25);
  border-top-color: var(--color-charcoal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.is-loading .submit-label {
  visibility: hidden;
}

/* ---------------------------------------------------- モーダル */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 35, 0.6);
  animation: fade-in 0.3s ease;
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border-radius: 12px;
  background: #fff;
  color: var(--color-charcoal);
  text-align: center;
  box-shadow: 0 24px 64px -24px rgba(35, 35, 35, 0.4);
  animation: modal-in 0.35s var(--ease-out-quiet);
}
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.modal-icon-success {
  background: rgba(47, 70, 59, 0.1);
  color: var(--color-forest);
}
.modal-icon-error {
  background: rgba(179, 57, 47, 0.1);
  color: #b3392f;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

body.modal-open {
  overflow: hidden;
}

/* ---------------------------------------------------- フッター */

.footer-link {
  transition: color 0.25s ease;
}
.footer-link:hover {
  color: var(--color-oak);
}

/* ---------------------------------------------------- スクロールリビール */

/* JS 有効時のみ非表示から開始（JS 無効環境でも内容が見える） */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out-quiet), transform 0.9s var(--ease-out-quiet);
  transition-delay: var(--delay, 0s);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------- Hero アニメーション */

.hero-art {
  pointer-events: none;
}

/* 年輪: 静かに描画される同心円（pathLength="1" 前提） */
.ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ring-draw 2.6s var(--ease-out-quiet) forwards;
}
.ring-2 { animation-delay: 0.15s; }
.ring-3 { animation-delay: 0.3s; }
.ring-4 { animation-delay: 0.45s; }
.ring-5 { animation-delay: 0.6s; }
.ring-6 { animation-delay: 0.75s; }

@keyframes ring-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* 木目の弧: ごくゆっくり流れる */
.ring-arc {
  stroke-dasharray: 0.35 0.65;
  animation: arc-flow 26s linear infinite;
}
.ring-arc-2 {
  animation-duration: 34s;
  animation-direction: reverse;
}
@keyframes arc-flow {
  to {
    stroke-dashoffset: -1;
  }
}

/* オーケストレーションのリズム */
.pulse {
  opacity: 0.25;
  animation: pulse-line 4.5s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
@keyframes pulse-line {
  to {
    opacity: 0.85;
  }
}

/* 静かに流れる光 */
.hero-beam {
  animation: beam-move 16s ease-in-out infinite;
}
@keyframes beam-move {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(1160px);
    opacity: 0;
  }
}

/* ---------------------------------------------------- モーション低減設定の尊重 */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
  }
  .ring {
    stroke-dashoffset: 0;
  }
  .pulse {
    opacity: 0.6;
  }
  .hero-beam {
    opacity: 0;
  }
}
