/* MindWeigh Theme Stylesheet — Brass Astrolabe & Archival Psychometrics */

:root {
  --bg: #0c0d10;
  --surface: #14161d;
  --card: #191c26;
  --border: #2a2e3d;
  --text: #edeae4;
  --muted: #9ca3b5;
  --primary: #d9384a;
  --primary-hover: #b82838;
  --accent: #d4af37;
  --accent-soft: #262115;
  --white: #ffffff;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 8px;
}

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

html {
  background-color: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

a:hover {
  color: var(--text);
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 12px;
  font-weight: 700;
}

h1 {
  font-size: clamp(32px, 4.4vw, 48px);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(26px, 3vw, 34px);
  margin-top: 40px;
}

h3 {
  font-size: 22px;
  margin-top: 24px;
}

p,
ul,
ol,
table,
blockquote {
  margin: 0 0 18px;
}

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

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

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

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

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

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

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 4px;
}

.site-nav a:hover {
  color: var(--text);
}

.site-main {
  flex: 1 0 auto;
  padding: 36px 0 64px;
}

/* Home Hero & Tool-First Band */

.hero {
  margin-bottom: 24px;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin-bottom: 8px;
}

.hero-sub {
  margin: 0;
  max-width: 70ch;
  font-size: 17px;
  color: var(--muted);
}

.tool-shell {
  margin-bottom: 18px;
}

/* Engagement Strip */

.engage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 48px;
}

.engage-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.engage-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

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

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

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

/* Editorial Prose & Page Layout */

.prose {
  max-width: 70ch;
  color: var(--text);
}

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

.prose p,
.prose li {
  font-size: 17px;
  line-height: 1.72;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

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

.prose strong {
  color: var(--white);
}

.prose blockquote {
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background-color: var(--surface);
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
  margin: 24px 0;
}

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

.prose th {
  background-color: var(--card);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.page-head {
  padding-bottom: 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.page-sub {
  margin: 0;
  max-width: 70ch;
  font-size: 18px;
  color: var(--muted);
}

/* FAQ Accordion */

.faq-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 70ch;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 18px;
}

.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
}

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

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  flex: none;
}

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

.faq-item p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.68;
}

/* Comments Section */

.comments-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 70ch;
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.comments-head h2 {
  margin: 0;
}

.comment-count {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.comment-form {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.comment-form-row {
  display: grid;
  gap: 6px;
}

.comment-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

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

.comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

.comment-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.comment-submit {
  min-height: 44px;
  padding: 10px 20px;
  background-color: var(--primary);
  color: var(--white);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.comment-submit:hover {
  background-color: var(--primary-hover);
}

.comment-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.comment-reply-cancel {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.comment-msg {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.comment-list[data-gf-empty]::before {
  content: 'No observations posted yet. Share what tipped your scale.';
  display: block;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.comment-list[data-gf-off]::before {
  content: 'Discussion is currently closed.';
  display: block;
  color: var(--muted);
  font-size: 14px;
}

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

.comment-item[data-gf-owner] {
  border-color: var(--accent);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.comment-author {
  color: var(--text);
  font-weight: 600;
}

.comment-owner-tag {
  padding: 2px 7px;
  border-radius: 4px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.comment-to {
  color: var(--accent);
}

.comment-time {
  color: var(--muted);
  margin-left: auto;
}

.comment-body {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
}

.comment-reply-btn {
  min-height: 36px;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

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

.comment-replies {
  list-style: none;
  padding: 0 0 0 18px;
  margin: 12px 0 0;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 10px;
}

.comment-replies[data-gf-empty] {
  display: none;
}

/* 404 Page */

.notfound {
  padding: 48px 0;
  max-width: 60ch;
}

.notfound-code {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: var(--accent);
}

.notfound-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  background-color: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
}

.notfound-cta:hover {
  background-color: var(--primary-hover);
  color: var(--white);
}

/* Footer */

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

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

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

  .brand {
    font-size: 21px;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .site-main {
    padding: 24px 0 48px;
  }

  h1 {
    font-size: 30px;
  }

  .engage-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .engage-group {
    width: 100%;
  }

  .engage-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .comment-submit {
    width: 100%;
  }

  .prose table {
    display: block;
    overflow-x: auto;
  }
}
