/* Versus — editorial design system */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Paper & ink */
  --paper: #faf8f3;
  --paper-2: #f4f1e8;
  --paper-3: #ede8da;
  --ink: #1a1814;
  --ink-2: #4a463e;
  --ink-3: #807a6e;
  --ink-4: #b8b0a0;
  --rule: #d9d2c2;
  --rule-soft: #e6e0d0;

  /* Accent — warm burnt sienna */
  --accent: oklch(62% 0.14 45);
  --accent-2: oklch(70% 0.13 60);
  --accent-soft: oklch(92% 0.04 55);
  --accent-ink: oklch(40% 0.10 40);

  /* A & B colors for left/right sides */
  --a: oklch(55% 0.12 25);   /* warm red-ish */
  --a-soft: oklch(94% 0.03 25);
  --b: oklch(50% 0.08 235);  /* cool blue-ish */
  --b-soft: oklch(94% 0.025 235);

  /* Type */
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter Tight', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;
  --r-xl: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

#root { min-height: 100vh; }

/* Typography primitives */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-feature-settings: "ss01"; }
.italic { font-style: italic; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.display {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.015em;
}

.h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.h3 {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
}

.lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-2);
  font-style: italic;
}

/* Buttons */
.btn {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.icon-only { padding: 10px; }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--sans);
}
.chip:hover { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Input */
.input {
  width: 100%;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.3;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--ink);
  outline: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
.input:focus { border-bottom-color: var(--ink); }
.input::placeholder { color: var(--ink-4); font-style: italic; }

/* Cursor blink for typewriter */
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Rules */
.hr { height: 1px; background: var(--rule); border: 0; margin: 0; }
.hr.soft { background: var(--rule-soft); }

/* Subtle striped placeholder */
.placeholder-img {
  position: relative;
  background: var(--paper-3);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.04) 10px,
    rgba(0,0,0,0.04) 11px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
}

/* Side colors */
.side-a { color: var(--a); }
.side-b { color: var(--b); }
.bg-a { background: var(--a-soft); }
.bg-b { background: var(--b-soft); }
.dot-a, .dot-b { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-a { background: var(--a); }
.dot-b { background: var(--b); }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-up { animation: fadeUp 0.6s ease both; }
.fade-in { animation: fadeIn 0.6s ease both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Layout helpers */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* ── Responsive grid classes ─────────────────────────────────────────── */
.g-hero      { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 60px; align-items: end; }
.g-steps     { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.g-vs        { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: baseline; }
.g-search    { display: grid; grid-template-columns: 300px 1fr; gap: 60px; }
.g-verdict   { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 60px; align-items: flex-start; }
.g-cats      { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; align-items: flex-start; }
.g-catrow    { display: grid; grid-template-columns: 160px 1fr 1fr 28px; gap: 16px; align-items: center; }
.g-2col      { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.g-quotes    { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.g-rec       { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.g-title     { display: grid; grid-template-columns: 1fr auto 1fr; gap: 32px; align-items: center; }
.g-specs-row { display: grid; grid-template-columns: 1fr 1.5fr 1.5fr; align-items: center; }

@media (max-width: 768px) {
  .g-hero, .g-verdict, .g-cats, .g-2col, .g-quotes, .g-rec, .g-search {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  .g-steps { grid-template-columns: 1fr !important; gap: 0; }
  .g-catrow { grid-template-columns: 90px 1fr 1fr 20px !important; gap: 8px; }
  .g-title { gap: 12px; }
  .g-title .serif { font-size: clamp(36px, 10vw, 80px) !important; }
  .g-rec .serif[style*="92px"] { font-size: clamp(48px, 12vw, 92px) !important; }
  /* Score circles stack horizontally — keep them side by side */
  .scores-row { justify-content: center; }
  /* Radar sticky positioning off on mobile */
  .radar-sticky { position: static !important; }
  /* Section padding */
  .verdict-pad { padding: 24px !important; }
  .rec-pad { padding: 28px !important; }
  /* Container sections — reduce ONLY horizontal padding so vertical inline padding survives */
  .container { padding-left: 16px !important; padding-right: 16px !important; }
  /* Hide dividers in stats row on mobile */
  .stats-divider { display: none; }

  /* Hide elements that don't make sense on touch devices */
  .desktop-only { display: none !important; }

  /* Landing input + button: stack so the input never overlaps the Compare button */
  .landing-input-row {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .landing-input-row .input { min-width: 0; width: 100%; font-size: 22px !important; }
  .landing-input-row .btn { width: 100%; justify-content: center; }

  /* Masthead row on results: stack eyebrow above the chip cluster, allow chip wrap */
  .masthead-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 14px;
  }
  .masthead-row .chip { font-size: 12px; padding: 6px 10px; }

  /* Specs row on mobile: stack with side labels so A vs B values are clearly separated */
  .g-specs-row {
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 16px 0 !important;
  }
  .g-specs-row .spec-side {
    display: flex !important;
    align-items: baseline;
    gap: 10px;
    font-size: 16px !important;
  }
  .g-specs-row .spec-side::before {
    content: attr(data-name);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-3);
    flex-shrink: 0;
    min-width: 70px;
  }

  /* Section breathing room on mobile — bump vertical rhythm where inline 60px fights tight content */
  .container > .fade-up,
  .container > .fade-in { width: 100%; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Selection */
::selection { background: var(--accent); color: var(--paper); }
