/* ==========================================================================
   The Jared Foundation — "Desert Dusk"
   Custom layer over Pico.css. Self-sufficient: if the CDN base fails to load,
   every rule needed for legible layout, colour and type still lives here.
   ========================================================================== */

:root {
  --ink:          #211d2b;
  --violet:       #4c3a63;
  --violet-dark:  #33264a;
  --violet-deep:  #241a35;
  --sienna:       #c05a2e;
  --sienna-lt:    #e08a4e;
  --turq:         #2f8f93;
  --bone:         #faf6ef;
  --bone-alt:     #f2ebe0;
  --muted:        #6b6478;
  --rule:         rgba(33, 29, 43, .16);
  --rule-soft:    rgba(33, 29, 43, .09);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --shell: 74rem;

  /* Pico variable overrides */
  --pico-font-family: var(--body);
  --pico-primary: var(--violet);
  --pico-background-color: var(--bone);
  --pico-color: var(--ink);
  --pico-border-radius: 2px;
  --pico-spacing: 1rem;
}

/* Safeguard: nothing on this site may be hidden waiting on JavaScript. */
[data-aos], [data-animate], .reveal { opacity: 1 !important; transform: none !important; }

/* ---------------------------------------------------------------------------
   Pico neutralisation. Pico treats <article> as a card (background, padding,
   radius, shadow) and switches to a dark scheme on prefers-color-scheme: dark,
   which rendered this site's prose as dark-on-dark. The page is explicitly
   light-themed via <html data-theme="light">; these rules are the belt-and-
   braces so the layout is correct even if Pico changes its defaults.
   --------------------------------------------------------------------------- */
:root, :host, [data-theme="light"] {
  color-scheme: light;
  --pico-background-color: #faf6ef;
  --pico-color: #211d2b;
  --pico-card-background-color: transparent;
  --pico-card-sectioning-background-color: transparent;
  --pico-card-box-shadow: none;
  --pico-blockquote-border-color: rgba(33, 29, 43, .16);
}
article, aside, main, section, figure, blockquote, hgroup {
  background: transparent;
  background-color: transparent;
  box-shadow: none;
  border-radius: 0;
}
article, aside {
  padding: 0;
  margin: 0;
  border: 0;
}
main > *, body > header, body > footer { margin: 0; }
figure { margin-inline: 0; }
button.nav-toggle { width: auto; margin: 0; }

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: var(--sienna); color: var(--bone); }

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

h1, h2, h3, h4, .wordmark, .eyebrow, nav a, .nextlink, .disclosure-title {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "wdth" 100, "opsz" 14;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 1rem; }
h2 {
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  line-height: 1.18; letter-spacing: -.018em;
  margin: 3.1rem 0 .95rem; color: var(--violet-dark);
}
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.01em; margin: 2.2rem 0 .6rem; color: var(--violet-dark); }

p { margin: 0 0 1.35rem; }
strong { font-weight: 600; color: var(--violet-deep); }
em { font-style: italic; }

.lede {
  font-size: clamp(1.16rem, 2.1vw, 1.38rem);
  line-height: 1.56;
  color: var(--violet-dark);
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-block;
  font-size: .715rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sienna);
  margin: 0 0 1.1rem;
}

/* ---------- Links --------------------------------------------------------- */

a { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: rgba(76, 58, 99, .35); transition: color .16s ease, text-decoration-color .16s ease; }
a:hover, a:focus-visible { color: var(--sienna); text-decoration-color: var(--sienna); }
a.outbound { text-decoration-color: rgba(47, 143, 147, .55); }
a.outbound:hover { color: var(--turq); text-decoration-color: var(--turq); }
:focus-visible { outline: 2px solid var(--turq); outline-offset: 3px; }

/* ---------- Horizon rule (the site's signature divider) ------------------- */

.horizon { border: 0; margin: 3.4rem 0; height: 5px; position: relative; }
.horizon::before, .horizon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--rule);
}
.horizon::before { top: 0; }
.horizon::after  { bottom: 0; background: var(--rule-soft); }

/* ---------- Shell / header ------------------------------------------------ */

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding-inline: var(--gutter); }

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, .94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.15rem; }

.wordmark {
  font-size: 1.02rem; letter-spacing: -.015em; font-weight: 700;
  color: var(--violet-deep); text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .55rem;
}
.wordmark:hover { color: var(--sienna); }
.wordmark .mark {
  width: 1.35rem; height: 1.35rem; flex: 0 0 auto; border: 1px solid var(--violet);
  position: relative; border-radius: 1px;
}
.wordmark .mark::before, .wordmark .mark::after {
  content: ""; position: absolute; left: 15%; right: 15%; height: 1px; background: var(--sienna);
}
.wordmark .mark::before { top: 42%; }
.wordmark .mark::after  { top: 58%; background: var(--violet); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule);
  color: var(--violet-dark); font-family: var(--display); font-size: .8rem;
  letter-spacing: .1em; text-transform: uppercase; padding: .5rem .8rem; cursor: pointer; border-radius: 2px;
}
.nav-toggle:hover { border-color: var(--sienna); color: var(--sienna); }

.mainnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.35rem; margin: 0; padding: 0; }
.mainnav a {
  font-size: .845rem; letter-spacing: .005em; text-decoration: none;
  color: var(--violet-dark); padding-block: .3rem; border-bottom: 1px solid transparent;
}
.mainnav a:hover { color: var(--sienna); border-bottom-color: var(--sienna); }
.mainnav a[aria-current="page"] { color: var(--sienna); border-bottom-color: var(--sienna); }

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

.hero { position: relative; background: var(--violet-deep); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .58; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, rgba(36, 26, 53, .93) 0%, rgba(36, 26, 53, .74) 42%, rgba(76, 58, 99, .34) 100%);
}
.hero-inner { position: relative; z-index: 2; padding-block: clamp(4.5rem, 13vw, 8.5rem); max-width: 46rem; }
.hero .eyebrow { color: var(--sienna-lt); }
.hero h1 { color: var(--bone); }
.hero .standfirst {
  color: rgba(250, 246, 239, .84);
  font-size: clamp(1.08rem, 2vw, 1.3rem); line-height: 1.55; margin: 0; max-width: 34rem;
}
.hero-plain { background: var(--violet-deep); }
.hero-plain::after { background: linear-gradient(105deg, rgba(36, 26, 53, .96), rgba(76, 58, 99, .78)); }

/* CSS-only entrance: ends visible, and a never-run animation leaves it visible. */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: riseIn .7s cubic-bezier(.2, .7, .3, 1) both; }
  .hero-inner > *:nth-child(2) { animation-delay: .07s; }
  .hero-inner > *:nth-child(3) { animation-delay: .14s; }
}

/* ---------- Article layout (asymmetric grid) ------------------------------ */

.page { padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }

@media (min-width: 62rem) {
  .layout { grid-template-columns: minmax(0, 1fr) 15rem; gap: 4.5rem; align-items: start; }
  .rail { position: sticky; top: 6.5rem; }
}

.prose { max-width: var(--measure); }
.prose > *:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.5rem; padding-left: 1.15rem; }
.prose li { margin-bottom: .7rem; }
.prose ul.commitments, .prose ul.reading { list-style: none; padding-left: 0; }
.prose ul.commitments > li, .prose ul.reading > li, .cards > li { list-style: none; }
.prose ul.commitments > li::marker, .prose ul.reading > li::marker, .cards > li::marker { content: ""; }
.prose ul.commitments li, .prose ul.reading li {
  border-left: 2px solid var(--rule); padding: .1rem 0 .1rem 1.15rem; margin-bottom: 1.35rem;
}
.prose ul.commitments li:hover, .prose ul.reading li:hover { border-left-color: var(--sienna); }

.figure { margin: 2.75rem 0; }
.figure img { border-radius: 2px; width: 100%; }
.figure figcaption {
  font-family: var(--display); font-size: .78rem; letter-spacing: .045em;
  color: var(--muted); margin-top: .7rem; line-height: 1.5;
}

/* ---------- Disclosure block (legal-status honesty) ----------------------- */

.disclosure {
  border: 1px solid var(--rule); border-left: 3px solid var(--sienna);
  background: var(--bone-alt); padding: 1.5rem 1.6rem .35rem; margin: 2.5rem 0 2.75rem;
}
.disclosure-title {
  font-size: .72rem !important; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sienna); margin: 0 0 .85rem !important; font-weight: 700;
}
.disclosure p { font-size: .965rem; line-height: 1.65; }

/* ---------- Rail ---------------------------------------------------------- */

.rail-block { border-top: 1px solid var(--ink); padding-top: .85rem; margin-bottom: 2.25rem; }
.rail-block h2 {
  font-size: .72rem !important; letter-spacing: .18em; text-transform: uppercase;
  color: var(--violet-dark); margin: 0 0 .8rem !important;
}
.rail-block ul { list-style: none; margin: 0; padding: 0; }
.rail-block li { margin-bottom: .55rem; }
.rail-block a { font-size: .885rem; text-decoration: none; color: var(--violet-dark); border-bottom: 1px solid var(--rule-soft); }
.rail-block a:hover { color: var(--sienna); border-bottom-color: var(--sienna); }
.rail-note { font-size: .82rem; line-height: 1.6; color: var(--muted); }

/* ---------- Next / prev --------------------------------------------------- */

.nextlink {
  display: inline-block; margin-top: 1rem; font-size: .95rem; letter-spacing: -.005em;
  text-decoration: none; border-bottom: 1px solid var(--sienna); color: var(--violet-dark); padding-bottom: .12rem;
}
.nextlink:hover { color: var(--sienna); }

/* ---------- Index cards (home) -------------------------------------------- */

.cards { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
@media (min-width: 48rem) { .cards { grid-template-columns: 1fr 1fr; } }
.cards li { border-bottom: 1px solid var(--rule); padding: 1.5rem 0; }
@media (min-width: 48rem) {
  .cards li:nth-child(odd) { padding-right: 2.5rem; border-right: 1px solid var(--rule); }
  .cards li:nth-child(even) { padding-left: 2.5rem; }
}
.cards .num { font-family: var(--display); font-size: .7rem; letter-spacing: .18em; color: var(--sienna); display: block; margin-bottom: .4rem; }
.cards a { font-family: var(--display); font-weight: 600; font-size: 1.08rem; text-decoration: none; color: var(--violet-deep); letter-spacing: -.015em; }
.cards a:hover { color: var(--sienna); }
.cards p { font-size: .92rem; color: var(--muted); margin: .4rem 0 0; line-height: 1.6; }

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

.sitefoot { background: var(--violet-deep); color: rgba(250, 246, 239, .74); margin-top: 0; }
.sitefoot a { color: rgba(250, 246, 239, .88); text-decoration-color: rgba(250, 246, 239, .3); }
.sitefoot a:hover { color: var(--sienna-lt); text-decoration-color: var(--sienna-lt); }

.foot-disclosure {
  border-bottom: 1px solid rgba(250, 246, 239, .16);
  padding-block: 1.5rem;
}
.foot-disclosure p {
  margin: 0; font-size: .9rem; line-height: 1.6; color: rgba(250, 246, 239, .9); max-width: 52rem;
}
.foot-cols { display: grid; gap: 2.25rem; padding-block: 2.5rem 1.5rem; }
@media (min-width: 48rem) { .foot-cols { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; } }
.foot-cols h2 {
  font-size: .71rem !important; letter-spacing: .19em; text-transform: uppercase;
  color: rgba(250, 246, 239, .55); margin: 0 0 .9rem !important; font-weight: 700;
}
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { margin-bottom: .5rem; }
.foot-cols a { font-size: .89rem; text-decoration: none; border-bottom: 1px solid transparent; }
.foot-cols a:hover { border-bottom-color: var(--sienna-lt); }
.foot-blurb { font-size: .9rem; line-height: 1.65; margin: 0; color: rgba(250, 246, 239, .7); max-width: 26rem; }
.foot-blurb .fname { font-family: var(--display); font-weight: 600; color: var(--bone); display: block; margin-bottom: .5rem; letter-spacing: -.01em; }
.foot-base {
  border-top: 1px solid rgba(250, 246, 239, .16); padding-block: 1.25rem 2rem;
  font-size: .8rem; color: rgba(250, 246, 239, .5);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ---------- 404 ----------------------------------------------------------- */

.notfound { text-align: left; padding-block: clamp(4rem, 12vw, 8rem); }
.notfound .code {
  font-family: var(--display); font-size: clamp(4rem, 16vw, 9rem); line-height: .85;
  color: var(--bone-alt); letter-spacing: -.05em; margin: 0 0 1rem; font-weight: 700;
}

/* ---------- Mobile nav ---------------------------------------------------- */

@media (max-width: 60rem) {
  .nav-toggle { display: inline-block; }
  .mainnav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bone); border-bottom: 1px solid var(--rule); padding: 1rem var(--gutter) 1.4rem;
  }
  .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; gap: .1rem; }
  .mainnav a { display: block; padding: .55rem 0; border-bottom: 1px solid var(--rule-soft); }
  .masthead-inner { position: relative; }
}

.nowrap { white-space: nowrap; }
.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--violet-deep); color: var(--bone);
  padding: .7rem 1.1rem; z-index: 100; text-decoration: none;
}
.skip-link:focus { left: 0; }

@media print {
  .masthead, .sitefoot, .rail { display: none; }
  body { background: #fff; }
}
