:root {
  --ink: #383a34;
  --ink-soft: #4d5148;
  --paper: #fff6df;
  --cream: #ffecc2;
  --blue: #8ecae6;
  --green: #b7d88b;
  --pink: #ffb4c8;
  --orange: #ffb45f;
  --purple: #b9a5ff;
  --shadow: rgba(56, 58, 52, .18);
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255,180,200,.42), transparent 20%),
    radial-gradient(circle at 88% 16%, rgba(142,202,230,.36), transparent 22%),
    radial-gradient(circle at 82% 84%, rgba(183,216,139,.34), transparent 24%),
    linear-gradient(180deg, #fff8e8, #ffefc9 58%, #ffe2a7);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32,33,36,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32,33,36,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}

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

#doodle {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .96;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: clamp(16px, 4vw, 54px);
  right: clamp(16px, 4vw, 54px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 248, 232, .78);
  box-shadow: 7px 7px 0 var(--ink);
  backdrop-filter: blur(10px);
}

.brand,
.topbar nav,
.actions,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
}

.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  font-size: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}

.topbar nav {
  gap: 8px;
}

.topbar nav a {
  padding: 10px 13px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}

.topbar nav a:hover,
.topbar nav a.active {
  border-color: var(--ink);
  background: #fff;
}

main {
  position: relative;
  z-index: 2;
}

.section {
  min-height: 100vh;
  padding: 122px clamp(18px, 5vw, 80px) 80px;
  display: grid;
  align-items: center;
  gap: 34px;
}

.hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .72fr);
}

.hero-copy,
.section-title,
.profile-card {
  position: relative;
  z-index: 3;
  max-width: 860px;
}

.hero-copy {
  padding: 8px 0;
}

.hero-copy h1 {
  color: #191b17;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -22px -28px;
  max-width: min(880px, 92vw);
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255,248,232,.9), rgba(255,248,232,.62), transparent),
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.42), transparent 34%);
  filter: blur(2px);
}

.tag {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 9px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  animation: stickerFloat 4.8s ease-in-out infinite;
}

.hero-identity {
  background: #191b17;
  color: #fff8e8;
  border-color: #191b17;
  box-shadow: 4px 4px 0 rgba(56, 58, 52, .9);
}

h1,
h2 {
  margin: 0;
  max-width: 960px;
  font-size: clamp(48px, 7vw, 118px);
  line-height: .94;
  letter-spacing: 0;
  font-weight: 900;
  color: var(--ink-soft);
}

h2 {
  font-size: clamp(42px, 5.4vw, 88px);
}

.lead,
.profile-main > p:not(.tag) {
  max-width: 690px;
  margin: 24px 0 0;
  font-size: clamp(18px, 1.6vw, 25px);
  line-height: 1.55;
  font-weight: 700;
  color: #505349;
}

.actions {
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}

.button:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button.primary {
  background: var(--green);
}

.hero-board {
  position: relative;
  min-height: 520px;
  padding: 22px;
  border: 4px solid var(--ink);
  border-radius: 32px;
  background: #fff;
  box-shadow: 14px 14px 0 var(--ink);
  transform: rotate(2deg);
  animation: boardFloat 6s ease-in-out infinite;
}

.board-header {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.board-header span {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.board-header span:nth-child(1) { background: var(--pink); }
.board-header span:nth-child(2) { background: var(--orange); }
.board-header span:nth-child(3) { background: var(--green); }

.screen-row,
.cards,
.metrics {
  display: grid;
  gap: 18px;
}

.screen-row {
  grid-template-columns: repeat(2, 1fr);
}

.screen-row article,
.chart-card,
.note-card,
.project,
.metrics article,
.profile-card {
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: 7px 7px 0 var(--ink);
}

.screen-row article {
  padding: 18px;
}

.screen-row b {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.screen-row strong {
  display: block;
  margin-top: 18px;
  font-size: 38px;
  line-height: 1;
}

.chart-card {
  height: 170px;
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  background: var(--blue);
}

.chart-card i {
  flex: 1;
  height: var(--h);
  border: 3px solid var(--ink);
  border-radius: 14px 14px 8px 8px;
  background: #fff;
  transform-origin: bottom;
  animation: barPulse 2.8s ease-in-out infinite;
  animation-delay: calc(var(--h) * -0.018s);
}

.note-card {
  margin-top: 18px;
  padding: 20px;
  background: var(--pink);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.25;
}

.quant-board {
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 180, 200, .34), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(142, 202, 230, .35), transparent 30%),
    rgba(255, 255, 255, .72);
  backdrop-filter: blur(10px) saturate(1.08);
}

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

.quant-topline article,
.quant-footer article {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 236, 194, .82);
  box-shadow: 7px 7px 0 var(--ink);
}

.quant-topline article {
  padding: 18px;
}

.quant-topline b,
.quant-footer span {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.quant-topline strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: .92;
  color: #40443b;
}

.quant-topline small {
  display: block;
  margin-top: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #606558;
}

.quant-main {
  position: relative;
  min-height: 228px;
  margin-top: 18px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(142, 202, 230, .92), rgba(183, 216, 139, .68)),
    var(--blue);
  box-shadow: 7px 7px 0 var(--ink);
}

.chart-grid {
  position: absolute;
  inset: 0;
  opacity: .26;
  background-image:
    linear-gradient(rgba(56, 58, 52, .4) 2px, transparent 2px),
    linear-gradient(90deg, rgba(56, 58, 52, .34) 2px, transparent 2px);
  background-size: 54px 46px;
  animation: gridDrift 10s linear infinite;
}

.candles {
  position: absolute;
  left: 24px;
  right: 160px;
  bottom: 34px;
  top: 34px;
  display: flex;
  align-items: end;
  gap: 13px;
  z-index: 2;
}

.candle {
  position: relative;
  flex: 1;
  min-width: 18px;
  max-width: 38px;
  height: var(--h);
  transform: translateY(var(--shift));
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 4px 4px 0 rgba(56, 58, 52, .85);
  animation: candleFloat 2.8s ease-in-out infinite;
  animation-delay: var(--delay);
}

.candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -28px;
  bottom: -28px;
  width: 3px;
  border-radius: 99px;
  background: var(--ink);
  transform: translateX(-50%);
  z-index: -1;
}

.candle.up {
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), var(--green));
}

.candle.down {
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), var(--pink));
}

.equity-curve {
  position: absolute;
  inset: 36px 18px 24px 18px;
  z-index: 3;
  pointer-events: none;
}

.equity-curve path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.equity-curve path:first-child {
  stroke: rgba(255, 246, 223, .88);
  stroke-width: 16;
}

.equity-curve path:last-child {
  stroke: #40443b;
  stroke-width: 5;
  stroke-dasharray: 36 18;
  animation: curveMarch 2.8s linear infinite;
}

.order-pill {
  position: absolute;
  right: 20px;
  top: 28px;
  z-index: 4;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 180, 200, .78);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  animation: pillPop 3.2s ease-in-out infinite;
}

.order-pill.alt {
  top: auto;
  bottom: 24px;
  background: rgba(255, 246, 223, .82);
  animation-delay: -1.2s;
}

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

.quant-footer article {
  padding: 14px;
  min-height: 82px;
}

.quant-footer strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1;
  color: #40443b;
}

.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project {
  min-height: 260px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  transition: transform .18s ease;
  animation: cardBreathe 5.8s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 1s);
}

.project:hover {
  transform: translateY(-8px) rotate(-1deg);
}

.project:nth-child(1) { --delay: .1; }
.project:nth-child(2) { --delay: .4; }
.project:nth-child(3) { --delay: .7; }
.project:nth-child(4) { --delay: 1; }

.project span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
}

.project h3 {
  margin: 24px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.project p {
  margin: 16px 0 0;
  font-weight: 800;
  line-height: 1.45;
}

.color-a { background: var(--green); }
.color-b { background: var(--blue); }
.color-c { background: var(--pink); }
.color-d { background: var(--purple); }

.engine-detail,
.screener-detail,
.notes-detail {
  display: grid;
  gap: 22px;
  margin-top: 34px;
  padding: clamp(20px, 3vw, 34px);
  border: 4px solid var(--ink);
  border-radius: 34px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 12px 12px 0 var(--ink);
  backdrop-filter: blur(12px);
}

.screener-detail {
  background: rgba(142, 202, 230, .5);
}

.notes-detail {
  background: rgba(255, 180, 200, .5);
}

.engine-copy {
  max-width: 900px;
}

.engine-copy h3 {
  margin: 0;
  font-size: clamp(34px, 4vw, 62px);
  line-height: .98;
  color: var(--ink-soft);
}

.engine-copy p:not(.tag) {
  max-width: 880px;
  margin: 18px 0 0;
  color: #505349;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 800;
}

.engine-map,
.gate-row,
.radar-flow,
.watchlist-strip,
.portfolio-ledger,
.note-stats,
.note-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  position: relative;
}

.note-flow::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(56, 58, 52, .28);
  z-index: 0;
}

.engine-map article,
.gate-row article,
.radar-flow article,
.watchlist-strip article,
.portfolio-ledger article,
.note-stats article,
.note-flow article,
.state-strip {
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 246, 223, .78);
  box-shadow: 5px 5px 0 var(--ink);
}

.engine-map article {
  min-height: 132px;
  padding: 18px;
}

.engine-compact {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 44px minmax(170px, 1fr) 44px minmax(170px, 1fr) 44px minmax(170px, 1fr);
  align-items: center;
  gap: 10px;
}

.engine-compact article {
  min-height: 112px;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: rgba(255, 246, 223, .82);
  box-shadow: 5px 5px 0 var(--ink);
  display: grid;
  align-content: center;
}

.engine-compact article:nth-of-type(1) { background: rgba(142, 202, 230, .66); }
.engine-compact article:nth-of-type(2) { background: rgba(255, 180, 200, .66); }
.engine-compact article:nth-of-type(3) { background: rgba(183, 216, 139, .66); }
.engine-compact article:nth-of-type(4) { background: rgba(255, 236, 194, .82); }

.engine-compact span {
  width: fit-content;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.engine-compact strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.05;
  color: var(--ink-soft);
}

.engine-compact i {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--ink);
  position: relative;
}

.engine-compact i::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  transform: translateY(-50%) rotate(45deg);
}

.radar-flow article {
  min-height: 142px;
  padding: 18px;
  background: rgba(255, 255, 255, .72);
}

.portfolio-ledger {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portfolio-ledger article {
  min-height: 126px;
  padding: 16px;
  background: rgba(255, 255, 255, .72);
}

.engine-map b,
.radar-flow b,
.portfolio-ledger b,
.gate-row span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.engine-map strong,
.radar-flow strong,
.portfolio-ledger strong,
.gate-row strong {
  display: block;
  margin-top: 16px;
  font-size: 21px;
  line-height: 1.12;
}

.engine-map small,
.radar-flow small,
.portfolio-ledger small,
.gate-row small {
  display: block;
  margin-top: 10px;
  color: #505349;
  font-weight: 800;
  line-height: 1.4;
}

.note-card-demo {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(320px, 1fr);
  gap: 18px;
  padding: 22px;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: rgba(255, 246, 223, .82);
  box-shadow: 7px 7px 0 var(--ink);
}

.note-card-demo h4 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: .95;
  color: var(--ink-soft);
}

.note-card-demo p:not(.tag) {
  max-width: 540px;
  margin: 18px 0 0;
  color: #505349;
  font-weight: 800;
  line-height: 1.5;
}

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

.note-stats article {
  min-height: 112px;
  padding: 16px;
  background: rgba(255, 255, 255, .72);
}

.note-stats span,
.note-flow span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
}

.note-stats strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: 1;
}

.note-flow article {
  min-height: 178px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(185, 165, 255, .62));
  position: relative;
  z-index: 1;
}

.note-flow article::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 33px;
  width: 26px;
  height: 26px;
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  transform: rotate(45deg);
  background: transparent;
}

.note-flow article:last-child::after {
  display: none;
}

.note-flow strong {
  display: block;
  margin-top: 16px;
  font-size: 23px;
  line-height: 1.05;
}

.note-flow small {
  display: block;
  margin-top: 10px;
  color: #505349;
  font-weight: 800;
  line-height: 1.4;
}

.watchlist-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.watchlist-strip article {
  min-height: 130px;
  padding: 18px;
  background: rgba(255, 246, 223, .8);
}

.watchlist-strip strong {
  display: block;
  font-size: clamp(28px, 3vw, 42px);
  line-height: .9;
}

.watchlist-strip span {
  display: block;
  margin-top: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.watchlist-strip small {
  display: block;
  margin-top: 10px;
  color: #505349;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.gate-row article {
  padding: 18px;
}

.gate-row article:nth-child(1) { background: rgba(142, 202, 230, .66); }
.gate-row article:nth-child(2) { background: rgba(255, 180, 200, .66); }
.gate-row article:nth-child(3) { background: rgba(183, 216, 139, .66); }

.state-strip {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 180, 95, .54);
  flex-wrap: wrap;
}

.state-strip span {
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
}

.state-strip i {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--ink);
}

.state-strip em {
  margin-left: auto;
  max-width: 420px;
  color: #505349;
  font-style: normal;
  font-weight: 900;
  line-height: 1.4;
}

.radar {
  align-content: center;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article {
  min-height: 190px;
  padding: 22px;
  background: #fff;
  animation: metricPop 7s ease-in-out infinite;
}

.metrics strong {
  display: block;
  font-size: clamp(44px, 5vw, 82px);
  line-height: .9;
}

.metrics span {
  display: block;
  margin-top: 18px;
  font-weight: 900;
}

.profile-card {
  width: min(1180px, 100%);
  max-width: 1180px;
  padding: clamp(26px, 5vw, 56px);
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 246, 223, .75), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(142, 202, 230, .42), transparent 26%),
    rgba(255, 180, 95, .72);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
}

.profile-main {
  min-width: 0;
}

.profile-main h2 {
  max-width: none;
  font-size: clamp(34px, 4.1vw, 64px);
  line-height: .98;
  overflow-wrap: normal;
}

.analysis-stack {
  display: grid;
  gap: 14px;
  align-content: center;
}

.analysis-stack article {
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 246, 223, .82);
  box-shadow: 5px 5px 0 var(--ink);
  animation: cardBreathe 6s ease-in-out infinite;
}

.analysis-stack article:nth-child(2) {
  background: rgba(142, 202, 230, .66);
  animation-delay: -.8s;
}

.analysis-stack article:nth-child(3) {
  background: rgba(183, 216, 139, .66);
  animation-delay: -1.6s;
}

.analysis-stack article:nth-child(4) {
  background: rgba(255, 180, 200, .66);
  animation-delay: -2.4s;
}

.analysis-stack span {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-stack strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.08;
  color: var(--ink-soft);
}

.footer {
  position: relative;
  z-index: 3;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 5vw, 80px);
  font-weight: 900;
  color: var(--ink-soft);
}

@keyframes boardFloat {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-12px) rotate(.5deg); }
}

@keyframes stickerFloat {
  0%, 100% { transform: rotate(-.4deg); }
  50% { transform: translateY(-3px) rotate(.6deg); }
}

@keyframes barPulse {
  0%, 100% { transform: scaleY(.92); }
  50% { transform: scaleY(1.06); }
}

@keyframes cardBreathe {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

@keyframes metricPop {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-.6deg) translateY(-4px); }
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 108px 92px, 108px 92px; }
}

@keyframes candleFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@keyframes curveMarch {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -54; }
}

@keyframes pillPop {
  0%, 100% { transform: rotate(1deg) scale(1); }
  50% { transform: rotate(-1deg) scale(1.04); }
}

@media (max-width: 1000px) {
  .topbar nav {
    display: none;
  }

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

  .hero-board {
    min-height: 420px;
    transform: rotate(0);
  }

  .cards,
  .metrics,
  .engine-map,
  .gate-row,
  .radar-flow,
  .watchlist-strip,
  .portfolio-ledger,
  .note-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-flow::before,
  .note-flow article::after {
    display: none;
  }

  .note-card-demo {
    grid-template-columns: 1fr;
  }

  .quant-footer {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .engine-compact {
    grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr;
    gap: 8px;
  }

  .engine-compact strong {
    font-size: 19px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 58px;
    border-radius: 18px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  h1,
  h2 {
    font-size: clamp(42px, 15vw, 64px);
  }

  .profile-main h2 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .cards,
  .metrics,
  .screen-row,
  .engine-map,
  .gate-row,
  .radar-flow,
  .watchlist-strip,
  .portfolio-ledger,
  .note-stats,
  .note-flow {
    grid-template-columns: 1fr;
  }

  .state-strip i {
    width: 24px;
  }

  .quant-topline {
    grid-template-columns: 1fr;
  }

  .quant-main {
    min-height: 210px;
  }

  .candles {
    right: 26px;
    gap: 8px;
  }

  .order-pill {
    right: 14px;
    top: 12px;
    font-size: 10px;
    padding: 8px 10px;
  }

  .order-pill.alt {
    bottom: 12px;
  }

  .engine-compact {
    grid-template-columns: 1fr;
  }

  .engine-compact i {
    width: 5px;
    height: 24px;
    justify-self: center;
  }

  .engine-compact i::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -2px;
    transform: translateX(-50%) rotate(135deg);
  }

  .footer {
    display: grid;
  }
}
