/* 16タイプの公開紹介と、既存結果画面で共有する読み物のレイアウト。 */
:root {
  /* 公開3ページ（タイプ一覧・タイプ紹介・この診断のこと）のコンテナ幅 */
  --page-maxw: 960px;
  /* 4グループのアクセント。明度と彩度をそろえ、色相だけを変える */
  --group-night-routine: oklch(0.82 0.085 75);
  --group-night-vary: oklch(0.82 0.085 345);
  --group-morning-routine: oklch(0.82 0.085 165);
  --group-morning-vary: oklch(0.82 0.085 255);
}
[data-group="night-routine"] { --group-accent: var(--group-night-routine); }
[data-group="night-vary"] { --group-accent: var(--group-night-vary); }
[data-group="morning-routine"] { --group-accent: var(--group-morning-routine); }
[data-group="morning-vary"] { --group-accent: var(--group-morning-vary); }

.type-site-header { --maxw: var(--page-maxw); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.type-brand { font-family: var(--font-serif); font-size: 20px; text-decoration: none; white-space: nowrap; }
.type-skip { position: absolute; left: 16px; top: -100px; z-index: 40; padding: 12px; background: var(--paper); color: var(--ink); }
.type-skip:focus { top: 12px; }
.types-main, .type-main, .about-main, .type-site-footer .wrap { --maxw: var(--page-maxw); }
.type-site-footer { padding-bottom: 48px; }
.type-footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 8px; }

/* 見出し・本文の左端と、eyebrow・h1 を3ページでそろえる */
.type-eyebrow { color: var(--amber-2); font-size: 13px; letter-spacing: .08em; line-height: 1.6; }
.types-intro h1, .about-intro h1, .type-detail-hero.is-public .result-type { margin: 12px 0 0; font-size: clamp(30px, 4vw, 40px); line-height: 1.5; }
body[data-page="about"] .text-link, body[data-page="types"] .text-link, body[data-page="type"] .text-link { padding-left: 0; }
.type-card h3, .type-card-line, .type-discover-cta p, .type-chapter-note, .type-neighbor-name, .types-intro p, .type-detail-hero .result-line, .about-comparison p, .about-section h2, .about-section h3 { word-break: auto-phrase; }
.type-prose p, .type-prose li, .about-intro p, .about-section p, .type-step-list p { line-break: strict; }
.type-card-line, .type-discover-cta p, .types-intro p { text-wrap: pretty; }

.types-main { padding-top: 56px; padding-bottom: 48px; }
.types-intro { max-width: 720px; margin: 0 auto; text-align: center; }
.types-intro p { margin-top: 20px; line-height: 1.9; }
.types-intro .btn { width: auto; min-width: min(100%, 280px); max-width: 100%; margin: 32px auto 0; }
.type-discover-cta { display: grid; justify-items: center; gap: 16px; margin: 40px auto; text-align: center; }
.type-discover-cta p { color: var(--paper-2); font-size: 14px; }
.type-discover-cta .note { color: var(--muted); font-size: 13px; }
.type-discover-cta .btn { width: auto; min-width: min(100%, 280px); max-width: 100%; }

.type-code-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 32px; margin: 64px 0 0; color: var(--paper-2); font-size: 13px; line-height: 1.8; }
.type-code-legend div { display: flex; gap: 4px; }
.type-code-legend dt { flex: none; color: var(--amber-2); letter-spacing: .12em; }
.type-code-legend dd { margin: 0; }
.type-group-nav { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: nowrap; gap: 8px; margin: 16px calc(var(--gutter) * -1) 0; padding: 12px var(--gutter); overflow-x: auto; background: var(--ink); scrollbar-width: none; }
.type-group-nav::-webkit-scrollbar { display: none; }
.type-group-nav a, .type-result-nav a { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 24px; text-decoration: none; font-size: 13px; }
.type-group-nav a { display: inline-flex; flex: none; align-items: center; gap: 8px; white-space: nowrap; background: var(--ink); }
.type-group-nav a::before, .type-group-heading h2::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--group-accent); }
.type-group { margin-top: 56px; scroll-margin-top: 80px; }
.type-group-heading { margin-bottom: 24px; }
.type-group-heading h2 { display: flex; align-items: center; gap: 12px; font-size: 24px; }
.type-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.type-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ink-2); box-shadow: inset 0 2px 0 var(--group-accent, transparent); text-decoration: none; transition: border-color .2s, transform .2s; }
.type-card-frame { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--ink-3); }
.type-card-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.type-card h3 { margin: 16px 0 8px; font-size: 17px; line-height: 1.6; }
.type-card-code { color: var(--group-accent, var(--amber-2)); font-size: 12px; letter-spacing: .18em; }
.type-card-line { margin: 16px 0 16px; color: var(--paper-2); font-size: 13px; line-height: 1.8; }
.type-card-more { margin-top: auto; align-self: flex-end; color: var(--amber-2); font-size: 16px; line-height: 1; }

.type-main, body.has-type-result .check-main { --maxw: 960px; }
.type-main { --maxw: var(--page-maxw); padding-top: 40px; padding-bottom: 48px; }
.type-detail-hero { max-width: 740px; margin: 0 auto; text-align: center; }
.type-detail-hero .type-scene { display: block; padding: 0; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.type-scene-image { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.type-detail-hero .result-kicker { margin-top: 32px; color: var(--muted); font-size: 14px; }
.type-detail-hero .result-type { margin: 12px 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.5; }
.type-detail-hero .result-code { margin-top: 8px; color: var(--amber-2); letter-spacing: .2em; }
.type-detail-hero .result-line { margin-top: 20px; line-height: 1.9; }
.type-axis-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 24px 0 0; list-style: none; }
.type-axis-tags li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--paper-2); font-size: 12px; }

/* 公開タイプ紹介のヒーロー。個人結果のヒーローは上の規則のまま */
.type-detail-hero.is-public { max-width: none; text-align: left; }
.type-detail-hero.is-public .type-hero-text { margin-top: 28px; }
.type-detail-hero.is-public .type-hero-text > * { text-align: left; }
.type-detail-hero.is-public .result-code { margin-top: 4px; }
.type-detail-hero.is-public .result-line { margin-top: 16px; }
.type-detail-hero.is-public .result-code { color: var(--group-accent, var(--amber-2)); }
.type-hero-group { margin-top: 16px; font-size: 13px; }
.type-hero-group a { display: inline-flex; align-items: center; gap: 8px; color: var(--paper-2); text-underline-offset: 4px; }
.type-hero-group a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--group-accent); }
.type-scale { display: grid; gap: 10px; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.type-scale { grid-template-columns: 7em max-content max-content max-content; justify-content: start; column-gap: 12px; }
.type-scale li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; font-size: 13px; line-height: 1.7; }
.type-scale-axis { color: var(--muted); font-size: 12px; }
.type-scale-poles { display: grid; grid-column: 2 / -1; grid-template-columns: subgrid; align-items: baseline; }
.type-scale-pole { color: var(--muted); font-weight: 400; opacity: .85; }
.type-scale-pole.is-active { color: var(--group-accent, var(--amber-2)); font-weight: 700; opacity: 1; }
.type-scale-letter { display: inline-block; min-width: 1.2em; margin-right: 4px; letter-spacing: .08em; }
.type-scale-sep { color: var(--muted); opacity: .6; }

.type-introduction { margin-top: 64px; scroll-margin-top: 100px; }
.type-common-note { padding: 20px 24px; margin-bottom: 32px; border-left: 2px solid var(--amber); background: var(--paper-sheen); color: var(--paper-2); font-size: 14px; line-height: 1.9; }
.type-reading-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 48px; align-items: start; }
.type-toc { position: sticky; top: 100px; display: grid; gap: 4px; }
body[data-page="type"] .type-toc { top: 24px; }
.type-toc-label { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.type-toc a { padding: 10px 12px; border-left: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.type-toc a[aria-current="true"] { color: var(--amber-2); border-left-color: var(--amber-2); font-weight: 700; }
.type-chapter { margin-bottom: 48px; scroll-margin-top: 100px; }
.type-prose > .type-chapter:last-child { margin-bottom: 0; }
.type-chapter h2 { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 23px; line-height: 1.7; }
.type-chapter p, .type-prose-list li { color: var(--paper-2); font-size: 15px; line-height: 2; }
.type-prose-list { padding: 0; }
.type-prose-list li { position: relative; padding: 12px 0 12px 20px; border-bottom: 1px solid var(--line); }
.type-prose-list li:first-child { padding-top: 0; }
.type-prose-list li::before { content: ""; position: absolute; left: 2px; top: 25px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-2); opacity: .7; }
.type-prose-list li:first-child::before { top: 13px; }
.type-step-list { padding: 0; margin: 24px 0 0; list-style: none; counter-reset: step; }
.type-step-list li { counter-increment: step; padding: 24px; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); }
.type-step-list h3 { margin-bottom: 12px; font-size: 16px; line-height: 1.8; }
.type-step-list h3::before { content: counter(step, decimal-leading-zero) " / "; color: var(--amber-2); font-family: var(--font-sans); }
.type-chapter .type-chapter-note { font-size: 13px; color: var(--muted); }
.type-reset { margin-top: 20px; }

.type-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.type-share .type-share-button { display: inline-flex; width: auto; min-width: 0; min-height: 40px; padding: 8px 16px; gap: 8px; font-size: 13px; }
.type-share .type-share-button[hidden] { display: none; }
.type-share-icon { flex: none; }
.type-share-status { color: var(--muted); font-size: 13px; line-height: 1.8; }
.type-share-url { flex: 1 1 100%; font-size: 13px; }

.type-neighbors { margin-top: 64px; }
.type-neighbors h2 { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 23px; line-height: 1.7; }
.type-neighbor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.type-neighbor { display: flex; align-items: center; gap: 16px; height: 100%; padding: 12px 16px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); box-shadow: inset 0 2px 0 var(--group-accent, transparent); text-decoration: none; transition: border-color .2s; }
.type-neighbor-image { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--ink-3); object-fit: contain; }
.type-neighbor-text { display: grid; gap: 2px; min-width: 0; }
.type-neighbor-name { font-family: var(--font-serif); font-size: 16px; line-height: 1.6; }
.type-neighbor-code { color: var(--group-accent, var(--amber-2)); font-size: 12px; letter-spacing: .18em; }
.type-neighbor-diff { color: var(--muted); font-size: 12px; line-height: 1.6; }
.type-other-link { margin-top: 32px; font-size: 14px; }

.type-result-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 32px 0; }
.my-type-result, .has-type-result .result-exit { max-width: 600px; margin-left: auto; margin-right: auto; }
.my-type-result { padding-top: 32px; scroll-margin-top: 100px; }
.my-type-result > h2 { text-align: center; font-size: 26px; }
.my-type-result > .type-personal-note { margin-top: 12px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.has-type-result .result-exit { margin-top: 40px; }
.type-pages-notice { margin-top: 32px; color: var(--muted); font-size: 13px; line-height: 1.9; }
@media (hover: hover) { .type-card:hover, .type-neighbor:hover { border-color: var(--amber-2); } .type-card:hover { transform: translateY(-3px); } .type-toc a:hover { color: var(--amber-2); border-color: var(--amber-2); } }
@media (min-width: 861px) {
  .type-detail-hero.is-public { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
  .type-detail-hero.is-public .type-hero-text { margin-top: 0; }
  .type-detail-hero.is-public .type-scene-image { aspect-ratio: 4 / 3; }
}
@media (max-width: 800px) {
  .type-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-reading-layout { grid-template-columns: 1fr; gap: 32px; }
  .type-toc { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .type-toc-label { width: 100%; }
  .type-toc a { padding: 10px 12px; border: 1px solid var(--line); border-radius: 20px; }
  .type-toc a[aria-current="true"] { border-color: var(--amber-2); }
  /* 公開タイプ紹介の目次は細い横帯にして、本文の途中からも章を移れるようにする */
  body[data-page="type"] .type-reading-layout { gap: 16px; }
  body[data-page="type"] .type-toc { position: sticky; top: 0; z-index: 10; flex-wrap: nowrap; gap: 8px; margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter); overflow-x: auto; background: var(--ink); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  body[data-page="type"] .type-toc::-webkit-scrollbar { display: none; }
  body[data-page="type"] .type-toc-label { display: none; }
  body[data-page="type"] .type-toc a { flex: none; padding: 8px 12px; white-space: nowrap; font-size: 12px; }
  body[data-page="type"] .type-chapter { scroll-margin-top: 72px; }
  .type-code-legend { grid-template-columns: 1fr; margin-top: 48px; }
  .type-neighbor-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .type-site-header { gap: 12px; } .type-brand { font-size: 17px; } .types-main { padding-top: 40px; } .type-card-grid { gap: 12px; } .type-card { padding: 12px; } .type-card h3 { font-size: 15px; } .type-card-line { font-size: 12px; } .type-group-heading h2 { font-size: 22px; } .type-common-note { padding: 16px; } .type-chapter h2, .type-neighbors h2 { font-size: 21px; } .type-step-list li { padding: 20px; } .type-chapter { margin-bottom: 40px; } .type-neighbors { margin-top: 48px; } .type-other-link { margin-top: 24px; } .type-main .type-discover-cta { margin: 32px auto 8px; } .type-scale { grid-template-columns: max-content max-content max-content; column-gap: 10px; row-gap: 12px; } .type-scale-axis, .type-scale-poles { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .type-card, .type-neighbor { transition: none; } .type-card:hover { transform: none; } }
