@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --paper: #eee8dc;
  --sheet: #f8f4eb;
  --white: #fffdf8;
  --ink: #19211c;
  --muted: #667067;
  --quiet: #8d9188;
  --line: #cec5b6;
  --line-dark: #aaa092;
  --sage: #345e50;
  --sage-soft: rgba(52, 94, 80, 0.09);
  --orange: #cd6038;
  --orange-soft: rgba(205, 96, 56, 0.1);
  --gold: #d7a938;
  --alarm: #a23f35;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--mono);
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 255, 255, 0.9), transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(205, 96, 56, 0.07), transparent 24%),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.28;
  background-image: radial-gradient(rgba(25, 33, 28, 0.22) 0.7px, transparent 0.7px);
  background-size: 9px 9px;
  mask-image: linear-gradient(120deg, black, transparent 68%);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.boot-screen,
.error-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.boot-pip {
  width: 42px;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 6px, transparent 6px 10px);
  animation: pulse 1.2s ease-in-out infinite;
}

.viewer-shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 76px auto auto clamp(720px, 83dvh, 956px) 190px;
  gap: 10px;
  padding: 12px;
  overflow: visible;
}

.site-masthead,
.command-ribbon,
.portfolio-ribbon,
.browser-surface,
.desk-footer {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(248, 244, 235, 0.9);
}

.portfolio-ribbon {
  min-height: 176px;
  display: grid;
  grid-template-columns: 270px minmax(420px, 1fr) minmax(270px, 0.75fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--line);
}

.wallet-summary,
.watchlist-card,
.allocation-card {
  min-width: 0;
  padding: 14px 16px;
  background: var(--white);
}

.portfolio-heading,
.allocation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portfolio-heading > div,
.allocation-heading {
  min-width: 0;
}

.portfolio-heading > div {
  display: grid;
  gap: 4px;
}

.portfolio-heading span,
.allocation-heading span,
.wallet-metrics span,
.risk-line {
  color: var(--quiet);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-heading strong,
.allocation-heading strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
}

.portfolio-heading a,
.portfolio-heading small {
  color: var(--orange);
  font-size: 7px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.portfolio-heading a:hover {
  color: var(--sage);
}

.wallet-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.wallet-metrics div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.wallet-metrics strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage);
}

.portfolio-status.status-error {
  color: var(--alarm);
}

.portfolio-status.status-error i {
  background: var(--alarm);
}

.asset-tape {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 5px;
  margin: 12px 0 10px;
  padding: 0;
  list-style: none;
}

.asset-tape li {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.asset-tape li.asset-held {
  border-color: var(--sage);
  box-shadow: inset 3px 0 var(--sage);
}

.asset-tape li > div {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.asset-tape strong {
  color: var(--orange);
  font-size: 9px;
}

.asset-tape li > div span {
  color: var(--sage);
  font-size: 6px;
  text-transform: uppercase;
}

.asset-tape b {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-tape small {
  overflow: hidden;
  color: var(--quiet);
  font-size: 6.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-line {
  margin: 0;
  color: var(--sage);
  letter-spacing: 0.06em;
}

.allocation-card {
  display: grid;
  align-content: space-between;
  gap: 9px;
  background:
    linear-gradient(145deg, var(--orange-soft), transparent 68%),
    var(--white);
}

.allocation-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.allocation-card small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--quiet);
  font-size: 6.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.allocation-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.allocation-numbers span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  color: var(--sage);
  background: var(--sheet);
  font-size: 7px;
  text-transform: uppercase;
}

.allocation-blocked {
  box-shadow: inset 3px 0 var(--alarm);
}

.allocation-article-link {
  width: fit-content;
  color: var(--orange);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.allocation-article-link:hover {
  color: var(--sage);
}

.site-masthead {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 10px 14px 10px 18px;
  border-radius: 18px 18px 5px 5px;
  box-shadow: 0 8px 26px rgba(53, 46, 36, 0.05);
}

.brand {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.brand-code {
  padding: 4px 6px 6px;
  color: var(--white);
  border-radius: 2px 8px 2px 2px;
  background: var(--orange);
}

.brand-word {
  padding-left: 4px;
}

.brand small {
  grid-column: 1 / -1;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.market-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-intro i {
  width: 16px;
  height: 1px;
  background: var(--orange);
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.connection-state,
.x-link,
.journal-link,
.positions-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.x-link {
  min-width: 30px;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  color: var(--white);
  border-color: var(--ink);
  background: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.x-link:hover {
  color: var(--ink);
  border-color: var(--orange);
  background: var(--orange-soft);
}

.connection-state {
  border-radius: 14px 3px 3px 14px;
}

.connection-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-soft);
}

.connection-state.mode-error i,
.connection-state.mode-offline i {
  background: var(--alarm);
  box-shadow: 0 0 0 3px rgba(162, 63, 53, 0.1);
}

.connection-state.mode-paused i,
.connection-state.mode-resting i {
  background: var(--gold);
  box-shadow: none;
}

.journal-link,
.positions-link {
  border-radius: 3px 14px 14px 3px;
  color: var(--ink);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.journal-link:hover,
.positions-link:hover {
  color: var(--white);
  border-color: var(--sage);
  background: var(--sage);
}

.positions-link {
  border-radius: 3px;
}

.positions-page {
  width: min(1180px, calc(100% - 36px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 30px 0 70px;
}

.positions-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid var(--line-dark);
  border-radius: 18px 18px 4px 4px;
  background: var(--white);
}

.positions-header > a {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.positions-header > a:last-child {
  justify-self: end;
}

.positions-header > div {
  text-align: center;
}

.positions-header span,
.position-summary span,
.position-card dt,
.position-card header span,
.position-section > header span,
.trade-history > header span {
  color: var(--orange);
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.positions-header h1 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 0.9;
}

.position-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--line);
}

.position-summary > div {
  display: grid;
  gap: 7px;
  padding: 15px 18px;
  background: var(--sheet);
}

.position-summary strong {
  font-family: var(--serif);
  font-size: 22px;
}

.position-section,
.trade-history {
  margin-top: 26px;
}

.position-section > header,
.trade-history > header {
  display: flex;
  align-items: baseline;
  gap: 11px;
  margin-bottom: 10px;
}

.position-section > header h2,
.trade-history > header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.position-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.position-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.position-card h2,
.position-card p {
  margin: 0;
}

.position-card h2 {
  margin-top: 3px;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 28px;
}

.position-card p {
  color: var(--quiet);
  font-size: 8px;
}

.position-card > header > strong {
  font-family: var(--serif);
  font-size: 22px;
}

.position-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 17px 0;
}

.position-card dl div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.position-card dt,
.position-card dd {
  margin: 0;
}

.position-card dd {
  margin-top: 6px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-positive { color: var(--sage); }
.pnl-negative { color: var(--alarm); }

.position-card > footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--quiet);
  font-size: 7px;
}

.position-card > footer a,
.trade-history a {
  color: var(--orange);
}

.positions-empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line-dark);
  color: var(--muted);
  background: rgba(255, 253, 248, 0.5);
  font-family: var(--serif);
  font-size: 16px;
}

.trade-history ol {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  list-style: none;
}

.trade-history li {
  display: grid;
  grid-template-columns: 170px 1fr 1fr auto;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  font-size: 8px;
}

.trade-history li:last-child { border-bottom: 0; }
.trade-history time { color: var(--quiet); }

@media (max-width: 760px) {
  .positions-header { grid-template-columns: 1fr; text-align: left; }
  .positions-header > a:last-child { justify-self: start; }
  .positions-header > div { text-align: left; }
  .position-summary { grid-template-columns: repeat(2, 1fr); }
  .position-grid { grid-template-columns: 1fr; }
  .position-card dl { grid-template-columns: repeat(2, 1fr); }
  .trade-history li { grid-template-columns: 1fr 1fr; }
}

.command-ribbon {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) 2fr;
  min-height: 94px;
  overflow: hidden;
  border-radius: 5px;
}

.current-goal {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 13px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(100deg, var(--orange-soft), transparent 55%),
    var(--sheet);
}

.current-goal > span,
.stats-grid span,
.token-strip span,
.thought-heading,
.observer-footer {
  color: var(--quiet);
  font-size: 7px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.current-goal > span {
  color: var(--orange);
  font-weight: 600;
}

.current-goal p {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.45;
}

.stats-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.stats-grid div:not(.budget-track) {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--white);
}

.stats-grid strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-grid small {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
}

.stats-grid .alarm {
  color: var(--alarm);
}

.budget-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: rgba(52, 94, 80, 0.1);
}

.budget-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--orange));
  transition: width 500ms ease;
}

.browser-surface {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 16px 45px rgba(50, 43, 34, 0.08);
}

.browser-surface::before,
.browser-surface::after {
  position: absolute;
  z-index: 12;
  content: "";
  pointer-events: none;
}

.browser-surface::before {
  inset: 42px 0 auto;
  height: 1px;
  background: var(--line);
}

.browser-surface::after {
  top: 42px;
  left: 0;
  width: 28%;
  height: 2px;
  background: var(--orange);
}

.browser-toolbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(14px);
}

.live-pill,
.control-pill,
.browser-domain {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--sheet);
  font-size: 8px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-pill {
  gap: 6px;
  color: var(--white);
  border-color: var(--sage);
  border-radius: 12px 3px 3px 12px;
  background: var(--sage);
  font-weight: 600;
}

.live-pill.mode-error,
.live-pill.mode-offline {
  border-color: var(--alarm);
  background: var(--alarm);
}

.live-pill.mode-paused,
.live-pill.mode-resting {
  color: var(--ink);
  border-color: var(--gold);
  background: #f0d890;
}

.live-pill span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.1s ease-in-out infinite;
}

.control-pill {
  color: var(--orange);
  border-color: rgba(205, 96, 56, 0.24);
  border-radius: 3px 12px 12px 3px;
  background: var(--orange-soft);
}

.browser-domain {
  max-width: 48%;
  margin-left: auto;
  overflow: hidden;
  border: 0;
  color: var(--quiet);
  background: transparent;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
  letter-spacing: 0;
}

.activity-sweep {
  position: absolute;
  z-index: 14;
  top: 41px;
  left: -16%;
  width: 16%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  animation: sweep 4s linear infinite;
}

.browser-canvas {
  position: absolute;
  inset: 43px 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(24px, 4vw, 60px);
  background:
    linear-gradient(rgba(52, 94, 80, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 94, 80, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 82% 20%, rgba(205, 96, 56, 0.11), transparent 26%),
    #e7e1d5;
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.browser-canvas::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(116deg, transparent 49.8%, rgba(255, 255, 255, 0.65) 50%, transparent 50.2%);
}

.browser-canvas.browser-live {
  padding: 0;
  background: #171914;
}

.live-frame {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center top;
  background: #171914;
}

.browser-live .browser-caption {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.72);
  background: rgba(25, 33, 28, 0.82);
  backdrop-filter: blur(8px);
}

.browser-orbit {
  position: absolute;
  border: 1px solid rgba(52, 94, 80, 0.14);
  border-radius: 50%;
}

.orbit-one {
  top: -210px;
  right: -170px;
  width: 500px;
  height: 500px;
}

.orbit-two {
  bottom: -140px;
  left: -110px;
  width: 330px;
  height: 330px;
  border-color: rgba(205, 96, 56, 0.16);
}

.cursor {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  border: 2px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(205, 96, 56, 0.09);
}

.cursor-one {
  animation: cursor-one 13s ease-in-out infinite;
}

.cursor-two {
  opacity: 0.28;
  animation: cursor-two 17s ease-in-out infinite;
}

.observed-page {
  position: relative;
  width: min(880px, 92%);
  padding: clamp(24px, 4vw, 54px);
  border: 1px solid var(--line-dark);
  border-radius: 3px 28px 3px 3px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 12px 16px 0 rgba(52, 94, 80, 0.1), 0 26px 70px rgba(55, 47, 36, 0.11);
  backdrop-filter: blur(10px);
  animation: reveal 0.6s ease both;
}

.observed-page::before {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 5px;
  content: "";
  background: var(--orange);
}

.observed-page::after {
  position: absolute;
  top: 19px;
  right: 23px;
  width: 64px;
  height: 7px;
  content: "";
  background: repeating-linear-gradient(90deg, var(--sage) 0 4px, transparent 4px 9px);
  opacity: 0.6;
}

.observed-topline,
.source-line,
.browser-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--quiet);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.observed-index {
  color: var(--orange);
}

.observed-page h2 {
  max-width: 16ch;
  margin: 25px 0 12px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.observed-page > p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.fact-grid div {
  min-height: 72px;
  display: grid;
  align-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--sheet);
  font-size: 9px;
  line-height: 1.4;
}

.fact-grid span {
  color: var(--sage);
  font-size: 7px;
}

.source-line {
  justify-content: flex-start;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.source-line span {
  color: var(--orange);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.browser-caption {
  position: absolute;
  right: 15px;
  bottom: 12px;
  left: 15px;
}

.desk-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  overflow: hidden;
  border-radius: 5px 5px 18px 18px;
}

.thought-section {
  min-width: 0;
  display: grid;
  grid-template-rows: 32px minmax(0, 1fr);
  border-right: 1px solid var(--line);
}

.thought-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  color: var(--orange);
  font-weight: 600;
}

.thought-heading span:last-child {
  color: var(--quiet);
  font-weight: 400;
}

.thought-list {
  min-width: 0;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 9px 10px 11px;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scroll-behavior: smooth;
  scrollbar-color: var(--line-dark) transparent;
  scrollbar-width: thin;
}

.thought {
  position: relative;
  width: 280px;
  flex: 0 0 280px;
  padding: 10px 11px 11px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  animation: rise 300ms ease both;
}

.thought::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--line-dark);
}

.thought-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--quiet);
  font-size: 7px;
}

.thought-meta span {
  color: var(--sage);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.thought p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.thought-thought,
.thought-journal {
  background: #f4efe3;
}

.thought-thought::before,
.thought-journal::before {
  background: var(--orange);
}

.thought-thought p {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.35;
}

.thought-journal p,
.thought-journal .thought-meta span {
  color: var(--sage);
}

.thought-blocked::before,
.thought-error::before {
  background: var(--alarm);
}

.thought-blocked p,
.thought-blocked .thought-meta span,
.thought-error p,
.thought-error .thought-meta span {
  color: var(--alarm);
}

.project-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(52, 94, 80, 0.1), transparent 65%),
    var(--sheet);
}

.token-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.token-strip div {
  display: grid;
  gap: 4px;
}

.token-strip strong {
  color: var(--orange);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
}

.token-strip button {
  max-width: 140px;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-strip button:hover {
  color: var(--white);
  border-color: var(--sage);
  background: var(--sage);
}

.project-stamp {
  align-self: center;
  justify-self: center;
  color: transparent;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.1em;
  -webkit-text-stroke: 1px rgba(52, 94, 80, 0.24);
  transform: rotate(-7deg);
}

.observer-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 6.5px;
}

.journal-page {
  width: min(900px, calc(100% - 44px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 54px 0 84px;
}

.journal-page > header {
  position: relative;
  padding: 28px 32px 32px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 3px 28px 3px 3px;
  background: var(--white);
  box-shadow: 10px 12px 0 var(--sage-soft);
}

.journal-page > header::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 5px;
  content: "";
  background: var(--orange);
}

.journal-page header > a,
.back-live {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journal-page header > a:hover,
.back-live:hover {
  color: var(--orange);
}

.journal-index-header h1 {
  margin: 32px 0 11px;
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.journal-index-header h1 span {
  color: var(--orange);
}

.journal-index-header p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.journal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 22px 0 0;
  list-style: none;
}

.journal-list li {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.82);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.journal-list li:hover {
  border-color: var(--line-dark);
  box-shadow: 6px 7px 0 var(--orange-soft);
  transform: translateY(-2px);
}

.journal-list a {
  min-height: 190px;
  display: block;
  padding: 21px 22px;
}

.journal-list a > div {
  display: flex;
  gap: 12px;
  color: var(--quiet);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journal-list a > div span {
  color: var(--orange);
}

.journal-list h2,
.journal-article h1 {
  margin: 13px 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
  transition: color 160ms ease;
}

.journal-list a:hover h2 {
  color: var(--orange);
}

.journal-list p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.journal-article header > p {
  margin: 28px 0 0;
  color: var(--orange);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journal-article h1 {
  max-width: 18ch;
  margin-top: 12px;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 0.95;
}

.journal-article article {
  padding: 38px 34px 28px;
}

.journal-article article p {
  margin: 0 0 23px;
  color: #49544c;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@keyframes sweep {
  from { transform: translateX(0); }
  to { transform: translateX(725%); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes rise {
  from { opacity: 0; transform: translateX(5px); }
}

@keyframes cursor-one {
  0%, 100% { left: 19%; top: 28%; }
  32% { left: 68%; top: 34%; }
  67% { left: 55%; top: 72%; }
}

@keyframes cursor-two {
  0%, 100% { right: 12%; bottom: 22%; }
  45% { right: 63%; bottom: 37%; }
  75% { right: 31%; bottom: 72%; }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .viewer-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto 76.5dvh auto;
  }

  .site-masthead {
    grid-template-columns: auto 1fr;
  }

  .market-intro {
    display: none;
  }

  .masthead-actions {
    justify-self: end;
  }

  .command-ribbon {
    grid-template-columns: 1fr;
  }

  .portfolio-ribbon {
    grid-template-columns: 1fr 1.6fr;
  }

  .allocation-card {
    grid-column: 1 / -1;
    min-height: 130px;
  }

  .current-goal {
    min-height: 82px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-grid {
    min-height: 82px;
  }

  .desk-footer {
    min-height: 220px;
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .observed-page {
    width: min(92%, 760px);
    padding: 26px;
  }

  .fact-grid,
  .source-line {
    display: none;
  }
}

@media (max-width: 650px) {
  .viewer-shell {
    gap: 7px;
    padding: 7px;
  }

  .site-masthead {
    grid-template-columns: 1fr auto;
    border-radius: 14px 14px 4px 4px;
  }

  .brand {
    font-size: 28px;
  }

  .connection-state {
    display: none;
  }

  .journal-link {
    border-radius: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .portfolio-ribbon {
    display: grid;
    grid-template-columns: 1fr;
  }

  .allocation-card {
    grid-column: auto;
  }

  .asset-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-metrics {
    grid-template-columns: 1fr;
  }

  .stats-grid div:not(.budget-track) {
    min-height: 64px;
  }

  .browser-surface {
    min-height: 510px;
  }

  .control-pill {
    display: none;
  }

  .browser-domain {
    max-width: 66%;
  }

  .desk-footer {
    display: block;
    border-radius: 4px 4px 14px 14px;
  }

  .thought-section {
    height: 205px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-card {
    min-height: 140px;
  }

  .project-stamp {
    display: none;
  }

  .journal-page {
    width: calc(100% - 24px);
    padding-top: 28px;
  }

  .journal-page > header {
    padding: 22px;
  }

  .journal-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
