/* ============================================================
   Legacy Upsize — diff-as-brand
   Paper, ink, and the two colors of a code review.
   ============================================================ */

:root {
  --paper: #F5F7F9;
  --panel: #FFFFFF;
  --ink: #101E28;
  --muted: #51636F;
  --line: #D6DEE4;

  --green: #1F883D;
  --green-deep: #166B31;
  --green-soft: #DAF5E1;
  --red: #C6323C;
  --red-soft: #FBE9E9;

  --code-bg: #0E1720;
  --code-line: #1C2B38;
  --code-fg: #C7D5DF;
  --code-dim: #5F7484;
  --code-add-bg: #12301F;
  --code-add-fg: #7EE2A0;
  --code-del-bg: #391B1E;
  --code-del-fg: #F0A0A5;

  --font-display: "Archivo", "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", monospace;

  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

a { color: inherit; }

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

::selection { background: var(--green-soft); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 115%;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark-mark { flex: none; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.9375rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}
.site-nav a:hover { color: var(--ink); }

.site-nav .nav-cta {
  color: var(--green-deep);
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  border-radius: 8px;
  padding: 7px 14px;
  transition: background-color 140ms ease, color 140ms ease;
}
.site-nav .nav-cta:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ---------- shared section furniture ---------- */

section { padding-block: 96px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 14px;
}
.eyebrow-tick { color: var(--green); margin-right: 6px; }

.section-title {
  font-family: var(--font-display);
  font-stretch: 108%;
  font-weight: 750;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}

.section-lede {
  max-width: 56ch;
  color: var(--muted);
  margin: 0 0 40px;
}

/* ---------- hero ---------- */

.hero { padding-block: 84px 100px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

/* the diff-swap inside the headline */
.swap { display: inline; }

.swap del {
  color: var(--red);
  background: var(--red-soft);
  text-decoration-thickness: 3px;
  text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent);
  padding-inline: 0.08em;
  border-radius: 4px;
}

.swap ins {
  color: var(--green-deep);
  background: var(--green-soft);
  text-decoration: none;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--green) 55%, transparent);
  padding-inline: 0.08em;
  border-radius: 4px;
  margin-left: 0.18em;
}

.swap.is-swapping del,
.swap.is-swapping ins {
  animation: swap-fade 380ms ease;
}

@keyframes swap-fade {
  from { opacity: 0; transform: translateY(0.18em); }
  to { opacity: 1; transform: none; }
}

.hero-sub {
  max-width: 52ch;
  color: var(--muted);
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero-note {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 20px;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.btn:active { transform: translateY(1px); }

/* styled like the button that merges a pull request */
.btn-merge {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-merge:hover { background: var(--green-deep); }

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--panel);
}
.btn-ghost:hover { border-color: var(--muted); }

.btn-lg { padding: 15px 26px; font-size: 1.05rem; }

/* ---------- the diff card ---------- */

.diff-card {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(16, 30, 40, 0.18),
    0 16px 40px -18px rgba(16, 30, 40, 0.45);
}

.diff-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--code-line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--code-dim);
}

.diff-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.diff-file { color: var(--code-fg); }

.diff-stats { margin-left: auto; }
.diff-stats .plus { color: var(--code-add-fg); }
.diff-stats .minus { color: var(--code-del-fg); margin-left: 6px; }

.diff-body {
  margin: 0;
  padding: 14px 0 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--code-fg);
  overflow-x: auto;
  /* the source newlines between .dl blocks must not render as blank lines */
  white-space: normal;
}

.dl {
  display: block;
  padding: 0 18px 0 10px;
  white-space: pre;
}

.dl .ln {
  display: inline-block;
  width: 1.6em;
  color: var(--code-dim);
  user-select: none;
}

.dl.ctx { color: var(--code-dim); }
.dl.gap { line-height: 1.1; }

.dl.del { background: var(--code-del-bg); color: var(--code-del-fg); }
.dl.del .ln { color: var(--code-del-fg); }
.dl.add { background: var(--code-add-bg); color: var(--code-add-fg); }
.dl.add .ln { color: var(--code-add-fg); }

.dl b { font-weight: 600; color: inherit; filter: brightness(1.25); }
.dl i { font-style: normal; opacity: 0.6; }

/* staged reveal on load (JS adds .diff-play to the card) */
@media (prefers-reduced-motion: no-preference) {
  .diff-card.diff-play .dl {
    opacity: 0;
    animation: diff-line-in 300ms ease forwards;
  }
  .diff-card.diff-play .dl:nth-child(1) { animation-delay: 150ms; }
  .diff-card.diff-play .dl:nth-child(2) { animation-delay: 320ms; }
  .diff-card.diff-play .dl:nth-child(3) { animation-delay: 460ms; }
  .diff-card.diff-play .dl:nth-child(4) { animation-delay: 560ms; }
  .diff-card.diff-play .dl:nth-child(5) { animation-delay: 660ms; }
  .diff-card.diff-play .dl:nth-child(6) { animation-delay: 780ms; }
  .diff-card.diff-play .dl:nth-child(7) { animation-delay: 920ms; }
  .diff-card.diff-play .dl:nth-child(8) { animation-delay: 1040ms; }
  .diff-card.diff-play .dl:nth-child(9) { animation-delay: 1200ms; }
  .diff-card.diff-play .dl:nth-child(10) { animation-delay: 1340ms; }
}

@keyframes diff-line-in {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- warnings ---------- */

.warnings {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

.warn-count { color: var(--red); }

.warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 880px;
}

.warning-list li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px 16px;
}

.warning-list code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
}

.warn-code { color: var(--red); font-weight: 600; }

.warnings-close {
  margin: 28px 0 0;
  font-weight: 600;
}

/* ---------- migration paths ---------- */

.path-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 16px 22px;
}

.path-row + .path-row { border-top: 1px solid var(--line); }

.path-from {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--red);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent);
  text-decoration-thickness: 1.5px;
}

.path-arrow {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
}

.path-to {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-deep);
}

.path-to em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.paths-note {
  margin: 22px 0 0;
  color: var(--muted);
  max-width: 62ch;
}

/* ---------- process ---------- */

.process {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.step {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 18px;
  position: relative;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.step-title {
  font-family: var(--font-display);
  font-stretch: 110%;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.step p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

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

.cta {
  background: var(--code-bg);
  color: var(--code-fg);
}

.cta-inner {
  text-align: center;
  max-width: 720px;
}

.cta-title {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 16px;
}

.sln {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--code-add-fg);
}

.cta-sub {
  color: var(--code-dim);
  margin: 0 0 32px;
}

/* ---------- footer ---------- */

.site-footer {
  padding-block: 36px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-inner p { margin: 0 0 6px; }

.footer-nod {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.75;
}

/* ---------- scroll reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 500ms ease, transform 500ms ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  section { padding-block: 64px; }
  .hero { padding-block: 52px 64px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .wordmark { font-size: 1rem; }
  .site-nav .nav-cta {
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 6px 11px;
  }

  .path-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 18px;
  }
  .path-arrow { text-align: left; }

  .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
