/* =============================================================
   BETRAYAL RECOVERY COMPASS — shared design system
   Palette: sage, terracotta, cream. Type: Erode serif + General Sans.
   Works for screen and print.
   ============================================================= */

@import url('https://api.fontshare.com/v2/css?f[]=erode@400,500,600,700,1,2&f[]=general-sans@300,400,500,600,700&display=swap');

:root{
  /* Core palette */
  --sage:       #5A8A6A;
  --sage-dark:  #446A52;
  --sage-deep:  #2F4A38;
  --sage-soft:  #C5D6CA;
  --sage-mist:  #E8EFE9;

  --terra:      #C4836A;
  --terra-dark: #A86651;
  --terra-soft: #E8CFC1;
  --terra-mist: #F5EAE2;

  --cream:      #FAF8F5;
  --cream-warm: #F3EEE5;
  --cream-deep: #E8E1D2;

  --ink:        #2D2B26;
  --ink-soft:   #54504A;
  --ink-mute:   #8C867C;
  --rule:       #D8D2C5;
  --rule-soft:  #ECE6D8;

  /* Compass phase colors — 5 stations */
  --p-discovery:      #B57E2F;   /* Center — amber/ochre */
  --p-discovery-soft: #F4E7CC;
  --p-stabilization:      #2E7D82;   /* North — teal */
  --p-stabilization-soft: #D4E5E6;
  --p-integration:      #6B8F71;   /* East — sage-leaf */
  --p-integration-soft: #DEE7DF;
  --p-healing:      #8B6BAE;   /* South — plum */
  --p-healing-soft: #E3D8EC;
  --p-beyond:      #C4836A;   /* West — terracotta */
  --p-beyond-soft: #F2DDD1;

  /* Type scale (screen) */
  --fs-xs: 0.78rem;
  --fs-sm: 0.92rem;
  --fs-base: 1.04rem;
  --fs-md: 1.18rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2.1rem;
  --fs-2xl: 2.9rem;
  --fs-3xl: 4rem;

  --serif: 'Erode', 'Cormorant Garamond', Georgia, serif;
  --sans:  'General Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- reset / base ---------------------------------------------- */
*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- typography ------------------------------------------------ */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.005em; }
.sans  { font-family: var(--sans); }
.eyebrow{
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-mute);
}
.display{
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.lede{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  color: var(--ink-soft);
  line-height: 1.45;
  text-wrap: pretty;
  max-width: 42em;
}

h1,h2,h3,h4{ font-family: var(--serif); font-weight: 500; letter-spacing:-0.01em; line-height:1.15; color:var(--ink); text-wrap: balance; }
h1{ font-size: clamp(1.9rem, 3.2vw, 2.8rem); }
h2{ font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3{ font-size: 1.2rem; }
h4{ font-size: 1.05rem; }

p{ margin: 0 0 1em; text-wrap: pretty; }
a{ color: var(--sage-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover{ color: var(--terra-dark); }

ul, ol{ margin: 0 0 1em 1.2em; padding:0; }
li{ margin-bottom: 0.3em; }

hr{ border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* ---- layout primitives ---------------------------------------- */
.page-shell{ max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
.page-narrow{ max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 720px){
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
}

.rule{ height:1px; background: var(--rule); border:0; }
.rule-soft{ height:1px; background: var(--rule-soft); border:0; }

/* ---- site chrome ---------------------------------------------- */
.site-header{
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  padding: 1rem 0;
  position: sticky; top:0; z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(250, 248, 245, 0.92);
}
.site-header .inner{
  max-width: 1120px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.brandmark{
  display:flex; align-items:center; gap: 0.65rem;
  text-decoration: none; color: var(--ink);
}
.brandmark .mark{ width: 30px; height: 30px; color: var(--sage); }
.brandmark .name{
  font-family: var(--serif); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.01em;
}
.brandmark .name small{
  display:block; font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-mute); font-weight:500; margin-top:1px;
}
.site-nav{ display:flex; gap: 1.6rem; }
.site-nav a{
  font-family: var(--sans); font-size: 0.88rem; color: var(--ink-soft);
  text-decoration: none; font-weight: 500;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.site-nav a:hover{ color: var(--sage-dark); border-bottom-color: var(--sage); }
.site-nav a.active{ color: var(--sage-dark); border-bottom-color: var(--sage); }

@media (max-width: 720px){
  .site-nav{ display:none; }
}

/* ---- site footer ---------------------------------------------- */
.site-footer{
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2.5rem 0 1.5rem;
  background: var(--cream-warm);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer .inner{ max-width:1120px; margin:0 auto; padding: 0 2rem; }
.site-footer .crisis{
  background: white;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--terra);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline;
}
.site-footer .crisis strong{
  display:block; font-family: var(--sans); font-size: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--terra-dark);
  font-weight: 700; margin-bottom: 0.4rem;
}
.site-footer .crisis .resource{
  display:flex; flex-direction:column; gap:1px;
  font-family: var(--sans);
}
.site-footer .crisis .resource b{
  font-family: var(--serif); font-weight: 500; color: var(--ink); font-size: 0.98rem;
}
.site-footer .colophon{
  display:flex; flex-wrap:wrap; justify-content:space-between; gap: 1rem; font-size: 0.82rem;
  border-top: 1px solid var(--rule-soft); padding-top: 1rem;
}
.site-footer .colophon em{ color: var(--ink-mute); font-style: italic; }

/* ---- phase chip ----------------------------------------------- */
.phase-chip{
  display:inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.35em 0.85em; border-radius: 999px;
  color: white;
}
.phase-chip::before{
  content:""; width: 0.45em; height: 0.45em; border-radius: 999px; background: white; opacity: 0.85;
}
.phase-chip.discovery{ background: var(--p-discovery); }
.phase-chip.stabilization{ background: var(--p-stabilization); }
.phase-chip.integration{ background: var(--p-integration); }
.phase-chip.healing{ background: var(--p-healing); }
.phase-chip.beyond{ background: var(--p-beyond); }

.phase-chip.ghost{
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid currentColor;
}
.phase-chip.ghost::before{ background: currentColor; opacity: 1; }
.phase-chip.ghost.discovery{ color: var(--p-discovery); }
.phase-chip.ghost.stabilization{ color: var(--p-stabilization); }
.phase-chip.ghost.integration{ color: var(--p-integration); }
.phase-chip.ghost.healing{ color: var(--p-healing); }
.phase-chip.ghost.beyond{ color: var(--p-beyond); }

/* ---- cards ---------------------------------------------------- */
.card{
  background: white;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
}
.card.warm{ background: var(--cream-warm); border-color: var(--cream-deep); }
.card.sage{ background: var(--sage-mist); border-color: var(--sage-soft); }

.pullquote{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink);
  border-left: 2px solid var(--terra);
  padding: 0.2rem 0 0.2rem 1.25rem;
  margin: 1.25rem 0;
  text-wrap: pretty;
}
.pullquote cite{
  display:block; margin-top: 0.5rem;
  font-family: var(--sans); font-style: normal; font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---- buttons -------------------------------------------------- */
.btn{
  display: inline-flex; align-items:center; gap: 0.55em;
  font-family: var(--sans); font-weight: 500; font-size: 0.95rem;
  padding: 0.75em 1.3em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-primary{ background: var(--sage-dark); color: white; }
.btn-primary:hover{ background: var(--sage-deep); color: white; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(46,74,56,0.18); }
.btn-ghost{ background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover{ background: var(--ink); color: var(--cream); }
.btn-terra{ background: var(--terra-dark); color: white; }
.btn-terra:hover{ background: var(--terra); color: white; transform: translateY(-1px); }

/* ---- page header (hero) --------------------------------------- */
.page-head{
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  position: relative;
}
.page-head .inner{ max-width: 1120px; margin:0 auto; padding: 0 2rem; display: grid; grid-template-columns: 3fr 2fr; gap: 3rem; align-items:end; }
.page-head h1.display{ margin: 0; }
.page-head .eyebrow{ margin-bottom: 1rem; display:block; }
.page-head .lede{ margin-top: 1.25rem; }
.page-head .side{ font-size: 0.88rem; color: var(--ink-soft); }
@media (max-width: 720px){
  .page-head .inner{ grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---- toc ------------------------------------------------------ */
.toc{ list-style: none; margin: 0; padding: 0; }
.toc li{ display:flex; justify-content:space-between; gap:1rem; padding: 0.5rem 0; border-bottom: 1px dotted var(--rule); font-size: 0.95rem; }
.toc li a{ color: var(--ink); text-decoration: none; }
.toc li a:hover{ color: var(--sage-dark); }
.toc li .num{ color: var(--ink-mute); font-family: var(--sans); font-variant-numeric: tabular-nums; }

/* ---- print ---------------------------------------------------- */
@media print{
  :root{
    --fs-base: 10.5pt;
  }
  html, body{ background: white; color: black; }
  .site-header, .site-nav, .no-print{ display: none !important; }
  .site-footer{ background: white; border-top: 1px solid #333; page-break-before: avoid; }
  a{ color: inherit; text-decoration: none; }
  @page{ size: letter; margin: 0.75in 0.75in 0.9in 0.75in; }
  .page-break{ page-break-before: always; }
  .avoid-break{ page-break-inside: avoid; }
}
