/* ==============================================================
   dennisli.co — shared site chrome
   Token + type + nav + seam + footer primitives
   Page-specific CSS stays inline on each HTML file.
   ============================================================== */

:root {
  --pine: #2A3832;
  --pine-deep: #1E2824;
  --pine-ink: #141B18;
  --pine-soft: #3A4A42;
  --ochre: #C68847;
  --ochre-soft: #D9A668;
  --ochre-warm: #B87938;
  --bone: #EFE5D0;
  --bone-soft: #F8F2E1;
  --bone-dim: rgba(239, 229, 208, 0.72);
  --bone-mute: rgba(239, 229, 208, 0.52);
  --hairline: rgba(239, 229, 208, 0.16);
  --hairline-soft: rgba(239, 229, 208, 0.08);
  --gold-glow: rgba(198, 136, 71, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: var(--bone);
  background: var(--pine-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Paper-grain + vignette — workshop texture, not noise */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(198, 136, 71, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(198, 136, 71, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, var(--pine-deep) 0%, var(--pine-ink) 100%);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  z-index: -1;
}

a { color: var(--ochre-soft); text-decoration: none; transition: color 200ms ease; }
a:hover, a:focus-visible { color: var(--bone-soft); }
::selection { background: var(--ochre); color: var(--pine-ink); }

/* Typography primitives */
.italic { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: 0.005em; }
.caps { font-family: 'Lato', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: 0.22em; }
.caps-tight { font-family: 'Lato', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: 0.15em; }
.eyebrow { font-family: 'Lato', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: 0.32em; font-size: 0.72rem; color: var(--ochre-soft); }

/* ---------- Kintsugi corner seams ---------- */
.kintsugi-seam {
  position: fixed;
  width: clamp(280px, 55vmin, 560px);
  height: clamp(280px, 55vmin, 560px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  transition: opacity 160ms linear;
  will-change: opacity;
}
.kintsugi-seam.tl { top: 0; left: 0; }
.kintsugi-seam.br { bottom: 0; right: 0; }
@media (max-width: 960px) { .kintsugi-seam { display: none; } }

.kintsugi-seam path.crack {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-seam 2800ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.kintsugi-seam.tl path.crack { stroke: url(#gold-grad-tl); animation-delay: 400ms; }
.kintsugi-seam.br path.crack { stroke: url(#gold-grad-br); animation-delay: 1100ms; }

.kintsugi-seam path.shimmer {
  fill: none;
  stroke: rgba(239, 229, 208, 0.28);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-seam 2800ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.kintsugi-seam.tl path.shimmer { animation-delay: 700ms; }
.kintsugi-seam.br path.shimmer { animation-delay: 1400ms; }

.kintsugi-seam path.branch {
  fill: none;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-seam 2000ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
  filter: drop-shadow(0 0 3px var(--gold-glow));
}
.kintsugi-seam.tl path.branch { stroke: url(#gold-grad-tl); animation-delay: 1400ms; }
.kintsugi-seam.br path.branch { stroke: url(#gold-grad-br); animation-delay: 2100ms; }

@keyframes draw-seam { to { stroke-dashoffset: 0; } }

/* ---------- Layout container ---------- */
main, nav, footer { position: relative; z-index: 1; }
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
}
.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2.5rem;
}
@media (max-width: 720px) {
  .wrap, .wrap-narrow { padding: 0 1.25rem; }
}

/* ---------- Nav ---------- */
nav.top {
  position: sticky; top: 0;
  padding: 1.25rem 0;
  background: linear-gradient(180deg, rgba(20, 27, 24, 0.85) 0%, rgba(20, 27, 24, 0.55) 70%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}
nav.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.handle {
  font-size: 0.72rem;
  color: var(--bone-soft);
  letter-spacing: 0.22em;
}
.handle a { color: inherit; }
.handle a:hover { color: var(--ochre-soft); }
.handle .at { color: var(--ochre-soft); }

nav.top .nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
nav.top a.nav-link {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--bone-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
nav.top a.nav-link:hover,
nav.top a.nav-link:focus-visible,
nav.top a.nav-link.active {
  color: var(--bone-soft);
  border-bottom-color: var(--ochre);
}
nav.top a.nav-link.active { color: var(--bone-soft); }

nav.top a.ghost {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--bone);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}
nav.top a.ghost:hover { border-color: var(--ochre); color: var(--bone-soft); }

@media (max-width: 640px) {
  nav.top .nav-links { gap: 1rem; }
  nav.top a.nav-link { font-size: 0.65rem; letter-spacing: 0.24em; }
}

/* ---------- Section head ---------- */
.note-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.note-num {
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--ochre-soft);
  text-transform: uppercase;
}
.note-hair {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--ochre) 0%, transparent 100%);
  opacity: 0.4;
  max-width: 140px;
}

/* Shared H2 treatment */
.note h2, h2.fraunces {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.05;
  color: var(--bone-soft);
  letter-spacing: -0.01em;
}

/* ---------- Prose — for about + note bodies ---------- */
.prose {
  font-size: 1.125rem;
  color: var(--bone-dim);
  line-height: 1.72;
}
.prose p { margin: 0 0 1.4rem; max-width: 62ch; }
.prose p em,
.prose em {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--bone-soft);
  font-weight: 500;
}
.prose strong {
  color: var(--bone-soft);
  font-weight: 700;
}
.prose ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  max-width: 62ch;
}
.prose ul li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
}
.prose ul li::before {
  content: "·";
  color: var(--ochre);
  position: absolute;
  left: 0.35rem;
  top: -0.05rem;
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
}
.prose blockquote {
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.75rem;
  border-left: 2px solid var(--ochre);
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--bone-soft);
  max-width: 56ch;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 3rem 0;
  max-width: 200px;
}
.prose a {
  border-bottom: 1px dotted rgba(217, 166, 104, 0.45);
  padding-bottom: 1px;
  transition: color 200ms ease, border-color 200ms ease;
}
.prose a:hover,
.prose a:focus-visible {
  border-bottom-color: var(--ochre-soft);
}

/* Drop cap for the first paragraph of an essay/about body */
.prose.dropcap > p:first-child::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 3.6rem;
  color: var(--ochre-soft);
  float: left;
  line-height: 0.9;
  padding: 0.15rem 0.6rem 0 0;
}

/* ---------- Footer ---------- */
footer.site {
  padding: 3.5rem 0 4rem;
  border-top: 1px solid var(--hairline-soft);
  text-align: center;
  margin-top: 6rem;
}
footer.site .mark {
  width: 44px; height: 44px;
  margin: 0 auto 1.25rem;
  opacity: 0.55;
}
footer.site .signoff {
  font-size: 0.82rem;
  color: var(--bone-mute);
  letter-spacing: 0.04em;
}
footer.site .signoff em {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--ochre-soft);
  margin: 0 0.5rem;
}
footer.site .footer-links {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}
footer.site .footer-links a {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--bone-mute);
}
footer.site .footer-links a:hover { color: var(--ochre-soft); }

/* ---------- Scroll reveals ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.65, 0, 0.35, 1), transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Scroll-progress seam ----------
   A thin ochre hairline at the top of the viewport that grows L→R as the reader scrolls.
   Kintsugi in behavior: the gold crack spreading across the bone of the page.
   Single signature motion — added 2026-04-23 per Direction Council synthesis.
   Respects prefers-reduced-motion (hidden entirely, not just de-animated). */
.scroll-seam {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--ochre-warm) 0%, var(--ochre) 45%, var(--ochre-soft) 100%);
  box-shadow: 0 0 10px var(--gold-glow);
  z-index: 20;
  pointer-events: none;
  will-change: width;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .kintsugi-seam path.crack,
  .kintsugi-seam path.shimmer,
  .kintsugi-seam path.branch { stroke-dashoffset: 0 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .scroll-seam { display: none !important; }
}
