/* =============================================================================
   株式会社VIAIX コーポレートサイト - カスタムスタイル
   -----------------------------------------------------------------------------
   Tailwind CDN を補完するスタイル定義。
   - 8px グリッドに基づく余白設計
   - White / Gold / Gray のミニマルな配色
   - Hero ネットワークアニメーション
   - スクロールリビール / フォーム / モーダル / アコーディオン
============================================================================= */

:root {
  --gold-500: #B08D4C;
  --gold-600: #9A7A3F;
  --ink-900: #17181C;
  --ink-500: #55575F;
  --ink-400: #7A7C85;
  --ink-200: #D9DADE;
  --ink-100: #EDEEF0;
  --ink-50:  #F7F7F8;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* スムーススクロール（固定ヘッダー分のオフセットを確保） */
html {
  scroll-behavior: smooth;
}
section[id] {
  scroll-margin-top: 64px;
}

/* テキスト選択色 */
::selection {
  background: rgba(176, 141, 76, 0.2);
}

/* -----------------------------------------------------------------------------
   アクセシビリティ
----------------------------------------------------------------------------- */

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--ink-900);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
}

/* キーボードフォーカスの可視化 */
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   共通レイアウト
----------------------------------------------------------------------------- */

/* セクション余白（8px グリッド: モバイル 96px / デスクトップ 160px） */
.section-pad {
  padding-top: 96px;
  padding-bottom: 96px;
}
@media (min-width: 1024px) {
  .section-pad {
    padding-top: 160px;
    padding-bottom: 160px;
  }
}

/* セクション見出し */
.section-label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.section-title {
  margin-top: 16px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
@media (min-width: 1024px) {
  .section-title {
    font-size: 40px;
  }
}

/* -----------------------------------------------------------------------------
   Header
----------------------------------------------------------------------------- */

#site-header {
  background: transparent;
}
#site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--ink-100);
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500);
  transition: color 0.2s ease;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--gold-600);
}

/* ハンバーガーメニュー（3 本線を 1 スパンと擬似要素で描画） */
.menu-bar,
.menu-bar::before,
.menu-bar::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink-900);
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
  content: "";
}
.menu-bar {
  position: relative;
}
.menu-bar::before {
  position: absolute;
  top: -6px;
}
.menu-bar::after {
  position: absolute;
  top: 6px;
}
#menu-toggle[aria-expanded="true"] .menu-bar {
  background: transparent;
}
#menu-toggle[aria-expanded="true"] .menu-bar::before {
  transform: translateY(6px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] .menu-bar::after {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-link {
  display: block;
  padding: 12px 8px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-900);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-link:hover,
.mobile-link:focus-visible {
  background: var(--ink-50);
  color: var(--gold-600);
}

/* -----------------------------------------------------------------------------
   Hero
----------------------------------------------------------------------------- */

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* 右下から左上へ、ごく薄いグレーで奥行きを出す（過度なグラデーションは使わない） */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0.95) 100%);
}
.hero-network {
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

/* ノードの穏やかなパルス */
.net-nodes .node {
  fill: var(--ink-200);
  animation: node-pulse 5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.net-nodes .node-gold {
  fill: var(--gold-500);
}
.net-nodes .node:nth-child(2n) { animation-delay: 1.2s; }
.net-nodes .node:nth-child(3n) { animation-delay: 2.4s; }
.net-nodes .node:nth-child(5n) { animation-delay: 3.6s; }

@keyframes node-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.25); }
}

/* 接続ラインをゆっくり描画し続ける */
.net-lines path {
  stroke-dasharray: 6 10;
  animation: line-flow 30s linear infinite;
  opacity: 0.8;
}
@keyframes line-flow {
  to { stroke-dashoffset: -640; }
}

/* 浮遊する微粒子 */
.net-dust .dust {
  opacity: 0.35;
  animation: dust-float 14s ease-in-out infinite;
}
.dust-2 { animation-delay: 2s; }
.dust-3 { animation-delay: 4s; }
.dust-4 { animation-delay: 6s; }
.dust-5 { animation-delay: 8s; }
.dust-6 { animation-delay: 10s; }

@keyframes dust-float {
  0%, 100% { transform: translate(0, 0); opacity: 0.2; }
  50%      { transform: translate(16px, -24px); opacity: 0.5; }
}

/* Hero テキストのフェードイン（CLS を避けるため opacity + transform のみ） */
.hero-fade {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-fade-in 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--delay, 0) * 0.15s + 0.2s);
}
@keyframes hero-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

/* スクロールインジケーター */
.scroll-indicator {
  width: 1px;
  height: 48px;
  background: var(--ink-200);
  position: relative;
  overflow: hidden;
}
.scroll-indicator::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gold-500);
  animation: scroll-hint 2.4s var(--ease-out) infinite;
}
@keyframes scroll-hint {
  0%   { top: -100%; }
  60%  { top: 100%; }
  100% { top: 100%; }
}

/* -----------------------------------------------------------------------------
   スクロールリビール（IntersectionObserver で .is-visible を付与）
----------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  transition-delay: calc(var(--delay, 0) * 0.1s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  transition:
    transform 0.4s var(--ease-out),
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(176, 141, 76, 0.5);
  box-shadow: 0 8px 24px rgba(23, 24, 28, 0.06);
}
/* 上辺のゴールドライン */
.service-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ink-50);
  color: var(--gold-600);
  transition: background-color 0.4s ease, color 0.4s ease;
}
.service-card:hover .service-icon {
  background: var(--gold-500);
  color: #fff;
}

.service-arrow {
  position: absolute;
  top: 32px;
  right: 32px;
  color: var(--ink-200);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), color 0.3s ease;
}
.service-card:hover .service-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--gold-600);
}

/* -----------------------------------------------------------------------------
   Company テーブル
----------------------------------------------------------------------------- */

.company-table {
  border-top: 1px solid var(--ink-100);
}
.company-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--ink-100);
}
@media (min-width: 640px) {
  .company-row {
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding: 32px 16px;
  }
}
.company-row dt {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-400);
  padding-top: 2px;
}
.company-row dd {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-900);
}

/* -----------------------------------------------------------------------------
   フィルタータブ（News / FAQ 共通）
----------------------------------------------------------------------------- */

.filter-tab {
  padding: 8px 24px;
  border: 1px solid var(--ink-200);
  border-radius: 9999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  transition: all 0.25s ease;
}
.filter-tab:hover {
  border-color: var(--gold-500);
  color: var(--gold-600);
}
.filter-tab.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}

/* -----------------------------------------------------------------------------
   News リスト
----------------------------------------------------------------------------- */

.news-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--ink-200);
  transition: background-color 0.25s ease;
}
.news-item:hover {
  background: rgba(255, 255, 255, 0.8);
}
@media (min-width: 640px) {
  .news-item {
    grid-template-columns: 120px 160px 1fr;
    align-items: center;
    gap: 24px;
    padding: 28px 16px;
  }
}
.news-date {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-400);
  letter-spacing: 0.04em;
}
.news-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 16px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.news-category--notice {
  background: var(--ink-100);
  color: var(--ink-500);
}
.news-category--event {
  background: rgba(176, 141, 76, 0.12);
  color: var(--gold-700, #7E6333);
}
.news-title {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-900);
}

/* -----------------------------------------------------------------------------
   FAQ アコーディオン
----------------------------------------------------------------------------- */

.faq-item {
  border-bottom: 1px solid var(--ink-100);
}
.faq-item.is-hidden {
  display: none;
}

.faq-question {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 8px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-900);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.25s ease;
}
.faq-question:hover {
  color: var(--gold-600);
}
.faq-icon {
  flex-shrink: 0;
  color: var(--gold-500);
  transition: transform 0.3s var(--ease-out);
}
.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
}
.faq-answer p {
  padding: 0 8px 28px;
  font-size: 14px;
  line-height: 2;
  color: var(--ink-500);
  max-width: 56rem;
}

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

.form-field {
  display: flex;
  flex-direction: column;
}
.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.form-label .req {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gold-500);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.form-input {
  margin-top: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: var(--ink-900);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input::placeholder {
  color: #A7A9B0;
}
.form-input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(176, 141, 76, 0.15);
}
.form-input.is-invalid {
  border-color: #DC2626;
}
.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.form-error {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #DC2626;
}

/* 送信ボタンのローディングスピナー */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 24, 28, 0.55);
  animation: overlay-in 0.25s ease forwards;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-panel {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: #fff;
  border-radius: 12px;
  animation: panel-in 0.35s var(--ease-out) forwards;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.modal-close:hover {
  border-color: var(--gold-500);
  color: var(--gold-600);
}

/* -----------------------------------------------------------------------------
   Footer
----------------------------------------------------------------------------- */

.footer-link {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.25s ease;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: #fff;
}

/* -----------------------------------------------------------------------------
   モーション低減設定への配慮（WCAG 2.1 / prefers-reduced-motion）
----------------------------------------------------------------------------- */

@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;
  }
  .reveal,
  .hero-fade {
    opacity: 1;
    transform: none;
  }
}
