/* ==========================================================================
   Basenine Labs — hero study v3
   Builds on /v2/v2.css (tokens, nav, hero type). Replaces the globe with an
   animated system diagram in the brand's technical-drawing language.
   ========================================================================== */

/* ---------- Hero adjustments ---------- */

.page > .hero { padding-bottom: clamp(72px, 8vw, 120px); }
.hero-sub {
  max-width: 60ch;
  color: var(--ink);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
}
.hero-deco--left { top: 9%; width: min(24vw, 340px); }
.hero-deco--right { top: 4%; width: min(15vw, 220px); }

/* ---------- Shared label ---------- */

.lbl {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--muted);
}
.lbl--light { color: rgba(244, 244, 236, 0.5); }
.lbl--signal { color: var(--signal-dark); }

/* ---------- System diagram ---------- */

.hero-inner > .sys { justify-self: stretch; width: 100%; }
.sys {
  position: relative;
  margin-top: clamp(56px, 6vw, 88px);
  text-align: left;
}
.sys-kicker {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 0.75px solid var(--rule);
}

.sys-rail {
  position: absolute;
  z-index: 0;
  border-top: 0.75px solid rgba(30, 30, 30, 0.35);
  pointer-events: none;
}
.sys-rail.is-vertical { border-top: 0; border-left: 0.75px solid rgba(30, 30, 30, 0.35); }
.sys-packet {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--signal);
  pointer-events: none;
}

.sys-stations {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.station { position: relative; display: grid; align-content: start; gap: 12px; }
.st-head { display: flex; align-items: center; gap: 10px; min-height: 20px; }
.st-node {
  position: relative;
  z-index: 2;
  flex: none;
  width: 11px;
  height: 11px;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.station.is-active .st-node,
.station.is-done .st-node { background: var(--signal); border-color: var(--signal); }
.st-n { color: var(--signal-dark); font-family: "DM Mono", ui-monospace, monospace; font-size: 11px; }
.st-t { font-size: 17px; letter-spacing: -0.03em; }

.st-card {
  position: relative;
  height: clamp(196px, 16.5vw, 228px);
  padding: 14px;
  overflow: hidden;
  border: 0.75px solid var(--rule);
  border-radius: 16px;
  background: var(--white);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.st-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--signal);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.station.is-active .st-card {
  border-color: rgba(30, 30, 30, 0.55);
  box-shadow: 0 22px 44px -30px rgba(30, 30, 30, 0.5);
}
.station.is-active .st-card::after { opacity: 1; }
.st-cap { max-width: 30ch; color: var(--muted-strong); font-size: 14px; line-height: 1.45; letter-spacing: -0.01em; }

/* 01 · Move your content */
.mig { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; gap: 6px; height: 100%; }
.mig-box {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 10px 9px;
  border: 0.75px solid var(--rule);
  border-radius: 10px;
}
.mig-from { background: #fafaf5; }
.mig-to { border-color: rgba(30, 30, 30, 0.35); background: var(--white); }
.mig-rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mig-rows li {
  display: flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(30, 30, 30, 0.07);
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.mig-from li { transition: opacity 0.4s var(--ease) calc(0.3s + var(--i) * 0.5s); }
.station.is-active .mig-from li,
.station.is-done .mig-from li { opacity: 0.28; }
.mig-to li {
  background: rgba(255, 59, 48, 0.1);
  color: var(--signal-dark);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.45s var(--ease) calc(0.5s + var(--i) * 0.5s), transform 0.45s var(--ease) calc(0.5s + var(--i) * 0.5s);
}
.station.is-active .mig-to li,
.station.is-done .mig-to li { opacity: 1; transform: none; }
.mig-arrow { color: var(--muted); font-family: "DM Mono", ui-monospace, monospace; font-size: 13px; text-align: center; transition: color 0.3s var(--ease); }
.station.is-active .mig-arrow { color: var(--signal); animation: sys-nudge 1s var(--ease) infinite; }
.mig-page {
  display: grid;
  place-items: center;
  height: 32px;
  border: 0.75px dashed rgba(30, 30, 30, 0.35);
  border-radius: 5px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
}
.mig-to .mig-page { border-style: solid; border-color: var(--ink); color: var(--ink); opacity: 0; transition: opacity 0.45s var(--ease) 2.1s; }
.station.is-active .mig-to .mig-page,
.station.is-done .mig-to .mig-page { opacity: 1; }

/* 02 · Brand Rails */
.rails { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 9px; height: 100%; }
.rails-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 7px; }
.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 6px 7px;
  border: 0.75px solid rgba(30, 30, 30, 0.18);
  border-radius: 7px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
  opacity: 0.45;
  transition: opacity 0.35s var(--ease) calc(var(--i) * 0.3s), border-color 0.35s var(--ease) calc(var(--i) * 0.3s), color 0.35s var(--ease) calc(var(--i) * 0.3s);
}
.tile::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 42%;
  height: 5px;
  border-radius: 2px;
  background: rgba(30, 30, 30, 0.14);
}
.station.is-active .tile,
.station.is-done .tile { border-color: rgba(30, 30, 30, 0.5); color: var(--ink); opacity: 1; }
.tick {
  position: absolute;
  top: 4px;
  right: 6px;
  color: var(--signal);
  font-size: 10px;
  font-style: normal;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s var(--ease) calc(var(--i) * 0.3s + 0.2s), transform 0.3s var(--ease) calc(var(--i) * 0.3s + 0.2s);
}
.station.is-active .tick,
.station.is-done .tick { opacity: 1; transform: none; }
.rails-foot { display: flex; justify-content: space-between; }

/* 03 · Describe the page */
.st-card--dark { padding: 0; border-color: var(--ink); background: var(--ink); }
.station.is-active .st-card--dark { border-color: var(--ink); }
.mini-term { display: grid; grid-template-rows: auto 1fr; height: 100%; color: var(--paper); }
.mt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 0.75px solid rgba(244, 244, 236, 0.12);
}
.mt-dots { display: inline-flex; gap: 5px; }
.mt-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(244, 244, 236, 0.22); }
.mt-dots i:first-child { background: var(--signal); }
.mt-body {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 10.5px;
  line-height: 1.6;
}
.mt-body p { margin: 0; }
.mt-body .t-you, .mt-body .t-ok { color: var(--signal); }
.mt-body .t-claude { color: var(--paper); }
.mt-next { color: rgba(244, 244, 236, 0.72); opacity: 0; transition: opacity 0.35s var(--ease); }
.mt-last { transition-delay: 0.5s; }
.station.is-typed .mt-next,
.station.is-done .mt-next { opacity: 1; }
.mt-type::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--signal);
  opacity: 0;
}
.station.is-typing .mt-type::after { animation: sys-caret 0.9s steps(1) infinite; }

/* 04 · Approve and ship */
.pv { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 9px; height: 100%; }
.pv-top { display: flex; align-items: center; justify-content: space-between; padding-right: 18px; }
.pv-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 9.5px;
  text-transform: uppercase;
}
.pv-status i { width: 7px; height: 7px; border-radius: 50%; background: #c7c7bd; transition: background 0.3s var(--ease); }
.station.is-approved .pv-status i { background: var(--signal); animation: sys-live 1.6s infinite; }
.pv-time { opacity: 0; transition: opacity 0.3s var(--ease); }
.station.is-approved .pv-time { opacity: 1; }
.pv-page {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 0.75px solid var(--rule);
  border-radius: 8px;
  background: #fafaf5;
}
.blk {
  display: block;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease) calc(var(--i) * 0.28s), transform 0.4s var(--ease) calc(var(--i) * 0.28s);
}
.blk-hero { height: 28px; background: var(--ink); }
.blk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.blk-row b { height: 22px; border-radius: 3px; background: rgba(30, 30, 30, 0.12); }
.blk-cta { width: 46%; height: 12px; border-radius: 999px; background: var(--signal); }
.station.is-active .blk,
.station.is-done .blk { opacity: 1; transform: none; }
.pv-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 7px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
}
.pv-checks > span { opacity: 0; transition: opacity 0.3s var(--ease) calc(1s + var(--i) * 0.2s); }
.pv-checks b { color: var(--signal); font-weight: 400; }
.station.is-active .pv-checks > span,
.station.is-done .pv-checks > span { opacity: 1; }
.pv-approve {
  flex: none;
  padding: 5px 11px;
  border: 0.75px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.station.is-pressing .pv-approve { transform: scale(0.9); }
.station.is-approved .pv-approve { border-color: var(--signal); background: var(--signal); }

/* ---------- Motion ---------- */

@keyframes sys-nudge { 50% { transform: translateX(3px); } }
@keyframes sys-caret { 50% { opacity: 1; } }
@keyframes sys-live {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.5); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0); }
}
.sys.no-anim *,
.sys.no-anim *::before,
.sys.no-anim *::after { transition: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hero-deco { display: none; }
  .sys-stations { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
}

@media (max-width: 640px) {
  .sys-stations { grid-template-columns: 1fr; row-gap: 30px; }
  .station { padding-left: 26px; }
  .st-node { position: absolute; top: 4px; left: 0; }
  .st-card { height: 212px; }
  .st-cap { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sys *, .sys *::before, .sys *::after { transition: none !important; animation: none !important; }
}
