/* Kevin Sojoodi — site styles
   Extends the book-cover system: navy ground, bone type, one red rule. */

/* Self-hosted Inter Display. Drop the .woff2 files into /fonts/ and these
   take over; until then the system sans stack below is used. */
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #141428;
  --navy-raised: #1c1c36;
  --line: #34344f;
  --red: #c0392b;        /* large type and rules only — 3.1:1 on navy */
  --red-text: #e8705f;   /* red for small text — 5.4:1 on navy */
  --bone: #f4f1ea;
  --grey: #c9c4ba;
  --muted: #a39f96;

  --sans: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 38rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 5vw, 3rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--bone);
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { color: #fff; text-decoration-color: var(--red-text); }

:focus-visible {
  outline: 3px solid var(--red-text);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--bone);
  color: var(--navy);
  padding: 0.5rem 1rem;
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-name {
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.875rem;
  text-decoration: none;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-nav a {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--grey);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--bone); }
.site-nav a[aria-current="page"] {
  color: var(--bone);
  border-bottom-color: var(--red);
}

/* ---------- Type ---------- */

.rule {
  display: block;
  width: 5rem;
  height: 6px;
  background: var(--red);
  border: 0;
  margin: 0 0 2rem;
}

h1, h2, h3 {
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 1rem + 5.6vw, 5.5rem); }
.hero .wrap > * { min-width: 0; }

/* A title with one long word (e.g. "Homeownership") is sized to its column,
   not the viewport, so it can never run under the cover beside it. */
.hero .wrap > div:first-child { container-type: inline-size; }
.hero h1.title-fit {
  font-size: clamp(2rem, 11.5cqi, 5.5rem);
  max-width: none;
}
h2 { font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3.25rem); }
h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

p { margin: 0 0 1.25rem; }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 1.25rem;
}

.lede {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.45;
  color: var(--bone);
}

.secondary { color: var(--grey); }
.accent { color: var(--red); }

.prose { max-width: var(--measure); }
.prose p + h3 { margin-top: 2.5rem; }

/* ---------- Sections ---------- */

.section {
  padding: clamp(4rem, 3rem + 5vw, 8rem) 0;
}
.section + .section { border-top: 1px solid var(--line); }

/* ---------- Hero ---------- */

.hero .wrap {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero h1 { max-width: 14ch; }
.hero .cover { max-width: 22rem; }

@media (min-width: 52rem) {
  .hero .wrap { grid-template-columns: 1.35fr 1fr; gap: 4rem; }
  .hero .cover { justify-self: end; }
}

.cover img {
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(244, 241, 234, 0.06);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--bone);
  color: var(--navy);
  background: var(--bone);
}
.button:hover { background: #fff; border-color: #fff; color: var(--navy); }
.button.ghost {
  background: transparent;
  color: var(--bone);
}
.button.ghost:hover { background: var(--navy-raised); color: #fff; }

/* ---------- Two-column blocks ---------- */

.split {
  display: grid;
  gap: 2.5rem 4rem;
}
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1.5fr; }
}

/* ---------- Commitments list ---------- */

.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem 3rem;
}
@media (min-width: 40rem) {
  .points { grid-template-columns: 1fr 1fr; }
}
.points li {
  border-top: 2px solid var(--red);
  padding-top: 1.25rem;
}
.points p { color: var(--grey); margin: 0; }

/* ---------- Contents ---------- */

.parts {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ch;
}
.parts > li {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
}
.parts > li:last-child { border-bottom: 1px solid var(--line); }
.part-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-text);
  margin: 0 0 0.25rem;
}
.part-title {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 1rem;
}
.part-title span {
  display: block;
  font-weight: 300;
  font-size: 1rem;
  color: var(--grey);
  margin-top: 0.25rem;
}
.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.chapters li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 0.5rem;
}
.chapters .n {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.chapters strong { font-weight: 600; display: block; }
.chapters .sub { color: var(--grey); font-size: 0.9375rem; }

/* ---------- Details table ---------- */

.details {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.5rem;
  font-size: 0.9375rem;
}
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* ---------- Notice ---------- */

.notice {
  border-left: 3px solid var(--red);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--grey);
  font-size: 0.9375rem;
  max-width: var(--measure);
}
.notice strong { color: var(--bone); font-weight: 600; }

/* ---------- Series ---------- */

.series {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 52rem) {
  .series { grid-template-columns: repeat(3, 1fr); }
}
.series li {
  background: var(--navy-raised);
  padding: 1.75rem;
  border-top: 2px solid var(--line);
}
.series li.current { border-top-color: var(--red); }
.series .status {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.series li.current .status { color: var(--red-text); }
.series p { color: var(--grey); margin: 0; font-size: 0.9375rem; }

/* ---------- Portrait ---------- */

.portrait img {
  width: 100%;
  max-width: 24rem;
  filter: grayscale(0.15);
}

/* ---------- Elsewhere ---------- */

.elsewhere {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem 3rem;
}
@media (min-width: 40rem) {
  .elsewhere { grid-template-columns: 1fr 1fr; }
}
.elsewhere li { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.elsewhere .tag {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.elsewhere p { color: var(--grey); font-size: 0.9375rem; margin: 0; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 52rem) {
  .site-footer .wrap { grid-template-columns: 2fr 1fr; align-items: end; }
}
.site-footer p { margin: 0 0 0.5rem; max-width: 40rem; }
.site-footer a { color: var(--grey); }
.site-footer .legal { text-align: left; }
@media (min-width: 52rem) {
  .site-footer .legal { text-align: right; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
