/* ============================================================
   base.css — CSS変数・リセット・タイポ・ダークテーマ・共通ヘッダー
   ============================================================ */

:root {
  /* --- color (dark base) --- */
  --bg:        #0a0a0b;
  --bg-elev:   #141416;
  --bg-elev-2: #1c1c1f;
  --line:      #2a2a2e;
  --fg:        #eDEDED;
  --fg-dim:    #9a9a9f;
  --fg-faint:  #5f5f66;
  --accent:    #d94a3a; /* アー写のオレンジ/レッドの燃えるような差し色 */
  --accent-2:  #6b4ea0;

  /* --- type --- */
  --font-jp: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic",
             "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  --font-en: "Helvetica Neue", "Inter", "Arial", sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;

  /* --- layout --- */
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 64px;
}

/* Google Fonts を使いたい場合は各HTMLの<head>に
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400&family=Noto+Sans+JP:wght@300;400&display=swap" rel="stylesheet">
   を足し、--font-jp / --font-en の先頭に "Noto Sans JP" / "Inter" を差す。 */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-jp);
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

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

.en { font-family: var(--font-en); }
.mono { font-family: var(--font-mono); }

/* ---------- layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.page {
  padding-top: calc(var(--header-h) + clamp(40px, 8vw, 96px));
  padding-bottom: clamp(80px, 14vw, 160px);
}

.section-label {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 clamp(24px, 5vw, 48px);
}

/* ============================================================
   共通ヘッダー（nav.js が注入）
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.08em;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}
@media (max-width: 680px) {
  .brand { font-size: 12px; letter-spacing: 0.04em; max-width: 68vw; }
}
.brand:hover { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
}
.nav a {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color .2s ease;
  position: relative;
  padding: 6px 0;
}
.nav a:hover { color: var(--fg); }
.nav a.is-active { color: var(--fg); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
  cursor: pointer;
  user-select: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  transition: border-color .2s, color .2s;
}
.lang-toggle:hover { color: var(--fg); border-color: var(--fg-faint); }
.lang-toggle .on { color: var(--fg); }

/* mobile nav */
.nav-toggle { display: none; }
@media (max-width: 680px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { font-size: 14px; padding: 14px 0; width: 100%; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: 0; color: var(--fg);
    font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1;
  }
  .site-header .wrap { gap: 12px; }
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--fg-faint);
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.site-footer .wrap {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* 動画埋め込み（本文中のYouTube/Vimeo） */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 1.6em 0;
  border: 1px solid var(--line);
  background: #000;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* utility */
[hidden] { display: none !important; }
.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;
}
