/*
 * Primer landing — Apple-style marketing page using extension design tokens.
 * Tokens mirror packages/shared/src/tokens.css and packages/ui/src/panel.css
 */

:root {
  color-scheme: dark;

  --bg: #141414;
  --surface: #1c1c1c;
  --border: #262626;
  --text-primary: #f0ede8;
  --text-secondary: #888070;
  --text-body: #b0a898;
  --text-story: #b0a898;
  --accent: #d4b86a;
  --accent-bg: rgba(212, 184, 106, 0.15);
  --accent-border: rgba(212, 184, 106, 0.35);
  --accent-text: #d4b86a;
  --cite-bg: rgba(212, 184, 106, 0.12);
  --cite-text: #d4b86a;
  --logo-bg: rgba(212, 184, 106, 0.1);
  --logo-border: rgba(212, 184, 106, 0.2);
  --conf-high-text: #4ade80;
  --conf-high-bg: rgba(34, 197, 94, 0.1);
  --conf-high-border: rgba(34, 197, 94, 0.28);

  --radius: 4px;
  --radius-pill: 999px;
  --hairline: 0.5px;
  --font-display: "Spectral", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --max-width: 980px;
  --section-pad: 96px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fafaf8;
  --surface: #f2ede4;
  --border: #e8e0d5;
  --text-primary: #1a1410;
  --text-secondary: #8b7355;
  --text-body: #4a3e30;
  --text-story: #3a3028;
  --accent: #c9a84c;
  --accent-bg: #f5edd5;
  --accent-border: #e0d0b0;
  --accent-text: #8b6a28;
  --cite-bg: #f5edd5;
  --cite-text: #8b6a28;
  --logo-bg: #f0e8d0;
  --logo-border: #e0d0b0;
  --conf-high-text: #15803d;
}

[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo inversion: black shapes on transparent → white on dark backgrounds */
.brand-logo,
.footer-logo,
.panel-brand-logo {
  filter: invert(1);
}

[data-theme="light"] .brand-logo,
[data-theme="light"] .footer-logo,
[data-theme="light"] .panel-brand-logo {
  filter: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: var(--hairline) solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-primary);
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}

.theme-toggle:hover {
  border-color: var(--accent-border);
  color: var(--accent-text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  border: var(--hairline) solid transparent;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s;
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #1a1410;
  border-color: var(--accent-border);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Hero */
.hero {
  padding: 88px 0 48px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--text-secondary);
  max-width: 44ch;
  margin: 0 auto 32px;
  line-height: 1.45;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-note {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Product visual */
.product-visual {
  padding: 0 0 80px;
}

.browser-frame {
  border: var(--hairline) solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 24px 48px color-mix(in srgb, var(--text-primary) 8%, transparent),
    0 4px 12px color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  border-bottom: var(--hairline) solid var(--border);
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.browser-dot:nth-child(1) {
  background: #e8a0a0;
}
.browser-dot:nth-child(2) {
  background: #e8d4a0;
}
.browser-dot:nth-child(3) {
  background: #a8d4a0;
}

.browser-url {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  flex: 1;
  max-width: 200px;
  text-align: center;
}

.browser-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 440px;
  background: var(--bg);
}

/* News article side: distinct from Primer panel (light page, system sans) */
.article-mock {
  padding: 28px 32px 32px;
  border-right: 1px solid #e2e2e2;
  background: #ffffff;
  color: #1a1a1a;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.article-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a9e01;
  margin-bottom: 10px;
}

.article-mock h2 {
  font-family: inherit;
  font-size: 1.375rem;
  font-weight: 700;
  color: #111111;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.article-byline {
  font-size: 12px;
  color: #6b6b6b;
  margin-bottom: 14px;
}

.article-deck {
  font-size: 16px;
  color: #444444;
  line-height: 1.5;
  margin-bottom: 18px;
  font-weight: 500;
}

.article-mock p {
  font-size: 15px;
  color: #333333;
  line-height: 1.65;
  margin-bottom: 14px;
}

.article-mock .highlight {
  background: #fff3b0;
  color: inherit;
  padding: 1px 3px;
  border-radius: 2px;
}

.article-related-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6b6b;
  margin-top: 8px;
  margin-bottom: 8px;
}

.article-related {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.article-related li {
  font-size: 14px;
  color: #0a9e01;
  line-height: 1.5;
  margin-bottom: 6px;
  padding-left: 14px;
  position: relative;
}

.article-related li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #888888;
}

/* Panel mock: always dark Primer tokens regardless of landing page theme */
.panel-mock {
  --bg: #141414;
  --surface: #1c1c1c;
  --border: #262626;
  --text-primary: #f0ede8;
  --text-secondary: #888070;
  --text-body: #b0a898;
  --text-story: #b0a898;
  --accent: #d4b86a;
  --accent-bg: rgba(212, 184, 106, 0.15);
  --accent-border: rgba(212, 184, 106, 0.35);
  --accent-text: #d4b86a;
  --cite-bg: rgba(212, 184, 106, 0.12);
  --cite-text: #d4b86a;
  --logo-bg: rgba(212, 184, 106, 0.1);
  --logo-border: rgba(212, 184, 106, 0.2);
  --conf-high-text: #4ade80;
  --conf-high-bg: rgba(34, 197, 94, 0.1);
  --conf-high-border: rgba(34, 197, 94, 0.28);
  --rev-track: rgba(255, 255, 255, 0.08);

  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 11px;
  background: var(--bg);
  border-left: var(--hairline) solid var(--border);
  color-scheme: dark;
  overflow: hidden;
}

.panel-mock .panel-brand-logo {
  filter: invert(1);
}

.panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: var(--hairline) solid var(--border);
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.panel-brand-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.panel-acts {
  display: flex;
  gap: 5px;
}

.panel-btn {
  width: 24px;
  height: 24px;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
}

.panel-cohead {
  padding: 14px;
  border-bottom: var(--hairline) solid var(--border);
}

.panel-idrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--logo-bg);
  border: var(--hairline) solid var(--logo-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--accent-text);
  flex-shrink: 0;
}

.panel-coname {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.panel-cometa {
  font-size: 10px;
  color: var(--text-secondary);
}

.panel-codesc {
  font-size: 11px;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 8px;
}

.panel-badges {
  display: flex;
  gap: 6px;
}

.conf-pill {
  font-size: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  color: var(--conf-high-text);
  background: var(--conf-high-bg);
  border: var(--hairline) solid var(--conf-high-border);
}

.panel-lensbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border-bottom: var(--hairline) solid var(--border);
}

.lens-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  margin-right: 2px;
}

.lens-pill {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: var(--hairline) solid var(--accent-border);
  color: var(--text-secondary);
}

.lens-pill.is-active {
  background: var(--accent-bg);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.panel-content {
  padding: 12px 14px 16px;
  flex: 1;
  overflow: hidden;
}

.panel-block {
  margin-bottom: 12px;
}

.panel-block--fade {
  opacity: 0.85;
}

.block-title {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.block-body {
  font-size: 11px;
  color: var(--text-story);
  line-height: 1.6;
}

.block-body--compact {
  margin-bottom: 0;
}

.cite-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  font-size: 8px;
  font-weight: 500;
  color: var(--cite-text);
  background: var(--cite-bg);
  border: var(--hairline) solid var(--accent-border);
  border-radius: var(--radius-pill);
  margin-left: 2px;
  vertical-align: super;
}

.panel-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-metrics--row {
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.metric-card {
  padding: 8px 6px;
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}

.metric-label {
  font-size: 7px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-sub {
  font-size: 7px;
  color: var(--text-secondary);
  margin-top: 2px;
  opacity: 0.85;
}

/* Revenue sparkline chart */
.panel-chart {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px 6px;
}

.chart-sparkline {
  width: 100%;
  height: 48px;
  display: block;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 7px;
  color: var(--text-secondary);
}

/* Revenue mix bars */
.rev-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.rev-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rev-label {
  font-size: 8px;
  color: var(--text-secondary);
  width: 52px;
  flex-shrink: 0;
}

.rev-track {
  flex: 1;
  height: 4px;
  background: var(--rev-track);
  border-radius: 1px;
  overflow: hidden;
}

.rev-bar {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
}

.rev-val {
  font-size: 8px;
  color: var(--text-body);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Competitor list */
.panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
}

.panel-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  font-size: 10px;
  border-bottom: var(--hairline) solid var(--border);
}

.panel-list li:last-child {
  border-bottom: none;
}

.list-name {
  color: var(--text-primary);
  font-weight: 500;
}

.list-meta {
  color: var(--text-secondary);
  font-size: 8px;
  text-align: right;
  flex-shrink: 0;
}

/* Stats band */
.stats-band {
  padding: 56px 0;
  border-top: var(--hairline) solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
  padding: 20px 12px;
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--accent-text);
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-value--text {
  font-family: var(--font-sans);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 0.02em;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Sections */
.section {
  padding: var(--section-pad) 0;
  border-top: var(--hairline) solid var(--border);
}

.section-surface {
  background: var(--surface);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-lead {
  text-align: center;
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 auto 48px;
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* Lookup examples */
.lookup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.lookup-card {
  padding: 24px 22px;
  background: var(--bg);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
}

.lookup-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: var(--hairline) solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  margin-bottom: 12px;
}

.lookup-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.lookup-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.steps-expanded {
  grid-template-columns: repeat(3, 1fr);
}

.step {
  text-align: left;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: var(--hairline) solid var(--accent-border);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.0625rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Personas */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.persona-card {
  padding: 28px 24px;
  background: var(--bg);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius);
}

.persona-card h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.persona-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 48px;
}

.feature {
  text-align: left;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.feature p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* CTA band */
.cta-band {
  padding: 80px 0;
  text-align: center;
  border-top: var(--hairline) solid var(--border);
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--text-primary);
  margin-bottom: 12px;
}

.cta-band p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 28px;
}

/* Footer */
.site-footer {
  padding: 40px 0;
  border-top: var(--hairline) solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-brand-name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--accent-text);
}

.footer-copy {
  width: 100%;
  text-align: center;
  padding-top: 8px;
  border-top: var(--hairline) solid var(--border);
  margin-top: 4px;
}

@media (min-width: 601px) {
  .footer-copy {
    width: auto;
    text-align: right;
    padding-top: 0;
    border-top: none;
    margin-top: 0;
    margin-left: auto;
  }
}

/* Responsive */
@media (max-width: 900px) {
  :root {
    --section-pad: 72px;
  }

  .browser-body {
    grid-template-columns: 1fr;
  }

  .panel-mock {
    border-left: none;
    border-top: var(--hairline) solid var(--border);
  }

  .article-mock {
    border-right: none;
    border-bottom: var(--hairline) solid var(--border);
  }

  .panel-metrics--row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps,
  .steps-expanded,
  .persona-grid,
  .feature-grid,
  .lookup-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 64px 0 36px;
  }

  .header-inner .btn-sm {
    display: none;
  }

  .article-mock {
    padding: 24px 20px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

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

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-copy {
    width: 100%;
    text-align: left;
  }
}
