/* CSS do produto. Carregado depois de ds/tokens.css e ds/base.css;
   só usa tokens, nenhuma cor chumbada. */

@layer components {
  :root { --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }

  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; }
  p, h1, h2, h3, ol { margin: 0; }
  a { color: var(--link); }

  .shell { width: min(56rem, 100% - 2rem); margin-inline: auto; }
  .mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }
  .text-dim { color: var(--text-dim); }
  .text-muted { color: var(--text-muted); }

  .navbar-inner { display: flex; align-items: center; justify-content: space-between; padding-right: 0.875rem; }
  .brand { text-decoration: none; }

  /* ── Hero ── */
  .hero { padding: 4.5rem 0 2.5rem; text-align: center; }
  .eyebrow { margin-bottom: 0.75rem; color: var(--accent); font-weight: 600; font-size: 0.9375rem; }
  .hero .large-title { font-size: clamp(2.25rem, 6vw, 3.5rem); }
  .lede { max-width: 34rem; margin: 1rem auto 0; color: var(--text-muted); }

  /* ── Máquina de cortar ── */
  .machine { display: grid; gap: 1rem; }
  .slot { display: grid; gap: 0.5rem; padding: 1rem; border-radius: var(--radius-md); background: var(--surface-3); }
  .slot-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

  .cut-zone { position: relative; }
  .long-url { min-height: 3em; overflow-wrap: anywhere; color: var(--text-muted); line-height: 1.55; }
  .long-url span { display: inline-block; white-space: pre; }
  .long-url .fall {
    animation: fall 0.9s var(--ease) forwards;
    animation-delay: var(--delay, 0ms);
  }
  @keyframes fall {
    to { opacity: 0; transform: translate(var(--dx, 0), 5rem) rotate(var(--rot, 0deg)); }
  }

  .scissors {
    position: absolute;
    top: -0.9rem;
    left: -1rem;
    font-size: 1.5rem;
    opacity: 0;
    pointer-events: none;
  }
  .slot[data-state="cutting"] .scissors { animation: snip 0.8s var(--ease) forwards; }
  @keyframes snip {
    0%   { opacity: 1; transform: translateX(0) rotate(-90deg); }
    25%  { transform: translateX(25cqw) rotate(-75deg); }
    50%  { transform: translateX(50cqw) rotate(-95deg); }
    75%  { transform: translateX(75cqw) rotate(-75deg); }
    100% { opacity: 0; transform: translateX(100cqw) rotate(-90deg); }
  }
  .cut-zone { container-type: inline-size; }

  /* O único momento de --glow da tela: o link curto */
  .result {
    position: relative;
    background: var(--surface);
    isolation: isolate;
    animation: sheet-in 0.5s var(--ease-spring) both;
  }
  .result::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: calc(var(--radius-md) + 2px);
    background: var(--glow);
  }
  .result::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: var(--radius-md);
    background: var(--surface);
  }
  .result[hidden] { display: none; }
  .short-url { font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

  .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
  .actions .btn { flex: 1 1 12rem; }
  kbd {
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
  }
  @media (hover: none) { .kbd-hint { display: none; } }

  /* ── Números ── */
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; margin-top: 1rem; }
  .stat { display: grid; gap: 0.25rem; padding: 1.25rem; }
  .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
  .stat-value.bump { animation: pop-in 0.4s var(--ease-spring); }

  /* ── Como funciona ── */
  .how { margin-top: 3.5rem; }
  .how .title-2 { margin-bottom: 1rem; }
  .steps { display: grid; gap: 0.75rem; padding: 0; list-style: none; }
  .steps .card { display: flex; gap: 1rem; align-items: flex-start; }
  .step-n {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-pill);
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 700;
  }

  .footer { padding: 3.5rem 0 2.5rem; text-align: center; }

  /* ── 404 ── */
  .lost { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding-block: 2rem; }
  .lost-card { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: min(30rem, 100%); text-align: center; }
  .lost-emoji { font-size: 3.5rem; animation: wobble 2.4s var(--ease) infinite; }
  @keyframes wobble {
    0%, 100% { transform: rotate(-12deg); }
    50%      { transform: rotate(12deg) translateY(-4px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation-delay: 0ms !important; }
}
