/* ALIVE Library — visual system
   Warm paper, deep ink, quiet structure. Light mode only for launch. */

:root {
  --ivory: #ECEAE2;      /* background paper */
  --obsidian: #0C0B09;   /* body text */
  --void: #262420;       /* illustration ink */
  --amber: #706A5C;      /* secondary / notes / metadata */
  --gold: #88867A;       /* the single accent */
  --gold-soft: rgba(136, 134, 122, 0.30);
  --paper-2: #E4E1D7;    /* very subtly deeper paper for cards */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;

  --measure: 42rem;      /* ~672px reading column */
  --page: 76rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--obsidian);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- accessibility helpers ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--obsidian); color: var(--ivory);
  padding: .6rem 1rem; font-family: var(--sans); font-size: .9rem;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }
.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;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---- reading progress ---- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--gold); z-index: 50;
  transition: width .12s linear;
}

/* ---- header / nav ---- */
.site-head {
  max-width: var(--page); margin: 0 auto;
  padding: 2.2rem 1.6rem 1.4rem;
  display: flex; flex-direction: column; gap: 1rem;
  align-items: center; text-align: center;
}
.wordmark {
  font-family: var(--sans); font-weight: 600; letter-spacing: .18em;
  font-size: .82rem; text-transform: uppercase; text-decoration: none;
  color: var(--obsidian);
}
.wordmark span { color: var(--amber); }
.theme-nav {
  font-family: var(--sans); font-size: .9rem;
  display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center;
}
.theme-nav a {
  color: var(--amber); text-decoration: none; padding-bottom: 2px;
  border-bottom: 1.5px solid transparent; transition: color .3s, border-color .3s;
}
.theme-nav a:hover { color: var(--obsidian); border-bottom-color: var(--gold); }
.theme-nav a.active { color: var(--obsidian); border-bottom-color: var(--gold); }
.theme-nav .dot { color: var(--gold-soft); }

main { max-width: var(--page); margin: 0 auto; padding: 1rem 1.6rem 4rem; }

/* ---- intro ---- */
.intro { max-width: var(--measure); margin: 1.5rem auto 3rem; text-align: center; }
.intro h1 {
  font-size: clamp(2.6rem, 6vw, 3.4rem); font-weight: 600;
  margin: 0 0 1rem; line-height: 1.1;
}
.intro p { color: var(--amber); font-size: 1.18rem; }

/* ---- big start screen (home) ---- */
.card {
  display: block; text-decoration: none; color: inherit;
  transition: transform .35s ease;
}
.tag {
  display: inline-block; font-family: var(--sans); font-size: .68rem;
  font-weight: 500; letter-spacing: .14em; color: var(--amber);
  margin: 0 0 .35rem;
}
.start {
  min-height: 78vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 3rem 0 2rem; gap: 1.2rem;
}
.start-kicker {
  font-family: var(--sans); font-size: .78rem; font-weight: 500;
  letter-spacing: .22em; color: var(--amber); margin: 0;
}
.start-title {
  font-size: clamp(3.6rem, 12vw, 7rem); font-weight: 600; line-height: .95;
  margin: 0; letter-spacing: -.01em;
}
.start-sub {
  max-width: 34rem; font-size: 1.3rem; color: var(--void); margin: .4rem 0 0;
}
.start-cue {
  margin-top: 1.4rem; font-family: var(--sans); font-size: 1.5rem;
  color: var(--gold); text-decoration: none; line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.home-about {
  max-width: var(--measure); margin: 2rem auto 4rem; text-align: center;
}
.home-about p { font-size: 1.25rem; margin: 1rem 0 0; }

.section-label {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--amber);
  text-align: center; margin: 0 0 1.8rem;
}

/* theme cards (home) */
.theme-grid {
  display: grid; gap: 1.4rem; grid-template-columns: repeat(2, 1fr);
  max-width: 56rem; margin: 0 auto;
}
.theme-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--gold-soft); border-radius: 5px;
  padding: 1.6rem 1.7rem; background: var(--paper-2);
  transition: transform .35s ease, border-color .3s ease;
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.theme-card-title { font-size: 1.6rem; font-weight: 600; margin: .5rem 0 .4rem; line-height: 1.15; }
.theme-card-desc { font-size: 1rem; color: var(--amber); margin: 0 0 1rem; line-height: 1.55; }
.explore { font-family: var(--sans); font-size: .9rem; font-weight: 500; color: var(--gold); }
.theme-card:hover .explore { color: var(--obsidian); }

/* ---- entry list (theme page) ---- */
.entry-list { max-width: var(--measure); margin: 1.5rem auto 0; }
.entry-list .card {
  display: block; padding: 1.4rem 0; border-top: 1px solid var(--gold-soft);
}
.entry-list .card:last-child { border-bottom: 1px solid var(--gold-soft); }
.card-title { font-size: 1.55rem; font-weight: 600; margin: 0 0 .35rem; line-height: 1.2; }
.card:hover .card-title { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.card-desc { font-size: 1.05rem; color: var(--amber); margin: 0; line-height: 1.55; }

/* ---- theme hero ---- */
.theme-hero {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; align-items: center;
  max-width: var(--page); margin: 1.5rem auto 1rem;
}
.theme-hero-img { width: 100%; border-radius: 4px; }
.theme-hero h1 { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 600; margin: .3rem 0 .6rem; }
.theme-hero p { color: var(--amber); font-size: 1.12rem; margin: 0; }

/* ---- entry page ---- */
.entry { max-width: var(--measure); }
.entry-head { margin: 1.5rem 0 1.2rem; }
.entry-title { font-size: clamp(2.3rem, 5vw, 3.1rem); font-weight: 600; line-height: 1.12; margin: .3rem 0 .5rem; }
.updated { font-family: var(--sans); font-size: .8rem; margin: 0 0 1.4rem; }
.entry-cover { width: 100%; border-radius: 4px; margin: .5rem 0 0; }

.definition {
  font-size: 1.45rem; line-height: 1.45; font-style: italic;
  color: var(--void); border-left: 2px solid var(--gold);
  padding-left: 1.2rem; margin: 1.8rem 0 2.4rem;
}

/* numbered-line section system */
.numbered { margin: 2rem 0; }
.step { display: grid; grid-template-columns: 2.6rem 1fr; gap: .6rem; position: relative; }
.step-num {
  font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--amber);
  padding-top: .55rem;
}
.step-body { border-left: 1.5px solid var(--gold-soft); padding: 0 0 1.6rem 1.4rem; }
.step:last-child .step-body { padding-bottom: .5rem; }
.step-body h2 { font-size: 1.6rem; font-weight: 600; margin: .3rem 0 .8rem; }
.step-body p { margin: 0 0 1.1rem; }
.step-body ul, .step-body ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.step-body li { margin: 0 0 .4rem; }
.step-body strong { font-weight: 600; }

/* related + references */
.related, .references { max-width: var(--measure); margin: 2.6rem 0 0; }
.related h2, .references h2 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: .01em; margin: 0 0 .8rem; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 0 0 .5rem; font-size: 1.05rem; }
.related a { color: var(--obsidian); text-decoration: none; border-bottom: 1px solid var(--gold-soft); }
.related a:hover { border-bottom-color: var(--gold); }
.refs { font-family: var(--sans); font-size: .92rem; color: var(--amber); line-height: 1.55; padding-left: 1.3rem; }
.refs li { margin: 0 0 .55rem; }
.ref-link { color: var(--gold); text-decoration: none; }
.ref-link:hover { text-decoration: underline; }

/* about prose */
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.2rem; }
.prose a, .definition a { color: var(--obsidian); border-bottom: 1px solid var(--gold); text-decoration: none; }

/* ---- follow ---- */
.follow {
  max-width: var(--measure); margin: 3.5rem auto 0; padding: 2rem 0 0;
  border-top: 1px solid var(--gold-soft); text-align: center;
}
.follow-lead { font-size: 1.2rem; margin: 0; line-height: 1.5; }
.follow-lead a { color: var(--obsidian); text-decoration: none; border-bottom: 1px solid var(--gold); }
.follow-lead a:hover { border-bottom-color: var(--obsidian); }

.muted { color: var(--amber); }

/* ---- footer ---- */
.site-foot {
  max-width: var(--page); margin: 4rem auto 0; padding: 2rem 1.6rem 3rem;
  border-top: 1px solid var(--gold-soft); text-align: center;
  font-family: var(--sans); font-size: .85rem;
}
.site-foot p { margin: .2rem 0; }
.site-foot a { color: var(--obsidian); text-decoration: none; border-bottom: 1px solid var(--gold); }

/* ---- margin-note system (ready for later use)
   Add <aside class="note">…</aside> right after a paragraph inside .step-body.
   On desktop it floats into the right margin; on mobile it falls inline. ---- */
.step-body { position: relative; }
.note {
  font-family: var(--hand); color: var(--amber); font-size: 1.25rem; line-height: 1.3;
}
@media (min-width: 1080px) {
  .note {
    position: absolute; right: -16rem; width: 13rem; text-align: left;
    border-left: 1.5px solid var(--gold-soft); padding-left: .8rem;
  }
}
@media (max-width: 1079px) {
  .note { display: block; font-style: normal; margin: -.4rem 0 1.1rem; padding-left: .9rem; border-left: 1.5px solid var(--gold-soft); }
}

/* ---- responsive ---- */
@media (max-width: 880px) {
  .theme-grid { grid-template-columns: 1fr; }
  .theme-hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1.12rem; }
  main { padding: 1rem 1.2rem 3rem; }
  .step { grid-template-columns: 1.9rem 1fr; }
  .step-body { padding-left: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
