/* /return-on-tokens/: coding-agent rework campaign landing page.
   Inherits Spline Sans / Piazzolla and site tokens from typography.css,
   colors.css, and spacing.css. Only page-unique styles live here.

   One conversion path: every block either explains the wrong-turn problem or
   leads to "Try Brief free". Fern is the action colour (buttons, the With
   Brief column); the dark agent window is the only dark surface above the
   final CTA band, so the eye lands on it first. */

.rot {
  --rot-fern: var(--color-cta-background);
  --rot-rule: var(--color-border-subtle);
  --rot-rule-strong: var(--color-border);

  /* Agent window palette. Slate from the primary ramp so it sits with the
     rest of the site; the two syntax colours are page-local. */
  --rot-ink: var(--color-primary-dark);
  --rot-ink-raised: var(--color-primary);
  --rot-ink-line: var(--color-primary-light);
  --rot-ink-text: var(--color-secondary-hover-light);
  --rot-ink-muted: #94A3B8;
  --rot-tk-string: #6EE7B7;
  --rot-tk-fn: #93C5FD;
  --rot-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--color-text);
  background: var(--color-background);
}

.rot a:not(.btn) {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--color-accent-dark) 35%, transparent);
}

.rot a:not(.btn):hover {
  text-decoration-color: currentColor;
}

/* Shared type ---------------------------------------------------------- */

/* Rules on this page that style a <p> (.rot-lede, .rot-cta-note, ...) are
   scoped under .rot so they outrank the element-qualified `.rot-section p`
   block below. */
.rot-label {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.rot-section {
  padding: var(--space-4xl) 0;
}

.rot-section--subtle {
  background: var(--color-background-subtle);
}

.rot-section h2 {
  max-width: 24ch;
  margin: 0 0 var(--space-lg);
  letter-spacing: -0.01em;
}

.rot-section p {
  max-width: 62ch;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
}

/* CTA block: button plus the setup line under it. */
.rot-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.rot-cta .btn {
  padding: 0.875rem 1.75rem;
  font-size: var(--font-size-lg);
}

.rot .rot-cta-note {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  max-width: none;
  margin: 0;
}

.rot-cta--center {
  align-items: center;
  text-align: center;
  margin-top: var(--space-2xl);
}

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

.rot-hero {
  padding: var(--space-3xl) 0 var(--space-3xl);
}

.rot-hero-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.rot-hero h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 22ch;
}

.rot-h1-accent {
  display: block;
  color: var(--color-accent-dark);
}

.rot .rot-lede {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
  max-width: 52ch;
  margin: var(--space-lg) 0 0;
}

@media (min-width: 1024px) {
  .rot-hero {
    padding-top: var(--space-4xl);
  }

  .rot-hero-grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: var(--space-2xl);
  }
}

@media (min-width: 1200px) {
  .rot-hero h1 {
    font-size: var(--font-size-4-5xl);
  }
}

/* Agent window mockup ------------------------------------------------------
   Static markup, not a screenshot: it stays sharp, costs no image bytes, and
   the text is real. role="img" + aria-label on the window gives assistive tech
   one sentence instead of a chat transcript. */

/* The caption comes first in the markup, so screen readers and the Markdown
   sibling read "Example:" before the transcript; flex order puts it back under
   the window visually. */
.rot-demo {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

.rot-demo-window {
  background: var(--rot-ink);
  color: var(--rot-ink-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-large), 0 30px 60px -30px rgba(15, 23, 42, 0.45);
  overflow: hidden;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.rot-demo-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  background: var(--rot-ink-raised);
  border-bottom: 1px solid var(--rot-ink-line);
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-xs);
  color: var(--rot-ink-muted);
}

.rot-demo-dots {
  display: flex;
  gap: 6px;
  flex: none;
}

.rot-demo-dots span {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--rot-ink-line);
}

.rot-demo-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rot-demo-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.rot-demo-status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-light);
}

.rot-demo-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--space-lg);
}

.rot-demo-msg {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: var(--space-sm);
}

.rot-demo-who {
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-xs);
  color: var(--rot-ink-muted);
  padding-top: 2px;
}

.rot-demo-who--agent {
  color: var(--rot-tk-fn);
}

.rot-demo-mono {
  font-family: var(--rot-font-mono);
  font-size: 0.8125rem;
  color: var(--color-primary-text);
  background: rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-sm);
  padding: 0 4px;
}

/* The agent's brief_ask call: the documented decision-guard path
   (docs/content/agent-setup.md) the agent takes before an auth change. */
.rot-demo-call {
  margin-left: calc(3.75rem + var(--space-sm));
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-xs);
  line-height: 1.6;
  color: var(--rot-ink-text);
  overflow-wrap: anywhere;
}

.rot-demo-call-arrow {
  color: var(--rot-ink-muted);
}

.tk-s { color: var(--rot-tk-string); }
.tk-f { color: var(--rot-tk-fn); }

/* Brief's flag: the one light surface inside the dark window. */
.rot-demo-flag {
  margin-left: calc(3.75rem + var(--space-sm));
  background: var(--color-background);
  color: var(--color-text);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-amber-light);
  padding: var(--space-md);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

.rot-demo-flag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.rot-demo-logo {
  display: block;
  height: 12px;
  width: auto;
}

.rot-demo-pill {
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-amber-dark);
  background: color-mix(in srgb, var(--color-amber-light) 16%, transparent);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.rot-demo-flag-lead {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.rot-demo-flag-quote {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  line-height: 1.35;
  margin: 4px 0 6px;
}

.rot-demo-flag-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.rot-demo-done {
  margin-left: calc(3.75rem + var(--space-sm));
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-xs);
  color: var(--rot-tk-string);
}

.rot .rot-demo-caption {
  order: 1;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-md);
  text-align: center;
}

/* One-time playback: each step settles in order. The resting (un-animated)
   state IS the final frame, so reduced motion and no-animation both show the
   complete story. */
@keyframes rot-step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rot-demo-step {
  animation: rot-step-in 0.45s ease-out both;
}

.rot-demo-step:nth-child(1) { animation-delay: 0.2s; }
.rot-demo-step:nth-child(2) { animation-delay: 0.7s; }
.rot-demo-step:nth-child(3) { animation-delay: 1.4s; }
.rot-demo-step:nth-child(4) { animation-delay: 2.1s; }
.rot-demo-step:nth-child(5) { animation-delay: 3.1s; }
.rot-demo-step:nth-child(6) { animation-delay: 3.6s; }

@media (max-width: 620px) {
  .rot-demo-body {
    padding: var(--space-md);
  }

  .rot-demo-msg {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .rot-demo-call,
  .rot-demo-flag,
  .rot-demo-done {
    margin-left: 0;
  }

  .rot-demo-status {
    display: none;
  }
}

/* Research proof ------------------------------------------------------- */

.rot-proof {
  background: var(--color-background-subtle);
  border-top: 1px solid var(--rot-rule);
  border-bottom: 1px solid var(--rot-rule);
  padding: var(--space-2xl) 0;
}

.rot-proof-grid {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.rot-proof-num {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-5xl);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--rot-fern);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-sm);
}

.rot-proof h2 {
  font-size: var(--font-size-2xl);
  max-width: 34ch;
  margin: 0 0 var(--space-sm);
}

.rot .rot-proof p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0 0 var(--space-sm);
}

.rot .rot-arrow-link {
  font-weight: var(--font-weight-semibold);
}

@media (min-width: 900px) {
  .rot-proof-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: var(--space-2xl);
  }

  .rot-proof-stat {
    border-right: 1px solid var(--rot-rule-strong);
    padding-right: var(--space-xl);
  }

  .rot-proof h2 {
    font-size: var(--font-size-3xl);
  }
}

/* Why rework happens --------------------------------------------------- */

.rot-why-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: start;
}

.rot .rot-why-head p {
  margin: 0;
}

.rot-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rot-rule-strong);
}

.rot-why-list li {
  display: grid;
  gap: 6px;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--rot-rule-strong);
}

.rot-why-item {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  color: var(--color-text);
}

/* The concrete instance, drawn from the hero scenario. */
.rot-why-eg {
  justify-self: start;
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  background: var(--color-background-subtle);
  border: 1px solid var(--rot-rule);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

@media (min-width: 900px) {
  .rot-why-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-4xl);
  }
}

/* How Brief works ------------------------------------------------------- */

.rot-steps {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-lg);
}

.rot-step {
  background: var(--color-background);
  border: 1px solid var(--rot-rule-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.rot-step-num {
  display: block;
  font-family: var(--rot-font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent-dark);
  margin-bottom: var(--space-md);
}

.rot-step h3 {
  font-size: var(--font-size-xl);
  margin: 0 0 var(--space-sm);
}

.rot .rot-step p {
  font-size: var(--font-size-base);
  margin: 0;
}

@media (min-width: 900px) {
  .rot-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Before / after ------------------------------------------------------- */

.rot-compare {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.rot-compare-col {
  border: 1px solid var(--rot-rule-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.rot-compare-col--with {
  border: 2px solid var(--rot-fern);
  box-shadow: var(--shadow-medium);
}

.rot-compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--rot-rule);
}

.rot-compare-head h3 {
  font-size: var(--font-size-2xl);
  margin: 0;
}

.rot-compare-tag {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

.rot-compare-col--without .rot-compare-tag {
  color: var(--color-amber-dark);
  background: color-mix(in srgb, var(--color-amber-light) 14%, transparent);
}

.rot-compare-col--with .rot-compare-tag {
  color: var(--rot-fern);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}

/* Each step is a node on a vertical line; the last node is the outcome. */
.rot-flow {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rot-flow li {
  position: relative;
  padding: 0 0 var(--space-lg) var(--space-xl);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
}

.rot-flow li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--rot-rule-strong);
  background: var(--color-background);
}

.rot-flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(0.4em + 14px);
  bottom: 2px;
  width: 2px;
  background: var(--rot-rule);
}

.rot-flow li.rot-flow-end {
  padding-bottom: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.rot-compare-col--without .rot-flow-end::before {
  border-color: var(--color-amber-light);
  background: var(--color-amber-light);
}

.rot-compare-col--with .rot-flow li::before {
  border-color: var(--color-accent);
}

.rot-compare-col--with .rot-flow-end::before {
  background: var(--color-accent);
}

@media (min-width: 900px) {
  .rot-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Testimonial ----------------------------------------------------------- */

.rot-testimonial {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-top: 1px solid var(--rot-rule);
}

/* FAQ ------------------------------------------------------------------- */

/* Site-wide the FAQ is one centred 800px column. Here it is a two-column
   spread so the heading sits beside the questions. */
.rot .faq-section {
  padding: var(--space-4xl) 0;
  background: var(--color-background-subtle);
}

.rot .faq-section .container {
  max-width: 1200px;
}

.rot .faq-section h2 {
  text-align: left;
  margin: 0;
}

.rot-faq {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.rot .faq-section details.faq-item summary {
  font-family: var(--font-family-headers);
  font-weight: var(--font-weight-black);
}

.rot .faq-section details.faq-item:last-child {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .rot-faq {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-4xl);
  }
}

/* Final CTA ------------------------------------------------------------- */

.rot .cta-section .button-group {
  margin-top: var(--space-xl);
}

.rot .cta-section .btn {
  padding: 0.875rem 1.75rem;
  font-size: var(--font-size-lg);
}

.rot .cta-section .rot-cta-note {
  color: color-mix(in srgb, var(--color-cta-text) 72%, transparent);
  margin: var(--space-md) auto 0;
}

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

@media (max-width: 620px) {
  .rot-section,
  .rot .faq-section {
    padding: var(--space-3xl) 0;
  }

  .rot-hero {
    padding-top: var(--space-2xl);
  }

  .rot-hero h1 {
    font-size: 2rem;
  }

  .rot-step,
  .rot-compare-col {
    padding: var(--space-lg);
  }

  .rot-cta .btn {
    width: 100%;
  }

  .rot-cta {
    align-items: stretch;
  }

  .rot .rot-cta-note {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {

  .rot *,
  .rot *::before,
  .rot *::after {
    animation: none !important;
    transition: none !important;
  }
}
