/* ═══════════════════════════════════════════════════
   Financial Health Record — Ghost Theme Stylesheet
   Design: Standards-body austere. A well-written README
   for a data standard. Distinct but related to attune.co.
   ═══════════════════════════════════════════════════ */


/* ─────────── TOKENS ─────────── */

:root {
  /* Colors — Light Mode */
  --ink: #0F172A;
  --dark-slate: #1C263D;
  --surface: #FFFFFF;
  --surface-alt: #F8F8F8;
  --text: #334155;
  --text-light: #64748B;
  --text-muted: #94A3B8;
  --teal: #0D9488;
  --deep-teal: #145456;
  --rule: #E2E8F0;
  --white: #FFFFFF;

  /* Lifecycle gradient stops */
  --stage-1: #0F172A;  /* Diagnosis */
  --stage-2: #0E3641;  /* Routing */
  --stage-3: #0E5559;  /* Intervention */
  --stage-4: #0D7470;  /* Reassessment */
  --stage-5: #0D9488;  /* Proof */

  /* Typography */
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --content-width: 680px;
  --content-wide: 900px;
  --page-padding: 24px;

  /* Misc */
  --radius: 8px;
  --radius-sm: 4px;
}

/* Dark mode */
[data-theme="dark"] {
  --ink: #E2E8F0;
  --dark-slate: #94A3B8;
  --surface: #0F172A;
  --surface-alt: #1E293B;
  --text: #CBD5E1;
  --text-light: #94A3B8;
  --text-muted: #64748B;
  --teal: #2DD4BF;
  --deep-teal: #14B8A6;
  --rule: #1E293B;
  --white: #0F172A;
}


/* ─────────── RESET ─────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }


/* ─────────── FADE-IN ANIMATIONS ─────────── */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ─────────── HUB BAR ─────────── */

.hub-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: #0F172A;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6vw;
  font-family: var(--font-body);
  font-size: 12px;
}

.hub-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-bar-text {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.hub-bar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-bar-logo svg {
  flex-shrink: 0;
}

.hub-bar a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.hub-bar a:hover { color: white; }

[data-theme="dark"] .hub-bar {
  background: #020617;
}


/* ─────────── THEME TOGGLE ─────────── */

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: all 0.2s ease;
  line-height: 1;
  position: fixed;
  top: 44px;
  right: 6vw;
  z-index: 1000;
}

.theme-toggle:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }


/* ─────────── CONTAINER ─────────── */

.container {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.container-narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}


/* ─────────── HERO ─────────── */

.hero {
  margin-top: 32px;
  padding: 100px var(--page-padding) 80px;
  text-align: center;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 24px;
}

.hero-mark {
  margin-bottom: 32px;
}

.hero-mark svg {
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-body);
  font-size: 52px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.65;
  max-width: 580px;
  margin: 0 auto 16px;
}

.hero-analogy {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--teal);
  margin-bottom: 40px;
  letter-spacing: 0.01em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--surface);
  background: var(--teal);
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  text-decoration: none;
}

.hero-cta:hover {
  background: var(--deep-teal);
  color: white;
}


/* ─────────── PROBLEM SECTION ─────────── */

.problem {
  background: var(--surface-alt);
  padding: 72px var(--page-padding);
}

[data-theme="dark"] .problem {
  background: var(--surface-alt);
}

.problem-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 20px;
}

.problem h2 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.problem p {
  font-size: 17px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}

.problem p:last-child {
  margin-bottom: 0;
}


/* ─────────── STANDARD SECTION ─────────── */

.standard {
  padding: 80px var(--page-padding);
}

.standard-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.standard h2 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-align: center;
}

.standard-sub {
  font-size: 17px;
  color: var(--text-light);
  text-align: center;
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.6;
}


/* ── Lifecycle Bar ── */

.lifecycle-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 64px;
  position: relative;
  padding: 0 40px;
}

.lifecycle-stage {
  flex: 1;
  max-width: 180px;
  text-align: center;
  position: relative;
}

.lifecycle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 0 auto 16px;
  position: relative;
  z-index: 2;
}

.lifecycle-stage:nth-child(1) .lifecycle-dot { background: var(--stage-1); }
.lifecycle-stage:nth-child(2) .lifecycle-dot { background: var(--stage-2); }
.lifecycle-stage:nth-child(3) .lifecycle-dot { background: var(--stage-3); }
.lifecycle-stage:nth-child(4) .lifecycle-dot { background: var(--stage-4); }
.lifecycle-stage:nth-child(5) .lifecycle-dot { background: var(--stage-5); }

[data-theme="dark"] .lifecycle-stage:nth-child(1) .lifecycle-dot { background: #475569; }
[data-theme="dark"] .lifecycle-stage:nth-child(2) .lifecycle-dot { background: #0E3641; }
[data-theme="dark"] .lifecycle-stage:nth-child(3) .lifecycle-dot { background: #0E5559; }
[data-theme="dark"] .lifecycle-stage:nth-child(4) .lifecycle-dot { background: #0D7470; }
[data-theme="dark"] .lifecycle-stage:nth-child(5) .lifecycle-dot { background: #0D9488; }

/* Connecting line between dots */
.lifecycle-bar::before {
  content: '';
  position: absolute;
  top: 7px;
  left: calc(40px + 90px / 2);
  right: calc(40px + 90px / 2);
  height: 2px;
  background: linear-gradient(to right, var(--stage-1), var(--stage-5));
  opacity: 0.25;
  z-index: 1;
}

[data-theme="dark"] .lifecycle-bar::before {
  opacity: 0.4;
}

.lifecycle-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.lifecycle-question {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.4;
}


/* ── Properties Grid ── */

.properties-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.property-card {
  padding: 28px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-align: center;
}

.property-icon {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--teal);
  margin-bottom: 12px;
  line-height: 1;
}

.property-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.property-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}


/* ─────────── BUILD WITH US ─────────── */

.build-with-us {
  background: var(--surface-alt);
  padding: 72px var(--page-padding);
}

.build-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
}

.build-with-us h2 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.build-with-us p {
  font-size: 17px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}


/* ─────────── SUBSCRIBE SECTION ─────────── */

.subscribe-section {
  padding: 72px var(--page-padding);
}

.subscribe-box {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.subscribe-box h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.subscribe-box p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.55;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-form input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.subscribe-form input[type="email"]:focus {
  border-color: var(--teal);
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.subscribe-form button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.subscribe-form button:hover {
  background: var(--deep-teal);
}

[data-theme="dark"] .subscribe-form button:hover {
  background: #0D9488;
}


/* ─────────── FOOTER ─────────── */

.site-footer {
  padding: 40px var(--page-padding);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-brand svg {
  flex-shrink: 0;
}

.footer-brand-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.footer-attune {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-attune a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.footer-attune a:hover { text-decoration: underline; }

.footer-trademark {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ─────────── ARTICLE BODY (post/page) ─────────── */

.article-header {
  margin-top: 32px;
  background: #0F172A;
  padding: 48px var(--page-padding) 52px;
}

[data-theme="dark"] .article-header {
  background: #020617;
}

.article-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.header-home a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-home-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.header-home a:hover .header-home-text {
  color: white;
}

.article-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}

[data-theme="dark"] .article-label {
  color: #2DD4BF;
}

.article-header h1 {
  font-family: var(--font-body);
  font-size: 40px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.article-deck {
  font-size: 18px;
  color: rgba(226, 232, 240, 0.7);
  line-height: 1.6;
  margin-bottom: 24px;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(226, 232, 240, 0.4);
  text-transform: lowercase;
}

.gh-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px var(--page-padding) 60px;
  font-size: 18px;
  color: var(--text);
  line-height: 1.75;
}

.gh-content > * + * {
  margin-top: 24px;
}

.gh-content h2 {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 52px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gh-content h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 40px;
  line-height: 1.3;
}

.gh-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gh-content a:hover {
  color: var(--deep-teal);
}

.gh-content strong {
  font-weight: 600;
  color: var(--ink);
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
}

.gh-content li {
  margin-bottom: 8px;
}

.gh-content blockquote {
  border-left: 3px solid var(--teal);
  padding-left: 24px;
  font-style: italic;
  color: var(--text-light);
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 48px 0;
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-alt);
  color: var(--teal);
  padding: 2px 6px;
  border-radius: 3px;
}

.gh-content pre {
  background: #0F172A;
  color: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 24px 28px;
  border-radius: var(--radius);
  overflow-x: auto;
}

[data-theme="dark"] .gh-content pre {
  background: #020617;
}

.gh-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}


/* ─────────── GHOST CARD STYLES ─────────── */

/* Wide + full-width image support (Koenig editor) */
.kg-width-wide {
  max-width: var(--content-wide);
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}

.kg-image-card {
  margin-top: 32px;
  margin-bottom: 32px;
}

.kg-image-card img {
  border-radius: var(--radius);
}

.kg-width-full img {
  border-radius: 0;
}

.kg-image-card figcaption {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.kg-callout-card {
  background: var(--surface-alt);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.kg-callout-card .kg-callout-text {
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}

.kg-bookmark-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.kg-bookmark-card:hover {
  border-color: var(--teal);
}

.kg-bookmark-content {
  padding: 20px;
}

.kg-bookmark-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.kg-bookmark-description {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.5;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}


/* ─────────── RELATED POSTS ─────────── */

.related {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-padding) 48px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
}

.related h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.related-card {
  text-decoration: none;
  color: inherit;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.related-card:hover { border-color: var(--teal); }

.related-card .card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.related-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}


/* ─────────── PAGINATION ─────────── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 32px 0;
  font-family: var(--font-mono);
  font-size: 14px;
}

.pagination a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover {
  text-decoration: underline;
}

.pagination .page-number {
  color: var(--text-muted);
}


/* ─────────── ERROR PAGE ─────────── */

.error-page {
  margin-top: 32px;
  text-align: center;
  padding: 120px var(--page-padding);
}

.error-code {
  font-family: var(--font-mono);
  font-size: 96px;
  font-weight: 700;
  color: var(--rule);
  line-height: 1;
  margin-bottom: 16px;
}

.error-page h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.error-page p {
  font-size: 17px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.error-page a {
  color: var(--teal);
  text-decoration: underline;
}


/* ─────────── RESPONSIVE ─────────── */

@media (max-width: 768px) {
  .hero { padding: 80px var(--page-padding) 60px; }
  .hero h1 { font-size: 36px; }
  .hero-sub { font-size: 17px; }

  .lifecycle-bar {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 0;
  }

  .lifecycle-bar::before {
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--stage-1), var(--stage-5));
  }

  .lifecycle-stage {
    max-width: none;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    width: 100%;
    max-width: 320px;
  }

  .lifecycle-dot {
    margin: 0;
    flex-shrink: 0;
  }

  .properties-grid {
    grid-template-columns: 1fr 1fr;
  }

  .subscribe-form { flex-direction: column; }

  .article-header h1 { font-size: 30px; }
  .gh-content { font-size: 17px; }
  .related-grid { grid-template-columns: 1fr; }

  .problem, .standard, .build-with-us {
    padding: 56px var(--page-padding);
  }

  .standard h2, .problem h2, .build-with-us h2 {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .hub-bar { padding: 0 16px; font-size: 11px; }
  .hero { padding: 64px 16px 48px; }
  .hero h1 { font-size: 30px; }
  .hero-analogy { font-size: 13px; }

  .properties-grid {
    grid-template-columns: 1fr;
  }

  .container, .container-narrow { padding: 0 16px; }

  .theme-toggle {
    right: 16px;
  }

  .article-header { padding: 32px 16px 36px; }
  .gh-content { padding: 32px 16px 48px; }
}
