/* Vivral V2 release — light site canvas, sticky chapter rail, SVG benchmarks */

.v2-page {
  --v2-bg: #f4f1e1;
  --v2-paper: #fffdf6;
  --v2-surface: #fffdf6;
  --v2-ink: #2c2c2c;
  --v2-muted: rgba(44, 44, 44, 0.72);
  --v2-soft: rgba(44, 44, 44, 0.48);
  --v2-line: rgba(44, 44, 44, 0.1);
  --v2-accent: #3d5a80;
  --v2-swift: #7ba3bc;
  --v2-peer: #d4b59a;
  --v2-hot: #c45c3e;
  --v2-max: 100%;
  --v2-rail: 168px;
  color: var(--v2-ink);
  background: var(--v2-bg);
  /* Same stack as the rest of the site (vivral-site.css --font-text / --font-ui) */
  font-family: var(--font-text, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.v2-page h1,
.v2-page h2,
.v2-page h3 {
  font-family: var(--font-display, var(--font-text, inherit));
}

.v2-page .v2-hero-cta,
.v2-page .v2-tag,
.v2-page .v2-toc,
.v2-page .v2-card-label,
.v2-page .v2-meta {
  font-family: var(--font-ui, var(--font-text, inherit));
}

.v2-main {
  padding: 0 0 clamp(80px, 12vh, 140px);
}

/* Hero */
.v2-hero {
  padding: clamp(120px, 16vh, 160px) var(--page-x, 24px) clamp(40px, 6vw, 64px);
  text-align: center;
  border-bottom: 1px solid var(--v2-line);
}

.v2-hero-inner {
  width: min(100%, 820px);
  margin: 0 auto;
}

.v2-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  margin: 0 0 24px;
  color: var(--v2-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.v2-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v2-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  color: var(--v2-accent);
  background: rgba(61, 90, 128, 0.1);
  border: 1px solid rgba(61, 90, 128, 0.12);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.v2-hero h1 {
  margin: 0 auto;
  max-width: 16ch;
  color: var(--v2-ink);
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.v2-lede {
  margin: 22px auto 0;
  max-width: 40rem;
  color: var(--v2-muted);
  font-size: 1.12rem;
  font-weight: 450;
  line-height: 1.55;
}

.v2-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  min-height: 48px;
  padding: 0 22px;
  color: #fffdf6;
  background: #2c2c2c;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.v2-hero-cta:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

/* Layout: TOC at the outer edge, main content uses remaining width */
.v2-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) clamp(20px, 4vw, 56px) 0;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .v2-layout {
    grid-template-columns: var(--v2-rail) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(24px, 5vw, 72px);
  }
}

@media (min-width: 1280px) {
  .v2-layout {
    --v2-rail: 190px;
    gap: clamp(48px, 6vw, 96px);
    padding-left: clamp(24px, 4vw, 56px);
  }
}

.v2-toc {
  display: none;
}

@media (min-width: 900px) {
  .v2-toc {
    position: sticky;
    top: 100px;
    display: block;
    width: 100%;
    max-width: var(--v2-rail);
    padding-top: 8px;
    justify-self: start;
  }
}

.v2-toc-label {
  margin: 0 0 14px;
  color: var(--v2-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v2-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--v2-line);
}

.v2-toc a {
  position: relative;
  display: block;
  padding: 9px 0 9px 14px;
  color: var(--v2-soft);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease;
}

.v2-toc a:hover {
  color: var(--v2-ink);
}

.v2-toc a.is-active {
  color: var(--v2-ink);
  font-weight: 700;
}

.v2-toc a.is-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -1px;
  width: 2px;
  background: var(--v2-accent);
  border-radius: 2px;
}

.v2-article {
  min-width: 0;
  width: 100%;
  max-width: none;
}

.v2-section {
  margin: 0 0 clamp(48px, 7vw, 72px);
  scroll-margin-top: 96px;
}

.v2-section h2 {
  margin: 0 0 16px;
  color: var(--v2-ink);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.v2-section > p {
  margin: 0 0 14px;
  color: var(--v2-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.v2-prompt {
  margin: 22px 0 14px;
  padding: 14px 16px;
  color: var(--v2-ink);
  background: rgba(255, 253, 246, 0.85);
  border: 1px solid var(--v2-line);
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  font-style: italic;
}

.v2-compare {
  display: grid;
  gap: 14px;
  margin: 16px 0 12px;
}

@media (min-width: 720px) {
  .v2-compare {
    grid-template-columns: 1fr 1fr;
  }
}

.v2-card {
  min-width: 0;
  padding: 16px 16px 18px;
  background: var(--v2-paper);
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(17, 19, 22, 0.05);
}

.v2-card-label {
  display: inline-flex;
  margin: 0 0 12px;
  color: var(--v2-soft);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v2-card.is-new .v2-card-label {
  color: var(--v2-accent);
}

.v2-card-body {
  color: var(--v2-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.v2-card-body p {
  margin: 0 0 10px;
}

.v2-card-body p:last-child {
  margin-bottom: 0;
}

.v2-card-body ul {
  margin: 8px 0 0;
  padding-left: 1.15rem;
}

.v2-card-body li + li {
  margin-top: 6px;
}

.v2-callout {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: var(--v2-soft);
  background: rgba(61, 90, 128, 0.06);
  border-left: 3px solid rgba(61, 90, 128, 0.35);
  border-radius: 0 12px 12px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  font-style: italic;
}

.v2-list {
  margin: 12px 0 0;
  padding-left: 1.2rem;
  color: var(--v2-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.v2-list li + li {
  margin-top: 10px;
}

.v2-list strong {
  color: var(--v2-ink);
}

.v2-soon-card {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--v2-paper);
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(17, 19, 22, 0.05);
}

.v2-soon-kicker {
  margin: 0 0 10px;
  color: var(--v2-accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v2-soon-card p {
  margin: 0;
  color: var(--v2-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.v2-soon-card strong {
  color: var(--v2-ink);
}

/* Information security — PII redaction examples */
.v2-pii-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 16px);
  margin: 22px 0 6px;
}

.v2-pii-card {
  margin: 0;
  min-width: 0;
  padding: 14px 14px 12px;
  background: var(--v2-paper);
  border: 1px solid rgba(44, 44, 44, 0.12);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(17, 19, 22, 0.04);
}

.v2-pii-label {
  margin: 0 0 10px;
  color: var(--v2-accent);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v2-pii-block {
  margin: 0 0 8px;
  padding: 10px 11px;
  background: rgba(44, 44, 44, 0.025);
  border: 1px solid rgba(44, 44, 44, 0.1);
  border-radius: 10px;
}

.v2-pii-block:last-child {
  margin-bottom: 0;
}

.v2-pii-block-out {
  background: rgba(61, 90, 128, 0.05);
  border-color: rgba(61, 90, 128, 0.16);
}

.v2-pii-kicker {
  margin: 0 0 5px;
  color: var(--v2-soft);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v2-pii-text {
  margin: 0;
  color: var(--v2-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.v2-pii-token {
  display: inline;
  color: var(--v2-accent);
  font-weight: 650;
  font-size: 0.74em;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

@media (max-width: 820px) {
  .v2-pii-examples {
    grid-template-columns: 1fr;
  }
}

/* Benchmark cards — 2 × n on desktop, stacked on small screens */
.v2-bench-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vw, 24px);
  margin-top: 28px;
}

@media (min-width: 800px) {
  .v2-bench-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.v2-bench-card {
  min-width: 0;
  margin: 0;
  padding: clamp(20px, 3vw, 28px);
  background: var(--v2-paper);
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(17, 19, 22, 0.05);
}

/* Source charts already include title/labels — flush image cards */
.v2-bench-card-img {
  padding: 0;
  overflow: hidden;
}

.v2-bench-card-img img,
.v2-bench-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  /* Prefer high-quality downscale of native 4K chart assets */
  image-rendering: auto;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
  backface-visibility: hidden;
}

.v2-bench-card h3 {
  margin: 0 0 4px;
  color: var(--v2-ink);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.v2-bench-sub {
  margin: 0 0 18px;
  color: var(--v2-soft);
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.4;
}

.v2-hbar-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-ui, var(--font-text, inherit));
}

.v2-hbar-svg .grid-line {
  stroke: rgba(44, 44, 44, 0.08);
  stroke-width: 1;
}

.v2-hbar-svg .axis-label {
  fill: rgba(44, 44, 44, 0.42);
  font-size: 11px;
  font-weight: 600;
}

.v2-hbar-svg .row-label {
  fill: rgba(44, 44, 44, 0.88);
  font-size: 13px;
  font-weight: 650;
}

.v2-hbar-svg .row-sub {
  fill: rgba(44, 44, 44, 0.42);
  font-size: 10px;
  font-weight: 550;
}

.v2-hbar-svg .val-label {
  fill: rgba(44, 44, 44, 0.65);
  font-size: 12px;
  font-weight: 700;
}

.v2-hbar-svg .val-label.lead {
  fill: var(--v2-hot);
}

.v2-hbar-svg .bar-track {
  fill: rgba(44, 44, 44, 0.06);
}

.v2-hbar-svg .bar-fill.swift {
  fill: var(--v2-swift);
}

.v2-hbar-svg .bar-fill.peer {
  fill: var(--v2-peer);
  opacity: 0.85;
}

/* Full comparison chart image (from benchmark pack) */
.v2-bench-hero {
  margin: 22px 0 0;
  padding: 0;
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  background: var(--v2-paper);
  box-shadow: 0 12px 36px rgba(17, 19, 22, 0.05);
  overflow: hidden;
}

.v2-bench-hero-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  image-rendering: auto;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
}

/* Comparison table (legacy; hero image preferred) */
.v2-table-wrap {
  margin-top: 22px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  background: var(--v2-paper);
  box-shadow: 0 12px 36px rgba(17, 19, 22, 0.05);
  -webkit-overflow-scrolling: touch;
}

.v2-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(0.8rem, 1.15vw, 0.92rem);
}

.v2-table th,
.v2-table td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--v2-line);
  text-align: center;
  vertical-align: middle;
  color: var(--v2-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.35;
}

.v2-table tbody tr:last-child th,
.v2-table tbody tr:last-child td {
  border-bottom: 0;
}

.v2-table thead th {
  color: var(--v2-soft);
  font-weight: 650;
  font-size: clamp(0.72rem, 1vw, 0.8rem);
  letter-spacing: 0.01em;
  background: rgba(244, 241, 225, 0.65);
  padding-top: 16px;
  padding-bottom: 16px;
}

.v2-table th .model-size {
  display: block;
  margin-top: 5px;
  font-weight: 500;
  opacity: 0.85;
  font-size: 0.88em;
}

.v2-table tbody th,
.v2-table thead th:first-child {
  text-align: left;
  padding-left: 18px;
  padding-right: 12px;
  width: 13%;
  font-weight: 600;
  color: var(--v2-ink);
  background: transparent;
}

.v2-table .bench-name {
  color: var(--v2-ink);
  font-weight: 700;
  font-size: 1.02em;
}

.v2-table .col-swift {
  background: rgba(123, 163, 188, 0.14);
  color: var(--v2-ink);
  font-weight: 700;
}

.v2-table thead th.col-swift {
  background: rgba(123, 163, 188, 0.18);
}

.v2-table .hi {
  color: var(--v2-hot);
  font-weight: 750;
}

.v2-table .note {
  margin: 0;
  padding: 16px 18px;
  color: var(--v2-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  border-top: 1px solid var(--v2-line);
}

.v2-footer-meta {
  margin-top: clamp(36px, 6vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--v2-line);
}

.v2-author {
  margin: 0 0 8px;
  color: var(--v2-ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.v2-author span {
  display: block;
  margin-top: 4px;
  color: var(--v2-soft);
  font-size: 0.88rem;
  font-weight: 550;
}

.v2-keep {
  margin-top: 28px;
}

.v2-keep h2 {
  margin: 0 0 14px;
  color: var(--v2-ink);
  font-size: 1.1rem;
}

.v2-keep-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 700px) {
  .v2-keep-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.v2-keep-card {
  display: block;
  padding: 16px;
  color: inherit;
  background: var(--v2-paper);
  border: 1px solid var(--v2-line);
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(17, 19, 22, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.v2-keep-card:hover {
  border-color: rgba(61, 90, 128, 0.28);
  box-shadow: 0 12px 32px rgba(17, 19, 22, 0.07);
}

.v2-keep-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--v2-ink);
  font-size: 0.95rem;
  line-height: 1.3;
}

.v2-keep-card span {
  color: var(--v2-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .v2-hero-cta {
    transition: none;
  }
}
