/* --------------------------------------------------
   Typography & CSS Custom Properties
   -------------------------------------------------- */
:root {
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Color Palette - Light Theme */
  --bg-primary: #fbf9f5;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f4efe6;
  --border-subtle: #e7dfd5;
  --border-strong: #cfc5b6;

  --text-primary: #191817;
  --text-secondary: #58544e;
  --text-muted: #847e75;

  --accent-primary: #23524b;
  --accent-hover: #173833;
  --accent-subtle: #e6f0ed;
  --accent-text: #ffffff;

  --badge-bg: #efe9de;
  --badge-text: #4e483e;
  --success-bg: #e5f5ec;
  --success-text: #1b6339;

  --shadow-sm: 0 1px 2px rgba(25, 24, 23, 0.04);
  --shadow-md: 0 4px 16px rgba(25, 24, 23, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #121314;
  --bg-surface: #1a1c1e;
  --bg-surface-subtle: #24272a;
  --border-subtle: #2d3135;
  --border-strong: #3f454a;

  --text-primary: #edebe8;
  --text-secondary: #a9a6a0;
  --text-muted: #72706a;

  --accent-primary: #3db89f;
  --accent-hover: #53cca4;
  --accent-subtle: #193831;
  --accent-text: #0d1e1a;

  --badge-bg: #272a2e;
  --badge-text: #b8b4ab;
  --success-bg: #143522;
  --success-text: #48d17d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------
   Site Header
   -------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-glyph {
  width: 38px;
  height: 38px;
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-subtle);
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* --------------------------------------------------
   Hero Section
   -------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 56px 0 72px;
}

.hero-section {
  max-width: 840px;
  margin-bottom: 56px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  margin-bottom: 18px;
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  font-family: var(--font-mono);
  font-size: 11px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 600;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------
   Buttons
   -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--accent-text);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
}

.btn-ghost:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}

.btn-icon {
  flex-shrink: 0;
}

/* --------------------------------------------------
   Theme Toggle
   -------------------------------------------------- */
.theme-toggle .dark-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .light-icon {
  display: none;
}
[data-theme="dark"] .theme-toggle .dark-icon {
  display: inline-block;
}

/* --------------------------------------------------
   Specimen Layout (Main + Sidebar)
   -------------------------------------------------- */
.specimen-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 860px) {
  .specimen-grid {
    grid-template-columns: 1fr;
  }
}

.specimen-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.sidebar-specimen {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-specimen .specimen-card {
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-meta {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Typography elements */
.body-paragraph {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}

.body-paragraph:last-child {
  margin-bottom: 0;
}

.editorial-quote {
  border-left: 3px solid var(--accent-primary);
  padding: 16px 20px;
  margin: 24px 0;
  background-color: var(--bg-surface-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.editorial-quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.editorial-quote cite {
  display: block;
  font-size: 13px;
  font-style: normal;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* Hierarchy List */
.hierarchy-demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.type-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.type-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 24px;
  flex-shrink: 0;
}

.type-sample {
  font-family: var(--font-serif);
  color: var(--text-primary);
  line-height: 1.3;
}

.sample-h2 { font-size: 1.25rem; font-weight: 600; }
.sample-h3 { font-size: 1.1rem; font-weight: 600; }
.sample-h4 { font-size: 0.95rem; font-weight: 500; font-family: var(--font-sans); }

/* List specimen */
.specimen-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.specimen-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.specimen-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 700;
}

/* Diagnostic dl */
.diagnostic-list {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 10px;
  column-gap: 16px;
  font-size: 13px;
}

.diagnostic-list dt {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.diagnostic-list dd {
  color: var(--text-primary);
  font-weight: 500;
}

/* --------------------------------------------------
   Multi-Column Extended Specimen
   -------------------------------------------------- */
.extended-specimen .multi-column-text {
  column-count: 3;
  column-gap: 36px;
  column-rule: 1px solid var(--border-subtle);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.extended-specimen .multi-column-text p {
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .extended-specimen .multi-column-text {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .extended-specimen .multi-column-text {
    column-count: 1;
  }
}

/* --------------------------------------------------
   Footer
   -------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  padding: 32px 0;
  margin-top: auto;
  font-size: 13px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-copy {
  color: var(--text-primary);
}

.footer-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
