/* =========================================================
   いち — 個人サイト
   デザイントークン → ベース → レイアウト → コンポーネント
   ========================================================= */

/* ---------- 1. デザイントークン ---------- */
:root {
  /* 色：白ベース＋濃いグレー＋アクセント1色 */
  --bg:            #ffffff;
  --bg-subtle:     #f7f8fa;
  --text:          #1a1d21;
  --text-muted:    #5c636e;
  --border:        #e3e6ea;
  --accent:        #3b5bdb;
  --accent-hover:  #2f49b0;
  --accent-subtle: #eef2ff;

  /* 余白（8pxベース） */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;

  /* 文字 */
  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans",
          "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.375rem;
  --fs-2xl:  1.75rem;
  --fs-3xl:  2.25rem;
  --lh-body: 1.9;
  --lh-tight: 1.4;

  /* その他 */
  --radius: 10px;
  --measure: 42rem;   /* 本文の最大幅 */
  --wide:    64rem;   /* コンテナ最大幅 */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #14161a;
    --bg-subtle:     #1c1f25;
    --text:          #e8eaed;
    --text-muted:    #a0a7b4;
    --border:        #2b2f37;
    --accent:        #8ba4ff;
    --accent-hover:  #a8bcff;
    --accent-subtle: #1e2436;
  }
}

:root[data-theme="dark"] {
  --bg:            #14161a;
  --bg-subtle:     #1c1f25;
  --text:          #e8eaed;
  --text-muted:    #a0a7b4;
  --border:        #2b2f37;
  --accent:        #8ba4ff;
  --accent-hover:  #a8bcff;
  --accent-subtle: #1e2436;
}

/* ---------- 2. ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

p { margin: 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent-hover); }

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

/* キーボード操作の可視化 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

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

/* 本文へスキップ */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  background: var(--accent); color: #fff;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius);
  text-decoration: none; z-index: 100;
  transition: top .15s;
}
.skip-link:focus { top: var(--sp-4); color: #fff; }

/* ---------- 3. レイアウト ---------- */
.container {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.section { padding-block: var(--sp-16); }
.section + .section { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}

.section-title {
  font-size: var(--fs-xl);
  letter-spacing: 0.02em;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 3px; height: 0.9em;
  background: var(--accent);
  margin-right: var(--sp-3);
  vertical-align: -0.08em;
  border-radius: 2px;
}

/* ---------- 4. ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 60px;
}

.brand {
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.brand:hover { color: var(--accent); }

.nav ul {
  display: flex;
  gap: var(--sp-6);
  list-style: none;
  margin: 0; padding: 0;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  padding-block: var(--sp-2);
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--accent); }

@media (max-width: 40rem) {
  .nav ul { gap: var(--sp-4); }
  .nav a { font-size: 0.8125rem; }
}

/* ---------- 5. ヒーロー ---------- */
.hero { padding-block: var(--sp-16) var(--sp-12); }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  align-items: center;
}

@media (min-width: 48rem) {
  .hero-inner {
    grid-template-columns: 1fr minmax(0, 15rem);
    gap: var(--sp-12);
  }
  .hero { padding-block: var(--sp-24) var(--sp-16); }
}

.hero-photo {
  width: 100%;
  max-width: 15rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.hero-eyebrow {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.hero-title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-6);
}
@media (min-width: 48rem) {
  .hero-title { font-size: 2.75rem; }
}

.hero-title .accent { color: var(--accent); }

.hero-lead {
  color: var(--text-muted);
  max-width: var(--measure);
  margin-bottom: var(--sp-8);
}

/* ---------- 6. 「いまやっていること」 ---------- */
.now-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: var(--sp-6);
}
@media (min-width: 48rem) {
  .now-list { grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
}

.now-list dt {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-2);
}
.now-list dd {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------- 7. カード ---------- */
.card-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 60rem) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.card-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.card:hover .card-title { color: var(--accent); }

.card-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.8;
}

/* ---------- 8. 引用（価値観の一言） ---------- */
.pull-quote {
  margin: 0;
  padding: var(--sp-8);
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.pull-quote p {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.7;
}
.pull-quote footer {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---------- 9. ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--accent-subtle); color: var(--accent); }

.link-more {
  font-size: var(--fs-sm);
  text-decoration: none;
  white-space: nowrap;
}
.link-more:hover { text-decoration: underline; }

/* ---------- 10. フッター ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-12);
  margin-top: var(--sp-16);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  gap: var(--sp-6);
  list-style: none;
  margin: 0; padding: 0;
}

/* ---------- 11. スクロール時のフェードイン ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover { transform: none; }
}

/* =========================================================
   フェーズ2で追加したコンポーネント
   ========================================================= */

/* ---------- 12. 本文（About・記事） ---------- */
.prose {
  max-width: var(--measure);
}
.prose > * + * { margin-top: var(--sp-6); }

.prose h2 {
  font-size: var(--fs-xl);
  margin-top: var(--sp-12);
  padding-top: var(--sp-2);
}
.prose h3 {
  font-size: var(--fs-lg);
  margin-top: var(--sp-8);
}
.prose p { color: var(--text); }
.prose ul, .prose ol {
  padding-left: 1.4em;
  color: var(--text);
}
.prose li + li { margin-top: var(--sp-2); }

.prose blockquote {
  margin: 0;
  padding: var(--sp-4) var(--sp-6);
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p { color: inherit; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--sp-12);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

/* ---------- 13. 経歴タイムライン ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--sp-6);
  border-left: 2px solid var(--border);
  max-width: var(--measure);
}
.timeline li {
  position: relative;
  padding-bottom: var(--sp-8);
}
.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-6) - 6px);
  top: 0.65em;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline .year {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.timeline .event {
  display: block;
  font-weight: 700;
  margin-top: var(--sp-1);
}
.timeline .detail {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-1);
}

/* ---------- 14. 価値観リスト ---------- */
.values {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: var(--sp-4);
}
@media (min-width: 44rem) {
  .values { grid-template-columns: repeat(2, 1fr); }
}
.values li {
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.values strong {
  display: block;
  margin-bottom: var(--sp-2);
}
.values span {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------- 15. Works の各項目 ---------- */
.work {
  padding-block: var(--sp-12);
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.work:first-of-type { border-top: 0; padding-top: var(--sp-8); }

.work-head { margin-bottom: var(--sp-6); }
.work-title {
  font-size: var(--fs-2xl);
  margin-top: var(--sp-2);
}
.work-body { max-width: var(--measure); }
.work-body > * + * { margin-top: var(--sp-4); }
.work-body ul { padding-left: 1.4em; color: var(--text-muted); font-size: var(--fs-sm); }

.work-links {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

.status {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.status--live {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ---------- 16. ブログのカテゴリ絞り込み ---------- */
.filters {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}
.filter-btn {
  font: inherit;
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-list { display: grid; gap: var(--sp-4); }
.post-list li { list-style: none; }
.post-list[hidden] { display: none; }
.empty-msg { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- 17. 記事ページ ---------- */
.article-header {
  padding-block: var(--sp-16) var(--sp-8);
  border-bottom: 1px solid var(--border);
}
.article-title {
  font-size: var(--fs-2xl);
  margin-block: var(--sp-3);
  max-width: var(--measure);
}
@media (min-width: 48rem) {
  .article-title { font-size: var(--fs-3xl); }
}
.article-body { padding-block: var(--sp-12); }

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-12);
  max-width: var(--measure);
}

/* ---------- 18. Contact ---------- */
.form-embed {
  width: 100%;
  min-height: 800px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
@media (max-width: 40rem) {
  .form-embed { min-height: 900px; }
}
.form-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text-muted);
  max-width: var(--measure);
}

.social {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.social a {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.social a:hover { border-color: var(--accent); }

/* ---------- 19. 404 ---------- */
.error-page {
  min-height: 55vh;
  display: grid;
  place-items: center;
  text-align: center;
}

/* ---------- 20. 動画の埋め込み ---------- */
.video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  display: block;
}

.video-item + .video-item { margin-top: var(--sp-8); }

.video-caption {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.video-caption strong { color: var(--text); }
