/* TPS (Tomokore Persona System) — shared design system for the Phase 1 public site.
   Loaded by every page under /docs/tps/. Keep this the single source of visual
   truth; do not fork per-page copies of these tokens.

   Palette/typography deliberately mirror the Tomokore Web hub (index.html,
   docs/index.html): a bright, cheerful warm-cream-and-orange look (not a
   blue/aqua "ocean" palette) rather than the old deep-ocean-navy brand, plus
   the Hiragino/Yu Gothic + Yu Mincho font stacks already used elsewhere on
   this domain, so TPS reads as part of the same product rather than a
   separate "report" site. */

:root {
  --bg: #fdfaf5;
  --bg-deep: #faf2e6;
  --bg-deepest: #f5e8d4;
  --surface: #ffffff;
  --surface-2: #fff7ec;
  --text: #2b2620;
  --text-muted: #8a7f6f;
  --border: #ecdfc9;
  --accent: #e2650a;
  --accent-ink: #ffffff;
  --accent-soft: #fdece0;
  --gold: #ffb648;

  --fam-hearth: #c1502f;    --fam-hearth-bg: #f7e2d8;
  --fam-trailblazer: #d1962a; --fam-trailblazer-bg: #fbeed7;
  --fam-bloom: #d1477a;     --fam-bloom-bg: #fbe3ec;
  --fam-breeze: #7c6fcf;    --fam-breeze-bg: #ece9fb;

  --font-display: "游明朝", "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif;
  --font-body: "Hiragino Kaku Gothic Pro", "Hiragino Sans", "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック", Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(43,38,32,0.05), 0 10px 28px -12px rgba(43,38,32,0.16);
}

/* dark-mode override, offered for accessibility/OS preference — a dark
   roast-coffee-and-orange look that keeps the same warm, non-ocean brand
   identity as the light theme above, just inverted for low-light viewing. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a120b; --bg-deep: #241a10; --bg-deepest: #2e2214;
    --surface: rgba(255,255,255,0.045); --surface-2: rgba(255,255,255,0.08);
    --text: #f5e9d8; --text-muted: #c9a98a; --border: rgba(255,180,100,0.18);
    --accent: #ffab5e; --accent-ink: #2b1400; --accent-soft: rgba(255,145,66,0.14);
    --fam-hearth: #e2795a;    --fam-hearth-bg: rgba(226,121,90,0.14);
    --fam-trailblazer: #e8b752; --fam-trailblazer-bg: rgba(232,183,82,0.14);
    --fam-bloom: #e8709e;     --fam-bloom-bg: rgba(232,112,158,0.14);
    --fam-breeze: #a89ae8;    --fam-breeze-bg: rgba(168,154,232,0.14);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 28px -12px rgba(0,0,0,0.55);
  }
}
:root[data-theme="dark"] {
  --bg: #1a120b; --bg-deep: #241a10; --bg-deepest: #2e2214;
  --surface: rgba(255,255,255,0.045); --surface-2: rgba(255,255,255,0.08);
  --text: #f5e9d8; --text-muted: #c9a98a; --border: rgba(255,180,100,0.18);
  --accent: #ffab5e; --accent-ink: #2b1400; --accent-soft: rgba(255,145,66,0.14);
  --fam-hearth: #e2795a;    --fam-hearth-bg: rgba(226,121,90,0.14);
  --fam-trailblazer: #e8b752; --fam-trailblazer-bg: rgba(232,183,82,0.14);
  --fam-bloom: #e8709e;     --fam-bloom-bg: rgba(232,112,158,0.14);
  --fam-breeze: #a89ae8;    --fam-breeze-bg: rgba(168,154,232,0.14);
}
:root[data-theme="light"] {
  --bg: #fdfaf5; --bg-deep: #faf2e6; --bg-deepest: #f5e8d4;
  --surface: #ffffff; --surface-2: #fff7ec;
  --text: #2b2620; --text-muted: #8a7f6f; --border: #ecdfc9;
  --accent: #e2650a; --accent-ink: #ffffff; --accent-soft: #fdece0;
  --fam-hearth: #c1502f;    --fam-hearth-bg: #f7e2d8;
  --fam-trailblazer: #d1962a; --fam-trailblazer-bg: #fbeed7;
  --fam-bloom: #d1477a;     --fam-bloom-bg: #fbe3ec;
  --fam-breeze: #7c6fcf;    --fam-breeze-bg: #ece9fb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .bubble { display: none !important; }
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; line-height: 1.35; }
p { text-wrap: pretty; }

.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;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 1000;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 700; transition: top 0.15s;
}
.skip-link:focus { top: 0.5rem; }

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

/* ── ambient ocean decoration (bubbles) ─────────────────────── */
.ocean-fx {
  position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
}
.ocean-fx .bubble {
  position: absolute; bottom: -60px; border-radius: 50%;
  background: rgba(226,101,10,0.12);
  animation: tps-rise 13s linear infinite;
}
@media (prefers-color-scheme: dark) { .ocean-fx .bubble { background: rgba(255,171,94,0.12); } }
:root[data-theme="dark"] .ocean-fx .bubble { background: rgba(255,171,94,0.12); }
@keyframes tps-rise { to { transform: translateY(-130%); opacity: 0; } }
.ocean-fx .b1 { left: 8%;  width: 34px; height: 34px; animation-delay: 0s; }
.ocean-fx .b2 { left: 22%; width: 18px; height: 18px; animation-delay: 2.4s; }
.ocean-fx .b3 { left: 38%; width: 46px; height: 46px; animation-delay: 4.8s; }
.ocean-fx .b4 { left: 55%; width: 22px; height: 22px; animation-delay: 1.2s; }
.ocean-fx .b5 { left: 70%; width: 30px; height: 30px; animation-delay: 6s; }
.ocean-fx .b6 { left: 84%; width: 16px; height: 16px; animation-delay: 3.6s; }
.ocean-fx .b7 { left: 92%; width: 40px; height: 40px; animation-delay: 7.2s; }

/* ── header / nav ───────────────────────────────────────────── */
.tps-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,250,245,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) { .tps-header { background: rgba(26,18,11,0.85); } }
:root[data-theme="dark"] .tps-header { background: rgba(26,18,11,0.85); }
.tps-header-inner {
  max-width: 68rem; margin: 0 auto; padding: 0.8rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.tps-brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.tps-brand .mark { font-size: 1.3rem; }
.tps-nav { display: flex; gap: 0.3rem; align-items: center; }
.tps-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 0.86rem; font-weight: 600;
  padding: 0.45rem 0.8rem; border-radius: 999px;
}
.tps-nav a:hover, .tps-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.tps-nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 1.1rem; padding: 0.35rem 0.6rem; cursor: pointer;
}
@media (max-width: 720px) {
  .tps-nav { position: fixed; inset: 3.2rem 0.8rem auto 0.8rem; background: var(--bg-deep);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    flex-direction: column; align-items: stretch; padding: 0.6rem; gap: 0.15rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform 0.15s, opacity 0.15s; }
  .tps-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .tps-nav a { text-align: center; }
  .tps-nav-toggle { display: inline-block; }
}

/* ── footer ─────────────────────────────────────────────────── */
.tps-footer {
  border-top: 1px solid var(--border); margin-top: 3rem;
  padding: 2rem 1.2rem 3rem; color: var(--text-muted); font-size: 0.82rem;
  text-align: center;
}
.tps-footer a { color: var(--text-muted); text-decoration: underline; }
.tps-footer nav { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 0.6rem; }

/* ── layout helpers ─────────────────────────────────────────── */
.tps-wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.2rem; }
.tps-wrap-narrow { max-width: 44rem; margin: 0 auto; padding: 0 1.2rem; }
.tps-section { padding: 3rem 0; }
.tps-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.tps-lede { color: var(--text-muted); max-width: 42rem; }

/* ── hero ───────────────────────────────────────────────────── */
.tps-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 55%, var(--bg-deepest) 100%);
  padding: 4.5rem 1.2rem 3.5rem; text-align: center;
}
.tps-hero-inner { position: relative; z-index: 1; max-width: 46rem; margin: 0 auto; }
.tps-hero .tps-eyebrow { display: inline-block; margin-bottom: 0.8rem; }
.tps-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 1.1rem; }
.tps-hero .hero-copy { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-muted); margin: 0 0 2rem; }
.tps-hero .hero-example { font-family: var(--font-display); font-size: clamp(1rem, 2.2vw, 1.2rem); margin: 0 0 2.2rem; }
.tps-hero .hero-example .t-a { color: var(--accent); font-weight: 700; }
.tps-hero .hero-example .t-b { color: var(--gold); font-weight: 700; }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4em; font-weight: 700; font-size: 0.95rem;
  padding: 0.75rem 1.5rem; border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }

/* ── generic section-head ──────────────────────────────────── */
.section-head { max-width: 42rem; margin: 0 auto 2rem; text-align: center; }
.section-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0.3rem 0 0.6rem; }

/* ── family badge ───────────────────────────────────────────── */
.fam-badge { display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.74rem; font-weight: 700; padding: 0.2em 0.7em; border-radius: 999px; white-space: nowrap; }
.fam-badge.hearth { background: var(--fam-hearth-bg); color: var(--fam-hearth); }
.fam-badge.trailblazer { background: var(--fam-trailblazer-bg); color: var(--fam-trailblazer); }
.fam-badge.bloom { background: var(--fam-bloom-bg); color: var(--fam-bloom); }
.fam-badge.breeze { background: var(--fam-breeze-bg); color: var(--fam-breeze); }

/* ── type card grid ─────────────────────────────────────────── */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.type-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 5px; border-left-style: solid;
  border-left-color: var(--accent);
  border-radius: var(--radius); padding: 1.3rem 1.3rem 1.1rem; text-decoration: none; color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.type-card:hover, .type-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); background: var(--surface-2); }
/* legacy family-color modifiers, kept only for any old cached markup */
.type-card.hearth { border-left-color: var(--fam-hearth); }
.type-card.trailblazer { border-left-color: var(--fam-trailblazer); }
.type-card.bloom { border-left-color: var(--fam-bloom); }
.type-card.breeze { border-left-color: var(--fam-breeze); }
.type-card .sym { font-size: 1.9rem; }
.type-card .code {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 0.15em 0.6em;
  align-self: flex-start;
}
.type-card h3 { font-size: 1.15rem; margin: 0.15rem 0 0; }
.type-card .title-ja { color: var(--text-muted); font-size: 0.86rem; margin: 0; }
.type-card .one-liner { font-size: 0.85rem; margin: 0.3rem 0 0; flex: 1; }
.type-card .more { font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-top: 0.4rem; }

/* family filter bar */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.filter-chip {
  font-size: 0.82rem; font-weight: 600; padding: 0.45rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.filter-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ── family intro cards ─────────────────────────────────────── */
.family-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; margin-bottom: 1.2rem; background: var(--surface); }
.family-block .fam-name { font-family: var(--font-display); font-size: 1.4rem; margin: 0.5rem 0 0.3rem; }
.family-block .fam-worldview { color: var(--text-muted); max-width: 40rem; }
.family-block .fam-members { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.family-block .fam-members a {
  display: flex; align-items: center; gap: 0.35em; text-decoration: none; color: var(--text);
  background: var(--surface-2); border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 600;
}

/* ── detail-page content blocks ─────────────────────────────── */
.type-hero { position: relative; text-align: center; padding: 3rem 1.2rem 2.5rem; overflow: hidden; }
.type-hero > * { position: relative; z-index: 1; }
.type-hero .sym-big { font-size: 3.4rem; }
.type-hero .kicker { color: var(--text-muted); font-size: 0.9rem; margin: 0.6rem 0 0.2rem; }
.type-hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0.1rem 0 0.15rem; }
.type-hero .formal-tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--text-muted);
  margin: 0 0 0.7rem; text-transform: none;
}
.type-hero .title-ja { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 1rem; }
.type-hero .quote { font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 2.5vw, 1.3rem); max-width: 34rem; margin: 0 auto; }

.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.4rem; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.info-card h3 { font-size: 1rem; margin: 0 0 0.7rem; display: flex; align-items: center; gap: 0.4em; }
.info-card ul { margin: 0; padding-left: 1.2rem; }
.info-card li { margin: 0.3rem 0; font-size: 0.92rem; }
.info-card dl { margin: 0; }
.info-card dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-top: 0.8rem; }
.info-card dt:first-child { margin-top: 0; }
.info-card dd { margin: 0.2rem 0 0; font-size: 0.92rem; }

/* compatibility card */
.compat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1rem; }
.compat-card .compat-title { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 0.8rem; }
.compat-card h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 0.9rem 0 0.3rem; }
.compat-card h4:first-of-type { margin-top: 0; }
.compat-note { color: var(--text-muted); font-size: 0.85rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; }

/* details/summary (詳しい仕組み) */
.tps-details { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.2rem 1.2rem; margin-top: 1rem; background: var(--surface); }
.tps-details summary { cursor: pointer; padding: 0.9rem 0; font-weight: 700; font-size: 0.92rem; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.tps-details summary::-webkit-details-marker { display: none; }
.tps-details summary::after { content: "+"; font-size: 1.2rem; color: var(--text-muted); }
.tps-details[open] summary::after { content: "−"; }
.tps-details .details-body { padding: 0 0 1.2rem; font-size: 0.88rem; color: var(--text-muted); }
.axis-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.axis-mini .pole { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; font-size: 0.82rem; }
.axis-mini .pole b { color: var(--text); }

/* related types nav */
.related-types { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── share card ─────────────────────────────────────────────── */
.share-card {
  width: min(22rem, 100%); margin: 0 auto; border-radius: 20px; padding: 1.6rem 1.6rem 1.3rem;
  border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
  background: var(--surface);
}
.share-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0.55;
  background: linear-gradient(160deg, var(--fam-bg, var(--accent-soft)) 0%, transparent 65%);
}
.share-card > * { position: relative; z-index: 1; }
.share-card .sc-top { display: flex; align-items: center; justify-content: space-between; }
.share-card .sc-logo { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; }
.share-card .sc-sym { font-size: 2.4rem; margin-top: 0.6rem; }
.share-card .sc-name { font-family: var(--font-display); font-size: 1.6rem; margin: 0.4rem 0 0; }
.share-card .sc-formal { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); margin: 0 0 0.4rem; }
.share-card .sc-title { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.6rem; }
.share-card .sc-quote { font-family: var(--font-display); font-style: italic; font-size: 0.95rem; margin: 0 0 1rem; }
.share-card hr { border: none; border-top: 1px dashed var(--border); margin: 0.9rem 0; }
.share-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.share-card li { font-size: 0.85rem; }
.share-card li::before { content: "✔ "; color: var(--accent); font-weight: 700; }
.share-card .sc-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 0.9rem; }

/* ── misc ───────────────────────────────────────────────────── */
.callout { border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.4rem 0; border: 1px solid var(--border); background: var(--surface); border-left: 4px solid var(--accent); }
.type-select {
  font-size: 0.85rem; padding: 0.5rem 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit;
}
.type-select option { color: #2b2620; }

@media (max-width: 560px) {
  .tps-section { padding: 2.2rem 0; }
  .tps-hero { padding: 3.2rem 1rem 2.4rem; }
  .type-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
}
