:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f3ede3;
  --text: #1c1917;
  --muted: #57534e;
  --primary: #c83e4d;
  --primary-dark: #a42d3b;
  --accent: #2d4a7c;
  --border: #e2d9cb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 25, 23, 0.08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-dark);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--text);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.prose-container {
  max-width: 820px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.brand-seal {
  display: block;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(159, 43, 58, 0.28);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--text);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: -0.015em;
}

h1 {
  font-size: 38px;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

/* Hero & Above-the-fold Quiz Stage */
.hero-band {
  padding: 24px 0 40px;
}

.hero-header {
  max-width: 780px;
  margin-bottom: 20px;
}

.hero-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  max-width: 66ch;
}

.meta-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pills li {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.quiz-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px 28px;
}

/* Engagement Bar */
.engage-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.engage-left,
.engage-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.share-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.btn-engage,
.btn-share {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-engage:hover,
.btn-share:hover {
  border-color: var(--primary);
  background: var(--surface-alt);
}

.btn-engage[data-gf-liked] {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.engage-count {
  font-variant-numeric: tabular-nums;
}

.share-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Buttons */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Content Bands */
.section-band {
  padding: 56px 0;
}

.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.split-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
}

.axis-list {
  margin: 16px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
}

.axis-list li strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.axis-list li span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.split-visual {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.split-visual figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.link-inline {
  font-weight: 700;
  font-size: 15px;
}

/* Archetype Table */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.dere-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 14px;
}

.dere-table th,
.dere-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.dere-table thead th {
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.dere-table tbody tr:last-child td {
  border-bottom: none;
}

.col-num {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  width: 44px;
}

.col-name strong {
  display: block;
  font-size: 15px;
}

.type-link {
  color: var(--text);
  text-decoration: none;
}

.type-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.dere-table tbody tr[id] {
  scroll-margin-top: 84px;
}

.dere-table tbody tr:target {
  background: #fdf2f3;
}

.kana {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Prose */
.prose-body {
  max-width: 70ch;
}

.prose-body p {
  margin: 0 0 16px;
}

.prose-body h2 {
  margin-top: 32px;
}

.prose-body h2:first-child {
  margin-top: 0;
}

.prose-body h3 {
  margin-top: 24px;
}

.prose-body ul,
.prose-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose-body li {
  margin-bottom: 8px;
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.faq-answer p {
  margin: 12px 0 0;
  max-width: 68ch;
}

/* Comments */
.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.reply-banner {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.form-row {
  margin-bottom: 12px;
}

.field {
  display: block;
}

.field span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-msg {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--accent);
}

.comments-list {
  display: grid;
  gap: 12px;
}

.comments-empty {
  display: none;
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.comments-list[data-gf-empty] .comments-empty {
  display: block;
}

.comment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.comment-card[data-gf-owner] {
  border-left: 4px solid var(--primary);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.comment-meta strong {
  color: var(--text);
  font-size: 14px;
}

.owner-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.comment-to {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.comment-text {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.comment-reply-btn {
  background: transparent;
  border: none;
  padding: 4px 0;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 10px;
}

/* Inner pages */
.page-hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.inner-faq {
  margin-top: 40px;
}

.cta-banner {
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cta-banner h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.cta-banner p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.not-found-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.not-found-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0 28px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.footer-tagline {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 640px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .hero-band {
    padding: 16px 0 32px;
  }

  .quiz-shell {
    padding: 18px 16px;
  }

  .split-panel {
    grid-template-columns: 1fr;
  }

  .section-band {
    padding: 40px 0;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .cta-banner {
    padding: 20px;
  }
}

/* Editorial Archetype Portrait Cards & Visuals */
.dere-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.dere-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dere-card[id] {
  scroll-margin-top: 84px;
}

.dere-card:target {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 62, 77, 0.22);
}

.dere-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: inherit;
}

.dere-card-media {
  aspect-ratio: 1 / 1;
  background: var(--bg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.dere-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dere-card-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dere-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dere-card-head strong {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
}

.dere-card-head .kana {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.dere-card-copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.page-banner-figure {
  margin: 24px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.page-banner-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.page-banner-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.split-visual img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.types-summary {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 68ch;
}

.dere-card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.dere-card-cta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.all-types-block {
  margin-top: 40px;
  scroll-margin-top: 84px;
}

.prose-body h2[id],
.prose-body h3[id] {
  scroll-margin-top: 84px;
}

.profile-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: start;
  margin-top: 8px;
}

.profile-facts {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.profile-facts dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.profile-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-portrait-card {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.profile-portrait-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.profile-portrait-card figcaption {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .dere-card-grid-3 {
    grid-template-columns: 1fr;
  }

  .profile-hero-grid {
    grid-template-columns: 1fr;
  }

  .profile-facts {
    grid-template-columns: 1fr;
  }
}