:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --ink: #1a1916;
  --ink-2: #57534b;
  --ink-3: #8b867c;
  --rule: #d8d1c3;
  --ember: #e4572e;
  --ember-soft: #f3b49c;
  --night: #15140f;
  --night-2: #1e1d17;
  --night-ink: #ece6d9;
  --night-ink-2: #9e978a;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-2: #1c1b16;
    --ink: #ece6d9;
    --ink-2: #b3ac9f;
    --ink-3: #7d776c;
    --rule: #2e2c25;
    --ember: #ff6a3d;
    --ember-soft: #7a3524;
    --night: #0d0c09;
    --night-2: #18170f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ember); color: #fff; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em { font-style: italic; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .02em; }
.dim { color: var(--ink-3); }

.label {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 28px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.55rem; text-decoration: none; letter-spacing: -.01em;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ember) 18%, transparent);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; text-transform: lowercase;
  text-decoration: none; color: var(--ink-2);
}
.nav-links a:hover { color: var(--ember); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 9vw, 110px) 0 clamp(64px, 9vw, 120px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }

h1 {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 7.2vw, 6.6rem);
  line-height: .9; letter-spacing: -.035em;
  margin-bottom: 32px;
}
h1 em { color: var(--ember); display: inline-block; padding-left: .06em; }
section[id] { scroll-margin-top: 58px; }
.lede em { padding-right: .15em; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.link-arrow {
  display: inline-flex; gap: 10px; margin-top: 36px;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em;
  text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 4px;
}
.link-arrow span { transition: transform .2s ease; }
.link-arrow:hover span { transform: translateX(4px); }

/* the live world */
.world {
  margin: 0; position: relative;
  background: var(--night); color: var(--night-ink);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 60px -30px rgba(30, 20, 10, .45);
}
.world-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #2a2820;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--night-ink-2);
}
.live { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
#world { display: block; width: 100%; height: auto; aspect-ratio: 560 / 380; }
.log {
  list-style: none; margin: 0; padding: 12px 16px 14px;
  border-top: 1px solid #2a2820; height: 118px; overflow: hidden;
  font-family: var(--mono); font-size: .72rem; line-height: 1.75; color: var(--night-ink-2);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.log li { display: grid; grid-template-columns: 62px 70px 1fr; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: in .35s ease; }
.log .t { color: #5f5a4f; }
@media (max-width: 520px) { .log li { grid-template-columns: 48px 58px 1fr; gap: 6px; } .log { font-size: .66rem; } }
.log .k-intend { color: var(--night-ink); }
.log .k-act { color: #9fb7a4; }
.log .k-check { color: #c8b98a; }
.log .k-degrade { color: var(--ember); }
.k-wonder { color: var(--night-ink); }
.k-surprise, .k-poke { color: #e8c76a; }
.k-bored { color: #8a8478; }
.k-tease { color: #d79ad0; }
.k-delight { color: var(--ember); }
.k-dodge { color: #9fb7a4; }
.k-watch { color: #8fb4d8; }

/* mood chips under the canvas */
.mood {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px;
  border-top: 1px solid #2a2820;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
}
.mood span {
  padding: 3px 8px; border-radius: 99px; border: 1px solid #2f2c23; color: #6b665a;
  transition: color .4s ease, border-color .4s ease, background .4s ease;
}
.mood span.on { color: var(--night); background: var(--ember); border-color: var(--ember); }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vw, 150px) 0; border-top: 1px solid var(--rule); }
h2 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; letter-spacing: -.025em;
  margin-bottom: 28px;
}
.essay-title { max-width: 17em; font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
.essay-lede { font-size: 1.2rem; color: var(--ink-2); max-width: 38em; margin-top: 12px; }

.theses {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--ink);
}
.theses article { padding: 28px 28px 0 0; }
.theses article + article { padding-left: 28px; border-left: 1px solid var(--rule); }
.theses .num { font-family: var(--mono); font-size: .75rem; color: var(--ember); }
.theses h3 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; margin: 14px 0 14px; }
.theses p { color: var(--ink-2); font-size: .98rem; }
@media (max-width: 860px) {
  .theses { grid-template-columns: 1fr; }
  .theses article, .theses article + article { padding: 28px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

/* essay */
.essay { display: grid; grid-template-columns: 1fr 220px; gap: clamp(32px, 6vw, 88px); margin-top: clamp(40px, 6vw, 72px); }
.essay-body { columns: 2 280px; column-gap: 48px; color: var(--ink-2); }
.essay-body p + p { margin-top: 1em; }
.margin { border-left: 1px solid var(--rule); padding-left: 18px; }
.cf { font-family: var(--mono); font-size: .7rem; line-height: 1.6; color: var(--ink-3); letter-spacing: .01em; }
.cf em { font-style: italic; }
@media (max-width: 860px) { .essay { grid-template-columns: 1fr; } .margin { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 14px; } }

.pull { margin: clamp(64px, 9vw, 110px) 0 0; padding: 0; text-align: center; }
.pull p { font-family: var(--serif); font-style: italic; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; max-width: 18em; margin: 0 auto 18px; }
.pull cite { font-style: normal; }

/* temperament */
.split-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.split-head h2 { margin-bottom: 0; }
.split-head .essay-lede { margin: 0; }
h2 em { color: var(--ember); }
@media (max-width: 860px) { .split-head { grid-template-columns: 1fr; } }
.traits {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(48px, 7vw, 88px); border-top: 1px solid var(--ink);
}
.trait {
  padding: 28px 28px 32px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: background .5s ease;
}
.trait:nth-child(3n+1) { padding-left: 0; }
.trait:nth-child(3n) { border-right: 0; padding-right: 0; }
.trait h3 { font-family: var(--serif); font-size: 2rem; line-height: 1; }
.trait > p:not(.logline):not(.cf) { color: var(--ink-2); font-size: .98rem; flex: 1; }
.trait::before {
  content: ""; position: absolute; top: 34px; right: 28px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rule); transition: background .3s ease, box-shadow .3s ease;
}
.trait:nth-child(3n)::before { right: 0; }
.trait.on::before { background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.trait .cf { min-height: 3.2em; }
.logline {
  font-family: var(--mono); font-size: .74rem; padding: 8px 12px; border-radius: 4px;
  background: var(--night); color: var(--night-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logline span { margin-right: 10px; }
@media (max-width: 960px) {
  .traits { grid-template-columns: 1fr 1fr; }
  .trait, .trait:nth-child(3n+1), .trait:nth-child(3n) { padding: 28px 24px 30px; border-right: 1px solid var(--rule); }
  .trait:nth-child(2n+1) { padding-left: 0; }
  .trait:nth-child(2n) { border-right: 0; padding-right: 0; }
  .trait::before, .trait:nth-child(3n)::before { right: 24px; }
  .trait:nth-child(2n)::before { right: 0; }
}
@media (max-width: 620px) {
  .traits { grid-template-columns: 1fr; }
  .trait, .trait:nth-child(n) { padding: 26px 0 28px; border-right: 0; }
  .trait::before, .trait:nth-child(n)::before { right: 0; }
}

/* growing up: a line of stages */
.stages {
  list-style: none; padding: 0; margin: clamp(56px, 8vw, 96px) 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; position: relative;
}
.stages::before {
  content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1px;
  background: linear-gradient(90deg, var(--rule), var(--ember));
}
.stages li { position: relative; padding-top: 34px; }
.stages li::before {
  content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--ink-3);
}
.stages li:last-child::before { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ember) 18%, transparent); }
.stage-n { color: var(--ember); font-size: .8rem; }
.stages h3 { font-family: var(--serif); font-size: 2.1rem; line-height: 1; margin: 10px 0 14px; }
.stages p:not(.cf) { color: var(--ink-2); font-size: .98rem; margin-bottom: 14px; }
@media (max-width: 860px) {
  .stages { grid-template-columns: 1fr; gap: 0; padding-left: 28px; }
  .stages::before { left: 5px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; background: linear-gradient(180deg, var(--rule), var(--ember)); }
  .stages li { padding: 0 0 36px; }
  .stages li::before { left: -28px; top: 6px; }
}

/* loop: dark band */
.section-ink { background: var(--night); color: var(--night-ink); border-top: 0; }
.label-ink { color: var(--night-ink-2); }
.muted-ink { color: var(--night-ink-2); font-size: 1.08rem; max-width: 26em; }
.loop-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .loop-grid { grid-template-columns: 1fr; } }
.loop { list-style: none; margin: 0; padding: 0; border-top: 1px solid #2f2c23; }
.loop li {
  display: grid; grid-template-columns: 110px 1fr; gap: 20px;
  padding: 24px 0; border-bottom: 1px solid #2f2c23;
  transition: color .3s ease;
  color: var(--night-ink-2);
}
.loop li .mono { font-size: .85rem; color: var(--night-ink); position: relative; padding-left: 18px; }
.loop li .mono::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%;
  background: #3a372d; transition: background .3s ease, box-shadow .3s ease;
}
.loop li.on { color: var(--night-ink); }
.loop li.on .mono::before { background: var(--ember); box-shadow: 0 0 12px var(--ember); }

/* directions */
.directions { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 56px; }
.directions h3 { font-family: var(--serif); font-size: 2rem; line-height: 1.05; margin: 10px 0 14px; }
.directions p:not(.mono) { color: var(--ink-2); }
@media (max-width: 860px) { .directions { grid-template-columns: 1fr; } }

.fieldnote {
  margin-top: clamp(64px, 9vw, 110px); padding: 28px 32px;
  background: var(--paper-2); border-left: 2px solid var(--ember);
  display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: baseline;
}
.fieldnote p:last-child { font-family: var(--serif); font-size: 1.45rem; line-height: 1.35; }
.fieldnote a { text-decoration-color: var(--ember); text-underline-offset: 4px; }
@media (max-width: 640px) { .fieldnote { grid-template-columns: 1fr; gap: 8px; padding: 22px; } }

/* contact */
.contact { text-align: center; }
.contact-title { font-size: clamp(3.4rem, 9vw, 7rem); margin-bottom: 24px; }
.contact .lede { margin: 0 auto; }
.mail {
  display: inline-block; margin-top: 40px;
  font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-style: italic;
  color: var(--ember); text-decoration: none; border-bottom: 1px solid currentColor;
}
.mail:hover { opacity: .8; }

.footer { border-top: 1px solid var(--rule); padding: 28px 0 36px; font-size: .9rem; color: var(--ink-2); }
.footer-inner { display: flex; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live i, .log li { animation: none; }
  .mood span, .trait { transition: none; }
}
