:root {
  /* aghi: paper, plum ink and a few market-stall pops */
  --paper: #f3eee2;
  --paper-2: #e9e1cd;
  --white: #fcfaf5;
  --ink: #2b1c36;          /* royal velvet */
  --ink-soft: rgba(43, 28, 54, .7);
  --line: rgba(43, 28, 54, .2);
  --moss: #4e6138;
  --moss-deep: #3b4a2b;
  --fern: #8a9e68;
  --lake: #3f6f86;
  --bark: #6b4a33;
  --butter: #fff2ae;
  --lemon: #ebde00;        /* lemon grass */
  --ginger: #fb8e50;
  --flamingo: #f05fd0;
  --flamingo-ink: #b8329c;
  --plum: #2b1c36;         /* always dark: text on light fills */

  /* tokens that change with the theme */
  --edge: var(--ink);      /* Moon Wort Gold's heavy borders and shadow */
  --t-green: var(--moss);
  --t-blue: var(--lake);
  --t-brown: var(--bark);
  --g1: .9; --g2: .18; --g3: .28; --g4: .16;
  --grain-blend: multiply;
  --grain: .22;
  color-scheme: light;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
}

/* dark: forest floor at night. Follows the device unless the toggle has been used (see main.js) */
:root[data-theme="dark"] {
  --paper: #1d1722;
  --paper-2: #2a2230;
  --white: #251e2a;
  --ink: #efe8d8;
  --ink-soft: rgba(239, 232, 216, .68);
  --line: rgba(239, 232, 216, .16);
  --flamingo-ink: #f49de1;
  --edge: #0e0a11;
  --t-green: #b3c58e;
  --t-blue: #92bfd3;
  --t-brown: #cfa883;
  --g1: .12; --g2: .14; --g3: .22; --g4: .24;
  --grain-blend: screen;
  --grain: .1;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .11 0 0 0 0 .21 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
p a {
  text-decoration: underline wavy var(--flamingo);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
p a:hover { color: var(--flamingo-ink); }
:focus-visible { outline: 2px solid var(--flamingo); outline-offset: 4px; }
em { font-style: italic; }
.muted { color: var(--ink-soft); }
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: lowercase;
}

/* soft light through the canopy */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  animation: drift 40s ease-in-out infinite alternate;
}
.glow i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--butter); opacity: var(--g1); }
.glow i:nth-child(2) { width: 30vw; height: 30vw; right: -8vw; top: 18vh; background: var(--flamingo); opacity: var(--g2); animation-duration: 52s; }
.glow i:nth-child(3) { width: 38vw; height: 38vw; left: -6vw; bottom: -12vw; background: var(--fern); opacity: var(--g3); animation-duration: 46s; }
.glow i:nth-child(4) { width: 34vw; height: 34vw; right: 4vw; bottom: -10vw; background: var(--lake); opacity: var(--g4); animation-duration: 58s; }
@keyframes drift { to { transform: translate(4vw, 3vh) scale(1.08); } }

/* ───────── Logo (paths drawn by main.js) ───────── */
.logo { display: inline-block; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.logo svg { display: block; width: 100%; height: auto; overflow: visible; }
.logo path { fill: none; stroke: currentColor; stroke-width: 4; }

/* ───────── Top bar ───────── */
.top {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
}
.top-logo { width: 34px; margin-right: auto; }
.wip { display: inline-flex; align-items: center; gap: 8px; }
.wip span { width: 9px; height: 9px; border-radius: 50%; background: var(--ginger); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; transition: transform .5s cubic-bezier(.3, .7, .2, 1); }
.theme-toggle circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-toggle path { fill: currentColor; }
[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }
.theme-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ───────── Intro ───────── */
.intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 120px) var(--gutter) clamp(72px, 10vw, 140px);
}
.intro-mark { position: relative; justify-self: center; }
.logo-hero { width: clamp(150px, 22vw, 280px); }
.note {
  position: absolute;
  right: -2.5em;
  bottom: 14%;
  transform: rotate(-4deg);
  color: var(--flamingo-ink);
  white-space: nowrap;
  font-size: 13px;
  transition: opacity .4s;
}
.note-arrow { display: inline-block; font-size: 16px; }
.intro-mark.touched .note { opacity: 0; }
.intro h1 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-optical-sizing: auto;
  font-weight: 350;
  font-size: clamp(36px, 4.8vw, 64px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: 28px;
}
.intro h1 em { color: var(--t-green); }
.intro-copy p { max-width: 50ch; margin-bottom: 14px; }

.sticker {
  position: absolute;
  top: 0;
  right: var(--gutter);
  width: clamp(96px, 11vw, 136px);
  animation: spin 80s linear infinite;
}
.sticker circle { fill: var(--lemon); }
.sticker text {
  font-family: var(--mono);
  font-size: 15.5px;
  letter-spacing: .02em;
  fill: var(--plum);
}
.sticker .sticker-mid { font-family: var(--serif); font-style: italic; font-size: 30px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Moon Wort Gold: brutalist + organic ───────── */
.mwg {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  max-width: var(--max);
  margin: 0 auto clamp(64px, 9vw, 120px);
  margin-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: var(--moss);
  color: var(--butter);
  border: 3px solid var(--edge);
  box-shadow: 10px 10px 0 var(--edge);
}
.mwg-head {
  position: relative;
  padding: clamp(24px, 4vw, 48px);
  border-right: 3px solid var(--edge);
  overflow: hidden;
  min-height: 420px;
}
.mwg-head h2 {
  position: relative;
  z-index: 1;
  font-family: var(--sans);
  font-weight: 900;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
  font-size: clamp(52px, 7vw, 104px);
  line-height: .84;
  letter-spacing: -.02em;
  margin-top: 20px;
}
.pebble {
  position: absolute;
  right: -18%;
  bottom: -16%;
  width: 78%;
}
.pebble path { fill: var(--bark); stroke: var(--edge); stroke-width: 3; }
.pebble .pebble-hole { fill: var(--moss); }

.mwg-body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; }
.mwg-lede {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.3;
  font-weight: 500;
  max-width: 30ch;
}
.mwg-tag { margin: 14px 0 32px; opacity: .8; }

.lines {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: auto;
  border: 3px solid var(--edge);
  background: var(--moss-deep);
}
.lines li {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  aspect-ratio: 3 / 4;
  padding: 14px 12px;
  border-right: 3px solid var(--edge);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  transition: background .3s, color .3s;
}
.lines li:last-child { border-right: 0; }
.lines li.maybe { background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255, 242, 174, .07) 8px 16px); }
.lines .blob {
  align-self: center;
  width: 62%;
  aspect-ratio: 1;
  background: var(--fern);
  border: 2px solid var(--edge);
  border-radius: var(--r1);
  transition: border-radius 1.2s cubic-bezier(.3, .7, .2, 1), background .3s;
}
.lines li.maybe .blob { background: transparent; border: 2px dashed var(--butter); }
.lines li:hover { background: var(--butter); color: var(--plum); }
.lines li:hover .blob { background: var(--bark); border-radius: var(--r2); }
.lines .num { font-weight: 500; font-size: 13px; }

/* ───────── D.Oro: clean, straight, blank slate ───────── */
.doro {
  max-width: var(--max);
  margin: 0 auto clamp(64px, 9vw, 120px);
  margin-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(28px, 5vw, 72px);
}
.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--t-blue);
}
.doro-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 48px;
  align-items: end;
  padding-bottom: clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--ink);
}
.doro-head .label { grid-column: 1 / -1; margin-bottom: 20px; }
.doro-head h2 {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(64px, 10vw, 140px);
  line-height: .85;
  letter-spacing: -.03em;
}
.doro-lede { max-width: 32ch; font-size: 19px; font-weight: 300; justify-self: end; }
.doro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.doro-col { padding: 28px 28px 0 0; }
.doro-col + .doro-col { padding-left: 28px; border-left: 1px solid var(--line); }
.doro-col h3 { margin-bottom: 14px; }
.doro-col ul { list-style: none; }
.doro-col li {
  position: relative;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 300;
}
.doro-col li::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px; width: 0;
  background: var(--t-blue);
  transition: width .5s cubic-bezier(.3, .7, .2, 1);
}
.doro-col li:hover::after { width: 100%; }
.doro-status p { font-weight: 300; margin-bottom: 8px; }
.doro-status p:first-of-type { font-size: 22px; }
.doro-status .muted { font-size: 14px; }

/* ───────── Roots / log ───────── */
.roots {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) clamp(72px, 10vw, 140px);
}
.roots h2 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 350;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  margin: 12px 0 24px;
}
.roots h2 em { color: var(--t-blue); }
.roots-copy > p:last-child { max-width: 52ch; }
.log { align-self: end; }
.log-title { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.log ul { list-style: none; }
.log li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.log time { font-family: var(--mono); font-size: 12px; color: var(--t-brown); padding-top: 3px; }

/* ───────── Footer ───────── */
.foot {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
}
.foot-logo { width: 28px; }
.foot p:last-child { margin-left: auto; }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .intro, .mwg, .roots { grid-template-columns: 1fr; }
  .intro { text-align: left; }
  .intro-mark { justify-self: start; }
  .note { right: auto; left: 100%; margin-left: 4px; }
  .sticker { top: 8px; }
  .mwg-head { border-right: 0; border-bottom: 3px solid var(--edge); min-height: 300px; }
  .pebble { width: 52%; right: -6%; bottom: -24%; }
  .doro-head { grid-template-columns: 1fr; row-gap: 20px; }
  .doro-lede { justify-self: start; }
  .doro-grid { grid-template-columns: 1fr 1fr; }
  .doro-status { grid-column: 1 / -1; padding-left: 0 !important; border-left: 0 !important; padding-top: 32px; }
}
@media (max-width: 560px) {
  .top p:not(.wip) { display: none; }
  .theme-toggle { padding: 6px 10px; }
  .theme-toggle .theme-label { display: none; }
  .mwg { box-shadow: 6px 6px 0 var(--edge); }
  .lines { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lines li { border-bottom: 3px solid var(--edge); aspect-ratio: auto; min-height: 140px; }
  .lines li:nth-child(3) { border-right: 0; }
  .lines li:nth-child(n + 4) { border-bottom: 0; }
  .doro-col { padding-right: 16px; }
  .doro-col + .doro-col { padding-left: 16px; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .foot p:last-child { margin-left: 0; }
}

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