:root{
  --bg: #fbf7f0;
  --paper: #ffffff;
  --ink: #141414;
  --muted: #5b5b5b;
  --line: rgba(20,20,20,.10);
  --accent: #d97706; /* warm amber */
  --accent-2: #f59e0b;
  --max: 1080px;
  --radius: 14px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left: 16px;
  top: 16px;
  width:auto;
  height:auto;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 999;
}

/* Header */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    radial-gradient(circle, rgba(217,119,6,.16) 1px, transparent 1.5px) 0 0/18px 18px,
    radial-gradient(600px 160px at 50% 20px, rgba(245,158,11,.28), rgba(251,247,240,0) 70%),
    linear-gradient(to bottom, rgba(251,247,240,.96), rgba(251,247,240,.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  overflow: clip;
}
.site-header::after{
  content:"";
  position:absolute;
  inset:auto 0 0 0;
  height: 56px;
  pointer-events:none;
  background:
    radial-gradient(160px 46px at 20% 120%, rgba(217,119,6,.18) 0 60%, transparent 61%),
    radial-gradient(220px 56px at 55% 125%, rgba(245,158,11,.16) 0 60%, transparent 61%),
    radial-gradient(190px 50px at 85% 130%, rgba(217,119,6,.14) 0 60%, transparent 61%),
    linear-gradient(to top, rgba(245,158,11,.10), rgba(251,247,240,0));
}
.header-inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;
  color: inherit;
}
.brand-mark{
  height: 44px;
  width: auto;
  display:block;
}
.brand-name{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 650;
  letter-spacing: .2px;
}

.top-nav .nav-link{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  padding: .55rem .95rem;
  border-radius: 999px;
  font-weight: 650;

  background: rgba(255,255,255,.78);
  border: 1px solid rgba(20,20,20,.14);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.top-nav .nav-link:hover{
  background: rgba(255,255,255,.92);
  border-color: rgba(20,20,20,.20);
}
.top-nav .nav-link:focus-visible{
  outline: 2px solid rgba(245,158,11,.65);
  outline-offset: 3px;
}

/* Page layout */
.page{
  padding: 24px 18px 80px;
  position: relative;
}

.page::before{
  content:"";
  position:absolute;
  inset: 0;
  pointer-events:none;
  background:
    radial-gradient(circle, rgba(217,119,6,.06) 1px, transparent 1.6px) 0 0/22px 22px,
    radial-gradient(1200px 600px at 50% 0%, rgba(245,158,11,.08), rgba(251,247,240,0) 65%);
  opacity: .9;
}
.layout{ position: relative; z-index: 1; }

.layout{
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: start;
}

.content{
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(20,20,20,.08);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 8px 26px rgba(0,0,0,.03);
  backdrop-filter: blur(6px);
  position: relative;
}

/* Typography */
.content h1{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -.3px;
}
.content h2{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 26px;
  line-height: 1.2;
  margin: 34px 0 10px;
}
.content p{
  margin: 0 0 14px;
  color: var(--ink);
}
.content em{ color: var(--muted); }
.content a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(217,119,6,.25);
}
.content a:hover{
  border-bottom-color: rgba(217,119,6,.6);
}

.content hr{
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

/* Hide visible heading permalink markers (often rendered as '#') */
.content h1 a, .content h2 a, .content h3 a{
  border-bottom: none;
}
.content .header-anchor,
.content a[aria-hidden="true"],
.content a[href^="#"][aria-label*="permalink"]{
  display: none !important;
}

/* TOC */
.toc{
  position: sticky;
  top: 84px;
}
.toc.is-empty{ display:none; }

.toc-inner{
  background: rgba(255,255,255,.60);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  backdrop-filter: blur(6px);
}

.toc-title{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 650;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.toc-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.toc-link{
  display:block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration:none;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid transparent;
}
.toc-link:hover{
  background: rgba(255,255,255,.85);
  border-color: var(--line);
}
.toc-link.is-active{
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.25);
  color: #7c2d12;
}

/* Responsive */
@media (max-width: 960px){
  .layout{
    grid-template-columns: 1fr;
  }
  .toc{
    position: relative;
    top: auto;
    order: -1;
  }
}

/* CTA button */
a.cta-button, a.cta{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(217,119,6,.35);
  background: rgba(245,158,11,.14);
  color: #7c2d12;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(0,0,0,.04);
  border-bottom: none;
}
a.cta-button:hover, a.cta:hover{
  background: rgba(245,158,11,.20);
  border-color: rgba(217,119,6,.55);
}
a.cta-button:focus, a.cta:focus{
  outline: 2px solid rgba(217,119,6,.55);
  outline-offset: 3px;
}

/* Homepage seal mark (bottom-right, paper-fade) */
.home-mark{
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: min(320px, 42%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65; /* clearly present, not watermark-faint */
}

.home-mark img{
  width: 100%;
  height: auto;
  display: block;

  /* Pencil → paper integration */
  filter:
    grayscale(1)
    contrast(1.15)
    brightness(0.98);

  mix-blend-mode: multiply;

  /* Paper fade edge */
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.85) 65%,
    rgba(0,0,0,0.55) 72%,
    rgba(0,0,0,0.25) 78%,
    rgba(0,0,0,0) 86%
  );
  mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.85) 65%,
    rgba(0,0,0,0.55) 72%,
    rgba(0,0,0,0.25) 78%,
    rgba(0,0,0,0) 86%
  );
}

/* Ensure content always reads above the seal */
.content > :not(.home-mark){
  position: relative;
  z-index: 1;
}

/* Reserve breathing room so text never overlaps seal */
body.is-home .content{
  padding-bottom: 180px;
}


/* ===============================
   READ MODE TOGGLE (Essay/Poem)
   =============================== */

.read-toggle{
  margin: 1.5rem 0 2.5rem;
  font-size: 0.95rem;
  color: var(--muted, rgba(0,0,0,.6));
}

.read-toggle a{
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.read-toggle a[aria-current="true"]{
  color: var(--ink, rgba(0,0,0,.85));
  border-bottom-color: rgba(0,0,0,.25);
}

.read-toggle a:hover{
  border-bottom-color: rgba(0,0,0,.35);
}

/* ===============================
   POETIC MODE (CSS-ONLY CADENCE)
   =============================== */

/* Support both html.read-poem (preferred) and body.read-poem (fallback) */
html.read-poem .content,
body.read-poem .content{
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

html.read-poem .content p,
body.read-poem .content p{
  line-height: 1.9;
  margin-bottom: 1.6em;
}

html.read-poem .content h2,
html.read-poem .content h3,
body.read-poem .content h2,
body.read-poem .content h3{
  font-weight: 500;
  opacity: 0.8;
  margin-top: 3.2rem;
  margin-bottom: 0.9rem;
}

html.read-poem .content ul,
html.read-poem .content ol,
body.read-poem .content ul,
body.read-poem .content ol{
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

html.read-poem .content li,
body.read-poem .content li{
  margin-bottom: 0.9em;
}

html.read-poem .content li::before,
body.read-poem .content li::before{
  content: "— ";
  opacity: 0.35;
}

/* Keep TOC readable even in poem mode */
html.read-poem .toc .toc-link,
body.read-poem .toc .toc-link{
  line-height: 1.4;
}

.poem-seal {
  display: none;
  margin: 4rem auto 5rem;
  max-width: 420px;
  opacity: 0.28;
  pointer-events: none;
}

.poem-seal img {
  width: 100%;
  height: auto;
  filter: sepia(10%) contrast(95%);
}

/* Reveal only in poem mode */
body.read-poem .poem-seal {
  display: block;
}

/* =========================================================
   Digitalisman: Read-mode toggle + poem mode + soft header
   (Appended overrides — safe to keep existing CSS above)
   ========================================================= */

/* ===== Header: subtle sunrise + quiet digital texture ===== */
.site-header{
  position:relative;
  border-bottom:1px solid rgba(0,0,0,.06);
  background:
    linear-gradient(180deg, rgba(255,247,235,.92) 0%, rgba(252,244,232,.72) 60%, rgba(250,244,235,.58) 100%),
    radial-gradient(circle at 15% 35%, rgba(232,160,78,.10) 0 1px, transparent 1px 18px);
  background-size:auto, 18px 18px;
  overflow:hidden;
}
.site-header::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-6px;
  height:64px;
  pointer-events:none;
  opacity:.18;
  background:
    radial-gradient(120% 80% at 15% 110%, rgba(232,160,78,.9) 0 45%, transparent 55%),
    radial-gradient(120% 80% at 55% 120%, rgba(232,160,78,.7) 0 42%, transparent 58%),
    radial-gradient(120% 80% at 88% 115%, rgba(232,160,78,.65) 0 40%, transparent 60%);
  filter:blur(.2px);
}
.header-inner{ position:relative; z-index:1; }

/* ===== Brand + top nav button (Readiness) ===== */
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}
.brand-mark{
  width:32px;
  height:32px;
  object-fit:contain;
  display:block;
}
.top-nav .nav-link{
  display:inline-flex;
  align-items:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  background:rgba(255,255,255,.55);
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  text-decoration:none;
  color:inherit;
  font-weight:600;
}
.top-nav .nav-link:hover{ background:rgba(255,255,255,.8); }

/* ===== CTA button (“Begin with Readiness →”) ===== */
a.cta-button,
a.cta-button:visited{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:12px 16px;
  border-radius:10px;
  border:1px solid rgba(232,160,78,.45);
  background:rgba(232,160,78,.18);
  color:#7a3d00;
  font-weight:700;
  text-decoration:none;
}
a.cta-button:hover{ background:rgba(232,160,78,.26); }

/* ===== Read-mode toggle ===== */
.read-toggle{
  margin:18px 0 12px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.read-toggle__label{
  color:rgba(0,0,0,.72);
  font-weight:600;
}
.read-toggle__group{
  display:inline-flex;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(255,255,255,.55);
  border-radius:999px;
  padding:4px;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
}
.read-toggle__btn{
  border:0;
  background:transparent;
  padding:8px 12px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  color:rgba(0,0,0,.72);
}
.read-toggle__btn[aria-pressed="true"]{
  background:rgba(232,160,78,.22);
  color:#7a3d00;
  box-shadow:inset 0 0 0 1px rgba(232,160,78,.35);
}

/* ===== Poem mode: slow the page down ===== */
html[data-read-mode="poem"] .content{
  letter-spacing:0.01em;
}
html[data-read-mode="poem"] .content p{
  line-height:1.9;
  margin:0 0 20px;
}
html[data-read-mode="poem"] .content h2{
  margin-top:44px;
}
html[data-read-mode="poem"] .toc-inner{
  opacity:.92;
}

/* ===== Inline poem seal (pause-tree-poem.png) ===== */
.poem-seal-inline{
  display:none;
  margin:16px 0 26px;
  padding:10px 0;
}
html[data-read-mode="poem"] .poem-seal-inline{
  display:block;
}
.poem-seal-inline img{
  display:block;
  width:100%;
  max-width:340px; /* reduce if you want smaller */
  height:auto;
  margin:0;
  border-radius:14px;
  box-shadow:
    0 18px 40px rgba(0,0,0,.06),
    inset 0 0 0 1px rgba(0,0,0,.06);
  opacity:.92;
}
