/* KAIKA Ltd. corporate site — shared stylesheet (canonical)
   Direction: /DESIGN_DIRECTION.md（精密レジスター・暖白×墨×朱・Shippori Mincho + IBM Plex Sans JP）
   Page <style> blocks may only contain page-specific rules; shared components live here. */

:root {
  --paper: #FBFAF7;
  --card: #FFFFFF;
  --washi: #F4F1EA;
  --ink: #20242E;
  --ink-soft: #5A5F6B;
  --line: #E4E1D8;
  --accent: #B23A2F;
  --accent-deep: #93291F;
  --navy: #1B2333;
  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --maxw: 800px;

  /* 旧トークン名の互換（段階的移行用） */
  --primary: #B23A2F;
  --text: #20242E;
  --bg: #FBFAF7;
  --background: #FBFAF7;
  --border: #E4E1D8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
}

:lang(en) body, body:lang(en) { line-height: 1.7; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

p, li { font-size: 15px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- トップバー（topbar型レイアウト） ---- */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar .logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav a {
  margin-left: 20px;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
}

.topbar nav a:hover { color: var(--accent); }

.topbar .lang a,
.lang-switch a {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
}

.topbar .lang a:hover,
.lang-switch a:hover { border-color: var(--accent); color: var(--accent); }

.lang-switch { text-align: right; margin-bottom: 20px; }

/* ---- 旧headerパターン互換 ---- */

header { background: var(--card); border-bottom: 1px solid var(--line); }

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

header .logo {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

header nav a { color: var(--ink-soft); font-size: 0.875rem; text-decoration: none; }
header nav a:hover { color: var(--accent); }

main { display: block; }

/* ---- ヒーロー（一行宣言・編集的な非対称FV） ---- */

.hero {
  background: var(--washi);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 88px 24px 76px;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 32px;
}

.hero-copy { max-width: 620px; }

/* 縦書きの社名アクセント（見出し級の見せ場は1箇所だけ） */
.hero-vertical {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--ink-soft);
  border-left: 1px solid #CFC9BA;
  padding-left: 16px;
  margin: 0;
  align-self: stretch;
  display: flex;
  align-items: flex-start;
}

.hero h1 {
  font-size: clamp(28px, 4.8vw, 44px);
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.hero p {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 0 32px;
}

/* 初回表示の静かな立ち上がり（1回だけ・reduced-motionで停止） */
.hero-copy > * { animation: hero-rise 560ms ease-out both; }
.hero-copy > *:nth-child(2) { animation-delay: 110ms; }
.hero-copy > *:nth-child(3) { animation-delay: 220ms; }
.hero-vertical { animation: hero-rise 560ms ease-out 320ms both; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .hero { padding: 56px 20px 48px; }
  .hero-vertical { display: none; }
}

.hero a {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: background-color 160ms ease-out;
}

.hero a:hover { background: var(--accent-deep); color: #fff; }

/* ---- コンテナとセクション ---- */

.container { max-width: var(--maxw); margin: 56px auto; padding: 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  margin-bottom: 24px;
}

h2 {
  font-size: 20px;
  margin: 0 0 16px;
}

.card h2::before,
.section-heading::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 10px;
  background: var(--accent);
}

ul { padding-left: 20px; }
li { margin-bottom: 8px; }

/* ---- 会社情報 ---- */

.info-grid { display: grid; font-size: 14px; }

.info-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child { border-bottom: 0; }

.info-label { width: 160px; font-weight: 700; color: var(--ink-soft); flex-shrink: 0; }

/* ---- 表組み（会社概要等） ---- */

table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }

th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

th { width: 160px; color: var(--ink-soft); font-weight: 700; background: var(--washi); font-family: var(--font-body); }

/* ---- サービスカード・CTA ---- */

.service-card {
  background: var(--washi);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.price-note { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

.cta,
.btn {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 160ms ease-out;
}

.cta:hover, .btn:hover { background: var(--accent-deep); color: #fff; }

.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--washi); color: var(--accent-deep); }

/* ---- コンテナ型ページの単柱レイアウト ---- */

.page { max-width: var(--maxw); margin: 40px auto; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }

.page h1,
.container h1 {
  font-size: 26px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

nav.page-nav a,
.page nav a { margin-right: 16px; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
nav.page-nav a:hover,
.page nav a:hover { color: var(--accent); }

.back-link { display: block; margin-top: 40px; font-size: 14px; }

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

.form-group { margin-bottom: 20px; }

label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }

label .required { color: var(--accent); font-size: 12px; margin-left: 6px; font-weight: 500; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D8D4CA;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

textarea { height: 160px; resize: vertical; }

.submit-btn {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.submit-btn:hover { background: var(--accent-deep); }
.submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.form-status { min-height: 24px; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.note { font-size: 13px; color: var(--ink-soft); margin-top: 24px; }

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

footer, .footer {
  margin-top: 56px;
  padding: 32px 20px;
  color: var(--ink-soft);
  background: transparent;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
}

.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-inner p { margin: 0.5rem 0; font-size: 0.75rem; }
.footer a, .footer-inner a, footer a { color: var(--ink-soft); text-decoration: none; margin: 0 10px; }
.footer a:hover, .footer-inner a:hover, footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---- ブログ ---- */

.page-header {
  background: var(--washi);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 56px 24px 48px;
  text-align: center;
}

.page-header h1 { font-size: clamp(24px, 3.5vw, 30px); font-weight: 700; margin: 0 0 12px; }
.page-header p { font-size: 14px; color: var(--ink-soft); max-width: 560px; margin: 0 auto; }

.article-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

@media (min-width: 640px) {
  .article-grid { grid-template-columns: 1fr 1fr; }
}

.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease-out;
}

.article-card:hover { border-color: var(--accent); }
.article-card:hover .article-readmore { color: var(--accent-deep); }

/* 明朝モノグラムのサムネイル（絵文字サムネイルの後継） */
.article-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(150deg, var(--navy) 0%, #2A3347 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-thumb::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 18px;
  height: 3px;
  background: var(--accent);
}

.thumb-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  color: #F1EEE5;
}

.article-thumb .thumb-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.article-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.article-title { font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 8px; line-height: 1.5; }
.article-excerpt { font-size: 13px; color: var(--ink-soft); margin: 0; flex: 1; }
.article-readmore { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 12px; }

/* ---- 記事本文 ---- */

article h1 { font-size: 28px; }
article h2 { font-size: 21px; margin-top: 40px; }
article h3 { font-size: 17px; margin-top: 28px; }

.article-container { max-width: 700px; margin: 0 auto; padding: 0 24px; }

.breadcrumb { font-size: 12px; color: var(--ink-soft); margin: 24px 0 0; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.article-tag {
  display: inline-block;
  background: var(--washi);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 20px 0 12px;
}

h1.article-title { font-size: 26px; font-weight: 700; line-height: 1.5; margin: 0 0 16px; }
.article-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 32px; }

.article-body h2 {
  font-size: 20px;
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.article-body h3 { font-size: 16px; margin-top: 28px; }
.article-body p { font-size: 15px; margin-bottom: 18px; }
.article-body ul, .article-body ol { font-size: 15px; padding-left: 22px; margin-bottom: 18px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--ink); }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 12px 20px;
  color: var(--ink-soft);
  font-size: 14px;
  background: var(--washi);
  border-radius: 0 6px 6px 0;
}

.faq-block { margin-top: 36px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 18px 22px; margin-bottom: 12px; }
.faq-q { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.faq-a { font-size: 14px; color: var(--ink-soft); margin: 0; }

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 22px;
  margin: 44px 0;
}

.author-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: #F1EEE5;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.author-name { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.author-role { font-size: 12px; color: var(--accent); margin: 0 0 8px; }
.author-desc { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.7; }

.cta-box {
  background: var(--navy);
  color: #F1EEE5;
  border-radius: 4px;
  padding: 32px 28px;
  text-align: center;
  margin: 44px 0;
}

.cta-box h3 { font-size: 18px; margin: 0 0 10px; color: #fff; }
.cta-box p { font-size: 14px; color: #C6CBD8; margin: 0 0 20px; }

.cta-box a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 32px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 160ms ease-out;
}

.cta-box a:hover { background: var(--accent-deep); }

/* ---- サンクス ---- */

.thanks-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--washi);
  color: var(--accent);
}

.thanks-icon svg { width: 32px; height: 32px; }

/* ---- レスポンシブ ---- */

@media (max-width: 600px) {
  header nav { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
  header nav ul { gap: 0.5rem 1rem; }
  .topbar { padding: 10px 16px; }
  .topbar nav a { margin-left: 12px; }
  .container { margin: 40px auto; }
  .card, .page { padding: 24px 20px; }
  .info-row { flex-direction: column; gap: 2px; }
  .info-label { width: auto; }
  .post-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .thumb-mark { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ---- 紙の粒子（手触りのレイヤー。ごく薄く） ---- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
}

/* ---- 節度あるスクロール出現（reveal.jsが付与。JSなしでは常時表示） ---- */

.reveal-pending {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 520ms ease-out, transform 520ms ease-out;
}

.reveal-pending.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-vertical { animation: none; }
  .reveal-pending { opacity: 1; transform: none; transition: none; }
}
