/* =========================================================
   Sam Moyes — Notes from the Shed
   Solarpunk / textural. Day theme by default, night theme at dusk.
   ========================================================= */

:root {
  /* day */
  --paper: #f1e8d0;
  --paper-2: #e8dbb8;
  --card: #f7f0dc;
  --ink: #1f2b1d;
  --muted: #5d6450;
  --line: rgba(31, 43, 29, 0.16);
  --green: #2f5a3f;
  --green-deep: #1f3d2b;
  --moss: #7a9a52;
  --sage: #b8c797;
  --ochre: #dfa53a;
  --terracotta: #bb5a35;
  --kraft: #d4b483;
  --on-green: #f1e8d0;

  --sky-top: #bfe0d8;
  --sky-bottom: #f7e2ae;
  --sun: #f2b33d;
  --glow: rgba(246, 190, 80, 0.55);
  --hill-3: #b9c897;
  --hill-2: #86a35b;
  --hill-1: #3f6a46;
  --stars: 0;

  --display: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* night */
:root[data-theme="dark"] {
  --paper: #121d17;
  --paper-2: #18261e;
  --card: #1c2b22;
  --ink: #ede3c6;
  --muted: #a3aa8f;
  --line: rgba(237, 227, 198, 0.14);
  --green: #8cc596;
  --green-deep: #0c1611;
  --moss: #7fa05a;
  --sage: #3d5438;
  --ochre: #eab95a;
  --terracotta: #de7f5c;
  --kraft: #8c7350;
  --on-green: #ede3c6;

  --sky-top: #09151f;
  --sky-bottom: #24384a;
  --sun: #efe4c4;
  --glow: rgba(239, 228, 196, 0.18);
  --hill-3: #2b3e3a;
  --hill-2: #1f332a;
  --hill-1: #14241b;
  --stars: 1;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121d17;
    --paper-2: #18261e;
    --card: #1c2b22;
    --ink: #ede3c6;
    --muted: #a3aa8f;
    --line: rgba(237, 227, 198, 0.14);
    --green: #8cc596;
    --green-deep: #0c1611;
    --moss: #7fa05a;
    --sage: #3d5438;
    --ochre: #eab95a;
    --terracotta: #de7f5c;
    --kraft: #8c7350;
    --on-green: #ede3c6;

    --sky-top: #09151f;
    --sky-bottom: #24384a;
    --sun: #efe4c4;
    --glow: rgba(239, 228, 196, 0.18);
    --hill-3: #2b3e3a;
    --hill-2: #1f332a;
    --hill-1: #14241b;
    --stars: 1;
    color-scheme: dark;
  }
}

/* ---------- Base & texture ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint laid-paper lines */
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--ink) 2.5%, transparent) 3px 4px);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(18px, 1.25vw, 20px);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}
/* paper grain over everything */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.15 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body { background-image: none; }
:root[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: 0.08; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background-image: none; }
  :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; opacity: 0.08; }
}

img { max-width: 100%; display: block; }
a { color: inherit; }
strong { font-weight: 600; }
em { font-style: italic; }
::selection { background: var(--ochre); color: #1f2b1d; }
:focus-visible { outline: 2px dashed var(--terracotta); outline-offset: 4px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.center { text-align: center; }

.skip { position: absolute; left: -9999px; top: 12px; background: var(--ochre); color: #1f2b1d; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 12px; }

/* ---------- Type ---------- */
.stamp {
  display: inline-block;
  font: 500 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--terracotta);
  padding: 8px 12px 7px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  transform: rotate(-1.5deg);
  margin: 0 0 28px;
}
.stamp-light { color: var(--ochre); }

.section-title, .hero-title, .contact-title, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 500;
}
.section-title {
  font-size: clamp(40px, 5.6vw, 80px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
}
.section-title em, .hero-title em, .contact-title em { color: var(--green); font-weight: 400; }
.section-sub { color: var(--muted); max-width: 560px; margin: 24px 0 0; font-size: 1.05em; }
.section-head { margin-bottom: clamp(48px, 7vw, 88px); }
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px 14px;
  border-radius: 999px;
  background: var(--green); color: var(--on-green);
  border: 1.5px solid var(--green);
  font: 500 15px/1 var(--mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--green) 45%, #000);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
:root[data-theme="dark"] .btn:not(.btn-ghost) { color: #13201a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.btn-ghost) { color: #13201a; } }
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 color-mix(in srgb, var(--green) 45%, #000); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--green) 45%, #000); }
.btn.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn.btn-ghost:hover { box-shadow: 0 5px 0 var(--ink); }

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); transform: rotate(20deg); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  transition: background 0.4s, border-color 0.4s, padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-top: 10px; padding-bottom: 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; }
.brand-sun { width: 30px; height: 30px; }
.brand-sun circle { fill: var(--ochre); }
.brand-sun .rays { stroke: var(--ochre); stroke-width: 2.4; stroke-linecap: round; transform-origin: 20px 20px; transition: transform 1.2s var(--ease); }
.brand:hover .rays { transform: rotate(90deg); }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  padding: 8px 14px;
  font: 400 13px/1 var(--mono);
  text-transform: uppercase; letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.3s, background 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: color-mix(in srgb, var(--sage) 45%, transparent); }
.nav-actions { display: flex; gap: 8px; }
.menu-btn { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-btn span { display: block; width: 16px; height: 1.6px; background: currentColor; transition: transform 0.3s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }
.menu-btn:hover { transform: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter); gap: 6px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a { font: 400 clamp(44px, 12vw, 68px)/1.15 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; text-decoration: none; }
.mobile-menu a:nth-child(odd) { font-style: italic; color: var(--green); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding-top: clamp(120px, 16vh, 180px);
  overflow: hidden;
}
.hero-copy { position: relative; z-index: 2; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.hero-title {
  font-size: clamp(50px, 8.4vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 32px;
  max-width: 12ch;
}
.underline { position: relative; white-space: nowrap; }
.underline::after {
  content: "";
  position: absolute; left: -2%; right: -2%; bottom: -0.06em; height: 0.28em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M4 16 C60 6 120 20 180 10 S270 8 296 14' fill='none' stroke='%23dfa53a' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  z-index: -1;
}
.hero-lede { max-width: 580px; font-size: clamp(19px, 1.5vw, 22px); color: var(--muted); margin: 0 0 36px; }
.hero-lede strong { color: var(--ink); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.landscape {
  position: relative;
  margin-top: auto;
  height: clamp(240px, 46vw, 560px);
  margin-top: clamp(24px, 4vw, 48px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.landscape svg { width: 100%; height: 100%; display: block; }
.sky-top { stop-color: var(--sky-top); }
.sky-bottom { stop-color: var(--sky-bottom); }
.glow-in { stop-color: var(--glow); }
.glow-out { stop-color: var(--glow); stop-opacity: 0; }
.sun { fill: var(--sun); transition: fill 0.8s; }
.sun-rays { stroke: var(--sun); stroke-width: 6; stroke-linecap: round; transform-origin: 980px 300px; animation: spin 90s linear infinite; opacity: calc(1 - var(--stars)); transition: opacity 0.8s; }
.stars circle { fill: #fff6dc; opacity: var(--stars); transition: opacity 0.8s; animation: twinkle 3s ease-in-out infinite alternate; }
.stars circle:nth-child(3n) { animation-delay: -1.2s; }
.stars circle:nth-child(3n+1) { animation-delay: -2.1s; }
@keyframes twinkle { to { opacity: calc(var(--stars) * 0.35); } }
.birds path { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; opacity: 0.55; }
.birds { animation: glide 22s ease-in-out infinite alternate; }
@keyframes glide { to { transform: translate(90px, -20px); } }
.hill-3 { fill: var(--hill-3); } .hill-2 { fill: var(--hill-2); } .hill-1 { fill: var(--hill-1); }
.hill-3, .hill-2, .hill-1 { transition: fill 0.8s; }
.windmill .tower { fill: none; stroke: var(--green-deep); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
:root[data-theme="dark"] .windmill .tower, :root[data-theme="dark"] .windmill .blades path { stroke: #3c5446; }
.windmill .blades { transform-origin: 352px 245px; animation: spin 7s linear infinite; }
.windmill .blades path { stroke: var(--green-deep); stroke-width: 3; stroke-linecap: round; }
.windmill .blades circle { fill: var(--green-deep); }
.solar rect { fill: #3a5f89; stroke: #cfe9f5; stroke-width: 2; }
.solar { filter: drop-shadow(0 2px 4px rgba(20, 40, 60, 0.25)); }
:root[data-theme="dark"] .solar rect { fill: #1f3348; stroke: #5f88a0; }
.gums .trunk { fill: none; stroke: #e7dcc4; stroke-width: 5; stroke-linecap: round; }
.gums .canopy { fill: #5e7f4a; }
:root[data-theme="dark"] .gums .trunk { stroke: #5a6456; }
:root[data-theme="dark"] .gums .canopy { fill: #223a2a; }
.furrows { fill: none; stroke: color-mix(in srgb, var(--hill-1) 60%, #000); stroke-width: 2.5; stroke-linecap: round; opacity: 0.5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .windmill .tower, :root:not([data-theme="light"]) .windmill .blades path { stroke: #3c5446; }
  :root:not([data-theme="light"]) .solar rect { fill: #1f3348; stroke: #5f88a0; }
  :root:not([data-theme="light"]) .gums .trunk { stroke: #5a6456; }
  :root:not([data-theme="light"]) .gums .canopy { fill: #223a2a; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Band ---------- */
.band {
  background: var(--hill-1);
  color: var(--on-green);
  overflow: hidden;
  padding: 18px 0 20px;
  border-top: 2px dashed color-mix(in srgb, var(--on-green) 25%, transparent);
  transition: background 0.8s;
}
.band-track {
  display: flex; gap: 32px; align-items: center;
  width: max-content;
  animation: marquee 50s linear infinite;
  font: italic 400 clamp(24px, 3vw, 38px)/1 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  white-space: nowrap;
}
.band-track i { font-style: normal; color: var(--ochre); font-size: 0.7em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(96px, 13vw, 170px) 0; }

/* ---------- Notes ---------- */
.note-feature {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  padding: clamp(28px, 4vw, 52px);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 28px 28px 28px 6px;
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--sage) 70%, transparent);
  margin-bottom: 56px;
  position: relative;
}
.note-feature.note-feature--solo {
  grid-template-columns: 1fr;
}
.note-feature.note-feature--solo .note-feature-copy {
  max-width: 640px;
}
.note-feature::before { /* washi tape */
  content: "";
  position: absolute; top: -14px; left: 48px;
  width: 120px; height: 28px;
  background: color-mix(in srgb, var(--ochre) 55%, transparent);
  transform: rotate(-4deg);
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 4px, #000 5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 4px, #000 5px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, transparent 4px, #000 5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 4px, #000 5px) right / 51% 100% no-repeat;
}
.note-meta { font: 400 13px/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 12px; margin: 0 0 20px; letter-spacing: 0.04em; }
.pill { padding: 6px 10px; border-radius: 999px; background: var(--terracotta); color: #fbf3e0; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }
.note-feature h3 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 20px; }
.note-feature h3 a { text-decoration: none; background: linear-gradient(var(--ochre), var(--ochre)) 0 92% / 0 0.18em no-repeat; transition: background-size 0.6s var(--ease); }
.note-feature h3 a:hover { background-size: 100% 0.18em; }
.note-feature p { color: var(--muted); margin: 0 0 24px; }
.note-feature p em { color: var(--ink); }
.read-more { font: 500 14px/1 var(--mono); color: var(--green); text-decoration: none; letter-spacing: 0.04em; }
.read-more span { display: inline-block; transition: transform 0.3s var(--ease); }
.read-more:hover span { transform: translateX(6px); }

.venn { margin: 0; }
.venn svg { width: 100%; height: auto; overflow: visible; }
.venn .v1 { fill: color-mix(in srgb, var(--moss) 35%, transparent); stroke: var(--green); stroke-width: 2.5; }
.venn .v2 { fill: color-mix(in srgb, var(--ochre) 35%, transparent); stroke: var(--terracotta); stroke-width: 2.5; }
.venn text { font-family: var(--mono); text-anchor: middle; fill: var(--ink); }
.v-label { font-size: 13px; opacity: 0.75; }
.v-core { font-family: var(--display) !important; font-style: italic; font-size: 21px; font-weight: 600; }
.v-arrow { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 5; }
.venn figcaption { text-align: center; font-style: italic; color: var(--muted); font-size: 16px; }

.notes { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.notes:not(:has(li)) { display: none; }
.note a {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 20px; align-items: baseline;
  padding: 26px 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--ink) 35%, transparent);
  text-decoration: none;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}
.note a:hover { background: color-mix(in srgb, var(--sage) 30%, transparent); padding-left: 20px; }
.note-num { font: 400 13px var(--mono); color: var(--terracotta); }
.note-body { display: flex; flex-direction: column; gap: 4px; }
.note-title { font: 500 clamp(22px, 2.2vw, 30px)/1.15 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.015em; }
.note-excerpt { color: var(--muted); font-size: 0.95em; }
.note-tag { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }

/* ---------- Torn paper edges ---------- */
.torn { position: absolute; left: 0; right: 0; height: 28px; background: var(--green-deep); z-index: 1; }
.torn-top { top: -27px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V18l12-6 9 5 14-9 11 7 16-10 9 8 13-4 12 6 15-11 10 7 14-3 9 8 16-9 11 5 12-8 14 10 10-5 15 4 11-9 13 7 9-4 16 8 12-10 10 6 14-5 13 9 12-7 10 4 15-8 11 9 14-6L400 14V28Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V18l12-6 9 5 14-9 11 7 16-10 9 8 13-4 12 6 15-11 10 7 14-3 9 8 16-9 11 5 12-8 14 10 10-5 15 4 11-9 13 7 9-4 16 8 12-10 10 6 14-5 13 9 12-7 10 4 15-8 11 9 14-6L400 14V28Z'/%3E%3C/svg%3E") center / 100% 100%;
}
.torn-bottom { bottom: -27px; transform: scaleY(-1) scaleX(-1);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V18l12-6 9 5 14-9 11 7 16-10 9 8 13-4 12 6 15-11 10 7 14-3 9 8 16-9 11 5 12-8 14 10 10-5 15 4 11-9 13 7 9-4 16 8 12-10 10 6 14-5 13 9 12-7 10 4 15-8 11 9 14-6L400 14V28Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V18l12-6 9 5 14-9 11 7 16-10 9 8 13-4 12 6 15-11 10 7 14-3 9 8 16-9 11 5 12-8 14 10 10-5 15 4 11-9 13 7 9-4 16 8 12-10 10 6 14-5 13 9 12-7 10 4 15-8 11 9 14-6L400 14V28Z'/%3E%3C/svg%3E") center / 100% 100%;
}

/* ---------- Principles ---------- */
.principles {
  background: var(--green-deep);
  color: #efe6cc;
  margin: 28px 0;
  background-image:
    radial-gradient(60% 50% at 50% 0%, rgba(223, 165, 58, 0.18), transparent 70%),
    repeating-radial-gradient(circle at 50% 120%, transparent 0 38px, rgba(239, 230, 204, 0.035) 38px 39px);
}
.principles .section-title em { color: #eab95a; }
.principles .stamp { color: #eab95a; }
.arches { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.arch {
  text-align: center;
  padding: 0 clamp(20px, 2.4vw, 32px) 40px;
  border: 1.5px solid rgba(239, 230, 204, 0.25);
  border-radius: 999px 999px 20px 20px;
  background: rgba(239, 230, 204, 0.04);
  transition: transform 0.6s var(--ease), background 0.4s;
}
.arch:hover { transform: translateY(-8px); background: rgba(239, 230, 204, 0.08); }
.arch-window {
  aspect-ratio: 1;
  margin: 18px auto 28px;
  width: min(100%, 220px);
  border-radius: 999px 999px 12px 12px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 110%, #dfa53a 0 30%, transparent 31%),
    linear-gradient(180deg, #2e5a44, #20432f);
  border: 1.5px solid rgba(239, 230, 204, 0.3);
  overflow: hidden;
}
.arch:nth-child(2) .arch-window { background: radial-gradient(circle at 50% 110%, #7fa05a 0 30%, transparent 31%), linear-gradient(180deg, #34564a, #1d3b30); }
.arch:nth-child(3) .arch-window { background: radial-gradient(circle at 50% 110%, #bb5a35 0 30%, transparent 31%), linear-gradient(180deg, #3a4f45, #22382d); }
.arch-window svg { width: 58%; fill: none; stroke: #f3e7c6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.8s var(--ease); }
.arch:hover .arch-window svg { transform: scale(1.08) rotate(-4deg); }
.arch h3 { font-size: clamp(28px, 2.6vw, 36px); margin: 0 0 12px; letter-spacing: -0.02em; }
.arch p { margin: 0; color: rgba(239, 230, 204, 0.75); font-size: 0.97em; }
.arch p em { color: #eab95a; }


/* ---------- Now ---------- */
.now-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 32px); }
.now-card {
  position: relative;
  padding: clamp(28px, 3.6vw, 44px);
  border-radius: 24px;
  border: 1.5px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.now-card.home { background: color-mix(in srgb, var(--sage) 40%, var(--card)); }
.now-label { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--terracotta); margin: 0 0 20px; }
.now-card h3 { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 16ch; }
.now-card h3 span { font-style: italic; color: var(--green); }
.now-card p { color: var(--muted); margin: 0 0 24px; position: relative; z-index: 1; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.chips li { font: 400 12px/1 var(--mono); padding: 8px 12px; border-radius: 999px; background: var(--paper-2); letter-spacing: 0.04em; }
.orbit { position: absolute; top: -30px; right: -40px; width: 200px; opacity: 0.55; pointer-events: none; }
.orbit ellipse { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 5; }
.orbit .planet { fill: var(--ochre); }
.orbit .sat { fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; offset-path: path("M 181.4 70.6 A 86 34 -20 1 1 18.6 129.4 A 86 34 -20 1 1 181.4 70.6"); animation: orbit 14s linear infinite; }
@keyframes orbit { to { offset-distance: 100%; } }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 0.95em; }
.check { width: 18px; height: 18px; flex: none; border: 1.5px solid var(--green); border-radius: 5px; position: relative; }
.check::after { content: ""; position: absolute; left: 4px; top: 0; width: 6px; height: 11px; border: solid var(--green); border-width: 0 2px 2px 0; transform: rotate(40deg); }

/* ---------- Path / strata ---------- */
.strata { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stratum {
  display: grid; grid-template-columns: 1.1fr 1.3fr 1fr; gap: 20px; align-items: center;
  padding: clamp(22px, 2.6vw, 32px) clamp(22px, 3.4vw, 44px);
  margin-top: -10px;
  color: #22301f;
  position: relative;
  transition: transform 0.5s var(--ease);
}
.stratum:hover { transform: translateX(10px); }
.stratum:nth-child(odd) { border-radius: 40px 70px 30px 60px / 18px 26px 14px 22px; }
.stratum:nth-child(even) { border-radius: 70px 30px 60px 40px / 24px 14px 26px 16px; }
.s1 { background: #f3dc9b; z-index: 6; margin-top: 0; }
.s2 { background: #e6c27a; z-index: 5; }
.s3 { background: #d49d5c; z-index: 4; }
.s4 { background: #b9784a; z-index: 3; color: #fbf1dc; }
.s5 { background: #8f5a3a; z-index: 2; color: #fbf1dc; }
.bedrock { background: #4d3a2c; z-index: 1; color: #fbf1dc;
  background-image: radial-gradient(circle at 20% 40%, rgba(255,255,255,0.08) 0 6px, transparent 7px), radial-gradient(circle at 70% 60%, rgba(255,255,255,0.06) 0 10px, transparent 11px), radial-gradient(circle at 45% 30%, rgba(255,255,255,0.07) 0 4px, transparent 5px);
}
:root[data-theme="dark"] .stratum { filter: saturate(0.8) brightness(0.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stratum { filter: saturate(0.8) brightness(0.8); } }
.s-name { font: 600 clamp(20px, 2vw, 26px)/1.1 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.01em; }
.s-role { font-size: 0.95em; }
.s-note { font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; text-align: right; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.sprout { width: 64px; margin: 0 auto 24px; display: block; fill: color-mix(in srgb, var(--moss) 50%, transparent); stroke: var(--green); stroke-width: 3; stroke-linecap: round; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(6deg); } }
.contact-title { font-size: clamp(44px, 6.8vw, 96px); line-height: 1; letter-spacing: -0.03em; margin: 0 0 24px; }
.contact p { color: var(--muted); max-width: 560px; margin: 0 auto 36px; }
.contact-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1.5px solid var(--ink); padding: 32px 0 36px; font-size: 15px; color: var(--muted); }
.ack { margin: 0 0 24px; font-style: italic; max-width: 640px; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; }
.footer-row p { margin: 0; }
#clock { color: var(--ink); }
.to-top { text-decoration: none; }
.to-top:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .stamp.reveal.in { transform: rotate(-1.5deg); }
.js .stratum.reveal { transform: translateX(-24px); }
.js .stratum.reveal.in { transform: none; }
.js .stratum.reveal.in:hover { transform: translateX(10px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .note-feature { grid-template-columns: 1fr; }
  .venn { max-width: 380px; margin: 0 auto; }
  .arches { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .now-grid { grid-template-columns: 1fr; }
  .stratum { grid-template-columns: 1fr 1.4fr; }
  .s-note { display: none; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }
  .note a { grid-template-columns: 36px 1fr; }
  .note-tag { display: none; }
  .stratum { grid-template-columns: 1fr; gap: 4px; }
  .checklist { grid-template-columns: 1fr; }
  .footer-row { flex-direction: column; }
  .orbit { width: 150px; right: -50px; }
}

/* =========================================================
   Essay pages (notes/*.html, generated by build.py)
   ========================================================= */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  /* a twisted-twine stripe */
  background: repeating-linear-gradient(115deg, var(--ochre) 0 6px, color-mix(in srgb, var(--ochre) 60%, var(--terracotta)) 6px 9px);
}

.essay { padding-top: clamp(110px, 14vh, 150px); }
.essay-head { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); }
.back-link {
  display: inline-flex; gap: 8px; align-items: center;
  font: 400 13px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  margin-bottom: 36px;
}
.back-link span { transition: transform 0.3s var(--ease); }
.back-link:hover { color: var(--ink); }
.back-link:hover span { transform: translateX(-4px); }
.essay-head .stamp { display: table; }
.essay-title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 500;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.essay-dek { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.45; color: var(--muted); margin: 0 0 28px; max-width: 680px; }
.essay-dek em { color: var(--ink); }
.essay-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 400 13px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; margin: 0; }

.essay-horizon { height: clamp(60px, 9vw, 120px); margin: clamp(40px, 6vw, 72px) 0 0; }
.essay-horizon svg { width: 100%; height: 100%; display: block; }

.essay-body {
  max-width: 700px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter) 0;
  font-size: clamp(19px, 1.35vw, 21px);
  line-height: 1.72;
}
.essay-body > p { margin: 0 0 1.25em; }
.essay-body > p:first-child::first-letter {
  float: left;
  font: 500 4.6em/0.8 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--green);
  margin: 0.08em 0.1em 0 -0.02em;
}
.essay-body h2 {
  font: 500 clamp(28px, 2.8vw, 36px)/1.1 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.02em;
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 90px;
}
.essay-body h2::before { content: "☀"; display: block; font-size: 16px; color: var(--ochre); margin-bottom: 14px; }
.essay-body h3 { font-size: 1.15em; margin: 1.8em 0 0.5em; }
.essay-body strong { color: var(--ink); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--ochre) 38%, transparent) 62%); }
.essay-body a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.essay-body ul { margin: 0 0 1.4em; padding: 0; list-style: none; }
.essay-body li { position: relative; padding-left: 30px; margin-bottom: 0.55em; }
.essay-body li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em;
  width: 12px; height: 12px;
  background: var(--moss);
  border-radius: 0 70% 0 70%; /* little leaf */
  transform: rotate(-10deg);
}
.essay-body .pull {
  margin: 2em -1em;
  padding: 1.1em 1.2em 1.1em 1.4em;
  border-left: 3px solid var(--ochre);
  background: color-mix(in srgb, var(--sage) 26%, transparent);
  border-radius: 0 18px 18px 0;
}
.essay-body .pull p {
  margin: 0;
  font: italic 400 clamp(24px, 2.4vw, 30px)/1.3 var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.01em;
}
.essay-body .divider { text-align: center; color: var(--ochre); letter-spacing: 0.4em; margin: 2.4em 0; }
.essay-figure.venn, .essay-figure {
  max-width: none;
  margin: 2.4em 0;
  padding: 28px 24px 20px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--sage) 70%, transparent);
}
.essay-figure svg { max-width: 420px; margin: 0 auto; display: block; }
.end-mark { text-align: center; margin: 3em 0 0 !important; }
.end-mark svg { width: 34px; height: 34px; }
.end-mark circle { fill: var(--ochre); }
.end-mark .rays { stroke: var(--ochre); stroke-width: 2.4; stroke-linecap: round; transform-origin: 20px 20px; animation: spin 30s linear infinite; }

.essay-foot { max-width: 860px; margin: 0 auto; padding: clamp(48px, 6vw, 72px) var(--gutter) clamp(80px, 10vw, 120px); }
.essay-sign { text-align: center; font-style: italic; color: var(--muted); margin: 0 0 48px; }
.essay-sign a { color: var(--green); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager:not(:has(a)) { display: none; }
.pager-link {
  display: flex; flex-direction: column; gap: 10px;
  padding: 24px 26px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  text-decoration: none;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease);
}
.pager-link.next { text-align: right; }
.pager-link:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: 0 6px 0 color-mix(in srgb, var(--sage) 70%, transparent); }
.pager-link.empty { visibility: hidden; }
.pager-label { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--terracotta); }
.pager-title { font: 500 clamp(19px, 1.7vw, 23px)/1.2 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; }

@media (max-width: 760px) {
  .pager { grid-template-columns: 1fr; }
  .pager-link.empty { display: none; }
  .essay-body .pull { margin-left: 0; margin-right: 0; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px var(--gutter); }
.lost > p:not(.stamp) { color: var(--muted); max-width: 440px; margin: 0 auto 32px; }
