/* FreeDura brand tokens — source of truth: the FreeDura design system */
:root {
  --navy: #2A3D5E;      /* Deep Freedom Navy */
  --slate: #6E7C91;     /* Slate Trust */
  --charcoal: #1B2432;  /* Compounding Charcoal */
  --gold: #C2A862;      /* Soft Wealth Gold */
  --paper: #F8F7F5;     /* Paper White */
  --evergreen: #5C7660; /* Evergreen Yield */

  --surface-page: var(--paper);
  --surface-inverse: var(--charcoal);
  --text-primary: var(--charcoal);
  --text-heading: var(--navy);
  --text-muted: #545F72;           /* darkened slate, 6:1 on paper */
  --rule: rgba(110, 124, 145, 0.35);
  --accent: var(--gold);
  --action-bg: var(--navy);
  --action-text: var(--paper);
  --link: var(--navy);
  --positive: var(--evergreen);

  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --serif: "Tiempos", Georgia, serif;
  --sans: "Inter", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-page); color: var(--text-primary);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--surface-page); padding: 0.4rem 0.8rem; z-index: 10; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--text-heading); }

/* Masthead */
.masthead {
  width: 100%; max-width: 72rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem; padding: 1.25rem var(--gutter);
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text-heading); text-decoration: none;
  font: 500 1.5rem/1 var(--serif); letter-spacing: -0.01em; }
.brand-mark { width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font: 500 0.95rem/1.4 var(--sans); }
.masthead nav a { color: var(--text-muted); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.masthead nav a:hover { color: var(--text-primary); }
.masthead nav a[aria-current="page"] { color: var(--text-heading); border-bottom-color: var(--accent); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center; gap: 2rem; padding: clamp(2rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero h1 {
  font-size: clamp(2.8rem, 7.5vw, 5.4rem); line-height: 1; letter-spacing: -0.02em;
  margin: 0 0 1.5rem; max-width: 11ch;
}
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--text-muted); max-width: 34rem; margin: 0 0 2rem; }
.intro { display: flex; gap: 1rem; align-items: flex-start; max-width: 36rem; margin: 0 0 2rem; }
.intro .lede { margin: 0; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); margin-top: 0.3rem; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 0; }
.button {
  display: inline-block; background: var(--action-bg); color: var(--action-text); text-decoration: none;
  font: 600 0.95rem/1 var(--sans); padding: 0.95rem 1.4rem; border-radius: 999px;
}
.button:hover { background: var(--charcoal); color: var(--paper); }
.textlink { font: 600 0.95rem/1 var(--sans); }

.stairs { margin: 0; justify-self: center; width: min(100%, 28rem); }
.stairs svg { width: 100%; height: auto; display: block; overflow: visible; }
.stair-area { fill: var(--navy); opacity: 0; animation: fade 0.8s ease-out 1.6s forwards; }
.stair-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.4,.1,.3,1) forwards; }
.stair-now { fill: var(--gold); opacity: 0; animation: pop 0.4s ease-out 1.5s forwards; }
.goal { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 6; }
.goal-label { font: 600 13px/1 var(--sans); fill: var(--text-muted); }
.axis { stroke: var(--rule); stroke-width: 1; }
.income-label { font: 600 13px/1 var(--sans); fill: var(--navy); }
.stairs figcaption { font: 500 0.85rem/1.4 var(--sans); color: var(--text-muted); text-align: center; margin-top: 0.75rem; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 0.08; } }
@keyframes pop { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .stair-line, .stair-area, .stair-now { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .stair-area { opacity: 0.08; }
}

/* Sections */
.principles, .latest { border-top: 1px solid var(--rule); padding: 2.75rem 0; }
.principles h2, .latest h2 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1.75rem; }
.principles dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem; margin: 0; }
.principles dt { font: 600 1.05rem/1.35 var(--sans); color: var(--text-heading); margin-bottom: 0.5rem; }
.principles dt::before { content: ""; display: block; width: 1.75rem; height: 3px; background: var(--accent); margin-bottom: 0.9rem; }
.principles dd { margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* Post list */
.postlist { list-style: none; margin: 0; padding: 0; max-width: 48rem; }
.postlist li { display: flex; justify-content: space-between; gap: 1.5rem; align-items: baseline;
  padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.postlist a { text-decoration: none; color: var(--text-primary); display: grid; gap: 0.3rem; }
.pl-title { font: 500 1.3rem/1.3 var(--serif); color: var(--text-heading); }
.postlist a:hover .pl-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
.pl-sum { color: var(--text-muted); font-size: 0.98rem; line-height: 1.5; }
.postlist time { font: 500 0.85rem/1 var(--sans); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--text-muted); }

/* Prose */
.prose { max-width: var(--measure); padding: clamp(2rem, 6vw, 4rem) 0 2rem; }
.post-head h1 { font-size: clamp(2.2rem, 5.5vw, 3.3rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 1rem; }
.post-head .lede { margin-bottom: 2.5rem; }
.meta { font: 500 0.9rem/1.4 var(--sans); color: var(--text-muted); margin: 0 0 0.75rem; }
.draft { background: var(--gold); color: var(--charcoal); padding: 0.15rem 0.55rem; border-radius: 4px; margin-left: 0.5rem; font-size: 0.78rem; font-weight: 600; }
.prose h2 { font-size: 1.65rem; line-height: 1.25; margin: 2.6rem 0 0.8rem; }
.prose h3 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 0.6rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--slate); }
.prose blockquote { margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--text-muted); font: 400 1.15rem/1.6 var(--serif); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.4; margin: 1.5rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; color: var(--text-heading); }
.prose td { font-variant-numeric: tabular-nums; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose code { font-size: 0.88em; background: rgba(110,124,145,0.12); padding: 0.1em 0.35em; border-radius: 4px; }
.positive { color: var(--positive); font-weight: 600; }
.back { font: 600 0.95rem/1 var(--sans); padding-bottom: 3rem; }

/* Page with a photo on the right */
.page-photo { display: block; width: 100%; height: auto; border-radius: 8px; }
.prose.has-photo { max-width: 62rem; display: grid; grid-template-columns: minmax(0, 38rem) minmax(0, 18rem);
  column-gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.has-photo .post-head, .has-photo .page-body { grid-column: 1; }
.has-photo .page-photo { grid-column: 2; grid-row: 1 / span 2; margin-top: 0.75rem; }
@media (max-width: 760px) {
  .prose.has-photo { display: block; }
  .has-photo .page-photo { width: min(100%, 18rem); margin: 0 0 2rem; }
}

/* Footer: Compounding Charcoal band */
.colophon { background: var(--surface-inverse); color: #C9D0DA; margin-top: 3rem; }
.colophon-inner { max-width: 72rem; margin: 0 auto; padding: 2.5rem var(--gutter) 3rem; }
.colophon .wordmark { font: 500 1.35rem/1 var(--serif); color: var(--paper); margin: 0 0 1rem; }
.colophon a { color: var(--gold); }
.disclaimer { font-size: 0.92rem; line-height: 1.6; max-width: 40rem; margin: 0 0 1rem; }
.small { font-size: 0.85rem; color: #A9B3C2; margin: 0; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .stairs { width: min(100%, 22rem); grid-row: 2; justify-self: start; }
  .principles dl { grid-template-columns: 1fr; gap: 1.75rem; }
  .postlist li { flex-direction: column; gap: 0.4rem; }
}