/* Applied Leverage — stylesheet
 * Editorial, typographic, unhurried. No ornament.
 * Governing principle: if a declaration is decorative, remove it.
 */

/* -------- Reset -------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* -------- Root tokens -------- */

:root {
  --bg:          #F5F1E8;
  --bg-alt:      #EBE6D8;
  --text:        #1A1712;
  --text-muted:  #5C554B;
  --rule:        #C4B896;
  --accent:      #7C2A1E;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;           /* ~ 680px at 20px base — book-width */
  --measure-wide: 44rem;

  --space-0: 0.25rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 8rem;
}

/* -------- Body -------- */

body {
  font-family: var(--serif);
  font-size: 1.1rem;          /* ~17.6px scaled by html base */
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  font-weight: 400;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.2rem;        /* ~19.2px */
  }
}

/* -------- Layout wrappers -------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.page-wide {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

@media (min-width: 48rem) {
  .page, .page-wide {
    padding: 0 var(--space-4);
  }
}

main {
  padding: var(--space-5) 0 var(--space-7);
}

/* -------- Skip link -------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* -------- Masthead -------- */

.masthead {
  padding: var(--space-4) 0 var(--space-3);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (min-width: 48rem) {
  .masthead-inner {
    padding: 0 var(--space-4);
  }
}

.masthead-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.masthead-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.masthead-practice {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.nav {
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 120ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  border-bottom-color: var(--accent);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--text);
}

/* -------- Typography primitives -------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.page-title {
  font-size: 2.3rem;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-2);
}

@media (min-width: 48rem) {
  .page-title {
    font-size: 2.9rem;
  }
}

.page-eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.section {
  padding: var(--space-5) 0 var(--space-4);
  border-top: 1px solid var(--rule);
}

.section:first-of-type {
  border-top: none;
  padding-top: var(--space-3);
}

.section-title {
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

@media (min-width: 48rem) {
  .section-title {
    font-size: 1.8rem;
  }
}

.section-lead {
  font-size: 1.18rem;
  line-height: 1.55;
  margin-bottom: var(--space-3);
  color: var(--text);
}

p {
  margin-bottom: var(--space-2);
}

p + p {
  text-indent: 0;
}

.prose p {
  margin-bottom: var(--space-2);
}

.prose p + p {
  margin-top: 0;
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

/* -------- Lists within prose -------- */

.prose ul,
.list-clean {
  list-style: none;
  margin: var(--space-2) 0 var(--space-3);
  padding: 0;
}

.prose ul li,
.list-clean li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.prose ul li::before,
.list-clean li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* Ordered lists keep numerals */
.prose ol {
  margin: var(--space-2) 0 var(--space-3);
  padding-left: 1.5rem;
}
.prose ol li {
  margin-bottom: 0.5rem;
  padding-left: 0.3rem;
}

/* -------- Situation statement -------- */

.situation {
  padding: var(--space-5) 0 var(--space-4);
}

.situation p {
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: -0.005em;
}

@media (min-width: 48rem) {
  .situation p {
    font-size: 1.55rem;
  }
}

/* -------- Named IP callouts -------- */

.ip-block {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
}

.ip-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: block;
}

.ip-title {
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}

.ip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ip-list li {
  padding: 0.6rem 0;
  border-bottom: 1px dotted var(--rule);
  line-height: 1.5;
}

.ip-list li:last-child {
  border-bottom: none;
}

.ip-list .ip-name {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  margin-right: 0.5ch;
}

.ip-list .ip-gloss {
  color: var(--text-muted);
  font-size: 0.98em;
}

/* -------- Next step / single CTA -------- */

.next-step {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

.next-step p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.link-primary {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 150ms ease;
}

.link-primary:hover,
.link-primary:focus-visible {
  opacity: 0.75;
}

.link-inline {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 120ms ease;
}

.link-inline:hover,
.link-inline:focus-visible {
  border-bottom-color: var(--accent);
}

/* -------- Refusal block (the "what this is not" list) -------- */

.refusal {
  padding: var(--space-3) 0;
}

.refusal .list-clean li::before {
  content: "·";
  font-weight: 700;
  color: var(--text-muted);
}

/* -------- Essay index -------- */

.essay-index {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
}

.essay-index li {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
}

.essay-index li:last-child {
  border-bottom: 1px solid var(--rule);
}

.essay-index .essay-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.essay-index .essay-title {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.essay-index .essay-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 120ms ease;
}

.essay-index .essay-title a:hover,
.essay-index .essay-title a:focus-visible {
  color: var(--accent);
}

.essay-index .essay-title.coming {
  color: var(--text-muted);
  font-style: italic;
}

.essay-index .essay-abstract {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.essay-index .essay-status {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* -------- Essay page -------- */

.essay-header {
  padding: var(--space-5) 0 var(--space-3);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-4);
}

.essay-header .essay-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.essay-header h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-2);
}

@media (min-width: 48rem) {
  .essay-header h1 {
    font-size: 2.6rem;
  }
}

.essay-body {
  font-size: 1.15rem;
  line-height: 1.7;
}

@media (min-width: 48rem) {
  .essay-body {
    font-size: 1.22rem;
    line-height: 1.72;
  }
}

.essay-body p {
  margin-bottom: 1.2rem;
}

.essay-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.6rem;
  line-height: 0.9;
  float: left;
  padding: 0.25rem 0.55rem 0 0;
  color: var(--accent);
  font-weight: 500;
}

.essay-body em {
  font-style: italic;
}

.essay-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.essay-footer a {
  color: var(--text);
}

/* -------- Work page stage -------- */

.stage {
  padding: var(--space-5) 0 var(--space-4);
  border-top: 1px solid var(--rule);
}

.stage-number {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: block;
}

.stage h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

@media (min-width: 48rem) {
  .stage h2 {
    font-size: 2.1rem;
  }
}

.stage-lead {
  font-size: 1.18rem;
  line-height: 1.55;
  margin-bottom: var(--space-3);
}

.stage h3 {
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  margin-top: var(--space-3);
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* -------- Guarantee panel -------- */

.guarantee {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-3);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
}

.guarantee p {
  margin-bottom: 0.5rem;
}

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

.guarantee .guarantee-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

/* -------- Begin page fee line -------- */

.fee {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.005em;
  margin: var(--space-3) 0;
  color: var(--text);
}

.fee .fee-amount {
  font-weight: 500;
}

.fee-note {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.5rem;
  font-style: italic;
}

/* -------- About page -------- */

.about-body p {
  font-size: 1.18rem;
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

/* -------- Footer -------- */

.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-4) 0 var(--space-4);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--space-3);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (min-width: 48rem) {
  .site-footer-inner {
    padding: 0 var(--space-4);
  }
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  border-bottom-color: var(--accent);
}

/* -------- Focus ring (a single, considered treatment) -------- */

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

/* -------- Utilities -------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rule-below {
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
}

/* -------- Print -------- */

@media print {
  .masthead, .nav, .site-footer {
    display: none;
  }
  body {
    background: white;
    color: black;
  }
}
