/* 奔流 BenLiu — landing page, part 1: hero, sources strip, the three-step flow.
   Tokens and shared pieces come from styles.css. */

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  grid-template-areas:
    "title title"
    "copy preview";
  gap: clamp(2rem, 1.2rem + 3vw, 3.5rem) clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
  padding-top: clamp(2.75rem, 1.5rem + 5vw, 5.5rem);
}

.hero-title {
  grid-area: title;
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}

.hero-copy {
  grid-area: copy;
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-top: 0.5rem;
}

.hero-preview {
  grid-area: preview;
  /* room for the confirm prompt hanging below the window */
  margin-bottom: 5.75rem;
}

.hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

/* The first screen never waits for a script: it enters with plain CSS. */
.hero-title,
.hero-copy,
.hero-preview {
  animation: hero-in 0.8s var(--ease) both;
}

.hero-copy {
  animation-delay: 90ms;
}

.hero-preview {
  animation-delay: 160ms;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* the accent phrase never breaks in the middle */
.hero h1 .grad {
  white-space: nowrap;
}

.hero-lede {
  max-width: 34ch;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Three facts on a ruled line instead of a row of pills. */
.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0 clamp(1.25rem, 0.5rem + 2.6vw, 2.5rem);
  margin: 0.75rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.hero-facts li {
  display: grid;
  gap: 0.15rem;
}

.hero-facts b {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-facts span {
  color: var(--ink-3);
  font-size: var(--text-small);
}

/* ----- the app window ----- */
.hero-preview {
  position: relative;
  min-width: 0;
}

.win {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.win-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.win-bar i:nth-child(1) { background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }

.win-bar span {
  margin: 0 auto;
  padding-right: 42px;
  color: var(--ink-3);
  font-size: 11px;
}

.win-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
}

.win-side {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.win-side p {
  margin: 10px 8px 4px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.win-side span {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--ink-2);
}

.win-side span em {
  color: var(--ink-4);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.win-side span.is-on {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 600;
}

.win-main {
  display: grid;
  gap: 10px;
  padding: 12px;
  min-width: 0;
}

.win-stats {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
}

.win-stat {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.win-stat small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.win-stat b {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.win-stat.is-hero {
  position: relative;
  border-color: var(--brand-line);
  background: var(--brand-soft);
  overflow: hidden;
}

.win-stat.is-hero b {
  color: var(--brand-deep);
}

.win-stat.is-hero svg {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 44%;
  height: 22px;
  color: var(--brand);
}

.win-task {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.win-task .ext {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--paper-sunk);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.win-task .name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.win-task .name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.win-task .chip {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 600;
}

.win-task .chip.is-done {
  background: var(--ok-soft);
  color: var(--ok);
}

.win-task .pct {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.win-task .meta {
  grid-column: 2 / -1;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Multi-connection pieces: each segment fills on its own. */
.segs {
  grid-column: 2 / -1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  height: 7px;
}

.segs i {
  position: relative;
  border-radius: 2px;
  background: var(--paper-sunk);
  overflow: hidden;
}

.segs i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(calc(var(--p, 0) / 100));
}

.segs i.live::after {
  animation: seg-fill 2.8s var(--ease) infinite;
  animation-delay: calc(var(--d, 0) * 1ms);
}

@keyframes seg-fill {
  0% { transform: scaleX(calc(var(--p, 0) / 100)); }
  70%, 100% { transform: scaleX(1); }
}

.bar {
  grid-column: 2 / -1;
  height: 7px;
  border-radius: 4px;
  background: var(--paper-sunk);
  overflow: hidden;
}

.bar em {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
}

.bar.is-done em {
  background: var(--ok);
}

/* Floating pieces give the hero depth: the confirm prompt over the window. */
.float-confirm {
  position: absolute;
  left: clamp(-4.5rem, -5vw, -1rem);
  bottom: -5.75rem;
  width: min(252px, 70%);
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 11.5px;
  line-height: 1.45;
}

.float-confirm header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.float-confirm header::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.float-confirm dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0 0 10px;
}

.float-confirm dt {
  color: var(--ink-3);
}

.float-confirm dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.float-confirm footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.float-confirm footer span {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-weight: 600;
}

.float-confirm footer span:last-child {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

/* ==========================================================================
   SOURCES STRIP
   ========================================================================== */
.sources {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: baseline;
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.sources p {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 500;
}

.sources li + li::before {
  content: "/";
  margin-right: 1.6rem;
  color: var(--ink-4);
  font-weight: 400;
}

/* ==========================================================================
   STEPS — a ruled flow, not three cards
   ========================================================================== */
.steps-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.steps-flow li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.6rem clamp(1rem, 0.4rem + 1.8vw, 2rem) 0.5rem 0;
}

.steps-flow li + li {
  padding-left: clamp(1rem, 0.4rem + 1.8vw, 2rem);
  border-left: 1px solid var(--line);
}

/* the marker sits on the rule */
.steps-flow li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.steps-flow li + li::before {
  left: -5px;
}

.steps-flow .no {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--brand);
}

.steps-flow h3 {
  font-size: var(--text-h3);
}

.steps-flow p {
  color: var(--ink-2);
  font-size: 0.96rem;
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "copy"
      "preview";
  }

  .float-confirm {
    left: 1rem;
  }
}

@media (max-width: 760px) {
  .steps-flow {
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
    border-left: 1px solid var(--ink);
  }

  .steps-flow li,
  .steps-flow li + li {
    padding: 0 0 2rem 1.5rem;
    border-left: 0;
  }

  .steps-flow li::before,
  .steps-flow li + li::before {
    top: 0.9rem;
    left: -5px;
  }

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

  .sources ul {
    gap: 0.3rem 1.25rem;
  }

  .sources li + li::before {
    content: none;
  }
}

@media (max-width: 520px) {
  .win-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .win-side {
    display: none;
  }

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

  .win-stat:nth-child(3) {
    display: none;
  }

  .hero-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .float-confirm {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    margin: -1.25rem 0.75rem 0;
  }

  .hero-preview {
    margin-bottom: 0;
  }
}
