@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --panel: #141418;
  --panel-2: #191920;
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --ink: #f2efe9;
  --ink-2: #b9b4ab;
  --ink-3: #7d7871;
  --amber: #ffb454;
  --amber-2: #ffcd85;
  --amber-ink: #2b1a00;
  --blue: #5aa9ff;
  --mint: #7fe0b0;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --display: "Inter Tight", "Inter", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bar: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.list-view {
  overflow: auto;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
dl {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.ok {
  color: var(--mint);
}

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--amber-2);
  font-size: 1.06em;
}

.icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.u {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 14px;
  background: var(--amber);
  color: var(--amber-ink);
  z-index: 100;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* bar */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar);
  padding: 0 20px;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand em {
  font-family: var(--display);
  font-style: normal;
  font-weight: 500;
  font-size: inherit;
  color: var(--ink-2);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.back:hover {
  color: var(--ink);
  border-color: var(--line-2);
}

.back .icon {
  transform: rotate(180deg);
}

.bar-mid {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.seg-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.seg-btn.active {
  background: var(--ink);
  color: var(--bg);
}

.zoom {
  display: inline-flex;
  gap: 4px;
}

.ctl {
  height: 34px;
  min-width: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.ctl:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ctl-tour {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px 0 12px;
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
  font-size: 14px;
  box-shadow: 0 8px 24px -10px rgba(255, 180, 84, 0.7);
}

.ctl-tour:hover {
  background: var(--amber-2);
}

.ctl-tour.active {
  background: transparent;
  color: var(--amber);
}

.ctl-tour .icon {
  width: 14px;
  height: 14px;
}

.tour-callout {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 180, 84, 0.4);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.92);
  color: var(--amber-2);
  white-space: nowrap;
  opacity: 0;
  animation: callout 600ms var(--ease) 1200ms forwards;
  pointer-events: none;
}

.tour-callout::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(10, 10, 12, 0.92);
  border-left: 1px solid rgba(255, 180, 84, 0.4);
  border-top: 1px solid rgba(255, 180, 84, 0.4);
}

.tour-callout.gone {
  animation: none;
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

@keyframes callout {
  to {
    opacity: 1;
  }
}

.bar-mid {
  position: relative;
}

.zoom-dock {
  position: absolute;
  right: 20px;
  bottom: calc(20px + 200px * 2500 / 3700 + 14px);
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dock-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms var(--ease);
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dock-fit {
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.dock-fit .icon {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.btn-solid {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.btn-solid:hover {
  background: var(--amber-2);
}

.btn-sm {
  padding: 8px 13px;
  font-size: 13px;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.textlink:hover {
  color: var(--ink);
}

/* viewport */
.viewport {
  position: fixed;
  inset: var(--bar) 0 0 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.4px);
  background-size: 28px 28px;
  user-select: none;
}

.viewport.dragging {
  cursor: grabbing;
}

.list-view .viewport {
  display: none;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}

.ready .world {
  opacity: 1;
}

.viewport.dragging .world {
  will-change: transform;
}

.links {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.links path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
  transition: stroke 300ms var(--ease), opacity 300ms var(--ease);
}

.links marker path {
  fill: rgba(255, 255, 255, 0.35);
  stroke: none;
  transition: fill 300ms var(--ease);
}

.world.has-focus .links path:not(.on) {
  opacity: 0.35;
}

.links path.on {
  stroke: var(--amber);
  stroke-dasharray: none;
  stroke-width: 1.8;
}

.link-labels g {
  opacity: 0;
  transition: opacity 250ms var(--ease);
  pointer-events: none;
}

.link-labels g.on {
  opacity: 1;
}

.link-labels rect {
  fill: #141418;
  stroke: rgba(255, 180, 84, 0.5);
}

.link-labels text {
  fill: var(--amber-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* nodes */
.node {
  position: absolute;
  contain: layout paint style;
  padding: 22px 24px 24px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  transition: border-color 250ms var(--ease), opacity 400ms var(--ease), box-shadow 250ms var(--ease);
  cursor: default;
}

.node:hover {
  border-color: rgba(255, 255, 255, 0.32);
}

.node.focus {
  border-color: var(--amber);
  box-shadow:
    0 0 0 4px rgba(255, 180, 84, 0.14),
    0 40px 80px -40px rgba(0, 0, 0, 0.95);
}

.world.has-focus .node:not(.focus) {
  opacity: 0.4;
}

.world.has-focus .node.near {
  opacity: 0.85;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
}

.node h2,
.lv-item h2,
.lv-block > h2 {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.node h2 a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.node h2 a:hover {
  color: var(--amber-2);
}

.display {
  margin-top: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.035em;
}

.who {
  margin-top: 14px;
  line-height: 1.7;
}

.lead {
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink-2);
}

.summary {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 20px;
}

.legend {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.legend b {
  color: var(--amber);
  font-weight: 600;
}

.node-diagram {
  margin: 14px -6px 4px;
}

.diagram {
  width: 100%;
  height: auto;
}

.dg-edge {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}

.dg-dot {
  fill: var(--amber);
  display: none;
}

.node.focus .dg-dot {
  display: block;
}

.dg-node rect {
  fill: #1e1e24;
  stroke: rgba(255, 255, 255, 0.18);
}

.dg-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

.dg-sub {
  fill: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
}

.outcomes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.outcomes div {
  padding: 12px 10px 0 0;
  border-right: 1px solid var(--line);
}

.outcomes div + div {
  padding-left: 10px;
}

.outcomes div:last-child {
  border-right: 0;
}

.outcomes strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.outcomes span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.list li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.dash {
  width: 10px;
  height: 2px;
  margin-top: 9px;
  border-radius: 2px;
  background: var(--amber);
}

.stack {
  margin-top: 12px;
}

.node-shot {
  display: block;
  margin: -22px -24px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.node-shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.node-role h2 {
  font-size: 18px;
}

.node-role.current {
  border-color: rgba(255, 180, 84, 0.45);
}

.node-role .list li {
  font-size: 13px;
}

.tier {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tier:first-of-type {
  margin-top: 10px;
}

.tier strong {
  font-family: var(--display);
  font-size: 14px;
  color: var(--ink-2);
}

.tier-items {
  margin-top: 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.how {
  margin-top: 18px;
}

.steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
}

.steps .mono {
  color: var(--amber);
  padding-top: 2px;
}

.steps strong {
  font-family: var(--display);
  font-size: 14px;
}

.steps p {
  font-size: 13px;
  color: var(--ink-2);
}

.facts {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.facts div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.facts dd {
  margin: 0;
}

.earlier {
  margin-top: 12px;
}

.big-email {
  display: block;
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.035em;
  line-height: 1.1;
  word-break: break-all;
  transition: color 200ms var(--ease);
}

.big-email:hover {
  color: var(--amber-2);
}

.big-email .mono {
  display: block;
  margin-top: 6px;
}

.fit {
  margin-top: 14px;
}

/* minimap + hint */
.minimap {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 200px;
  height: calc(200px * 2500 / 3700);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  cursor: pointer;
}

.mini-node {
  position: absolute;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
}

.mini-node.mini-start {
  background: var(--amber);
}

.mini-node.mini-product {
  background: var(--blue);
}

.mini-node.mini-contact {
  background: var(--mint);
}

.mini-view {
  position: absolute;
  border: 1px solid var(--amber);
  background: rgba(255, 180, 84, 0.08);
  border-radius: 3px;
  transition: all 120ms linear;
}

.hint {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.8);
  transition: opacity 600ms var(--ease);
}

.hint.fade {
  opacity: 0;
}

/* tour bar */
.tourbar {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}

.tourbar[hidden] {
  display: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.9);
  font-size: 13.5px;
  color: var(--ink-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast a {
  color: var(--amber-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
}

.tour-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  min-width: 260px;
  justify-content: center;
}

.tour-count {
  color: var(--amber);
}

.tour-label {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.ctl-next {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--amber-ink);
}

.ctl-next:hover {
  background: var(--amber-2);
}

.ctl-quiet {
  border-color: transparent;
  color: var(--ink-3);
}

.ctl[disabled] {
  opacity: 0.4;
  cursor: default;
}

.small-screen {
  display: none;
  width: min(100% - 40px, 520px);
  margin: 0 auto;
  padding: calc(var(--bar) + 64px) 0 64px;
}

.small .small-screen {
  display: block;
}

.small .viewport {
  display: none;
}

.small-screen h1 {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.small-screen .btn {
  margin-top: 20px;
}

/* list view (unused, kept for no-JS) */
.list-mode {
  display: none;
  width: min(100% - 48px, 760px);
  margin: 0 auto;
  padding: calc(var(--bar) + 48px) 0 80px;
}

html:not(.js) .viewport,
html:not(.js) .bar-mid {
  display: none;
}

html:not(.js) .small-screen {
  display: block;
}

.lv-block {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.lv-block .display {
  font-size: clamp(36px, 6vw, 56px);
}

.lv-block .lead {
  font-size: 17px;
}

.lv-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.lv-item:first-of-type {
  margin-top: 16px;
}

.lv-product {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}

.lv-product .node-shot {
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
}

.lv-block .big-email {
  font-size: clamp(22px, 5vw, 40px);
}

@media (prefers-reduced-motion: reduce) {
  .links path {
    animation: none;
  }
  .dg-dot {
    display: none;
  }
}

@media (max-width: 800px) {
  .bar {
    padding: 0 14px;
    gap: 8px;
  }
  .brand {
    font-size: 15px;
  }
  .brand em {
    display: none;
  }
  .bar .btn span,
  .bar .btn .icon {
    display: none;
  }
  .bar-mid,
  .minimap,
  .zoom-dock,
  .back span {
    display: none;
  }
  .lv-product {
    grid-template-columns: 1fr;
  }
  .list-mode {
    width: min(100% - 32px, 760px);
  }
}

.product-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-title .app-mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.node-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
}

.node-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--amber-2, #ffcd85);
}

.node-links .icon-arrow {
  width: 13px;
  height: 13px;
}
