/* CompareClose — calm, paper-and-ink */

:root {
  --paper: #f3efe6;
  --paper-deep: #e8e2d4;
  --card: #fffdf8;
  --ink: #1c1914;
  --muted: #5e584e;
  --faint: #8a8376;
  --rule: #d8d1c3;
  --rule-strong: #c4bbab;
  --green: #1b4332;
  --green-mid: #2d6a4f;
  --green-soft: #e4efe8;
  --green-line: #b7d0c2;
  --red: #8a2c2c;
  --red-soft: #f6e8e6;
  --red-line: #e0b8b4;
  --focus: #1b4332;
  --shadow: 0 1px 2px rgba(28, 25, 20, 0.04), 0 12px 32px rgba(28, 25, 20, 0.06);
  --radius: 14px;
  --wrap: 1100px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Source Code Pro", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(27, 67, 50, 0.06), transparent 60%),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, var(--green) 0 55%, transparent 55%),
    linear-gradient(315deg, var(--green-mid) 0 48%, #d5e4da 48%);
  box-shadow: inset 0 0 0 1px rgba(27, 67, 50, 0.25);
}

.header-note {
  margin: 0;
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero {
  padding: 56px 0 28px;
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.4vw, 2.55rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px 8px 10px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: 999px;
  font-size: 0.92rem;
}

.lock {
  width: 14px;
  height: 14px;
  border: 1.6px solid var(--green);
  border-radius: 3px 3px 2px 2px;
  position: relative;
}
.lock::before {
  content: "";
  position: absolute;
  left: 2.5px;
  top: -6px;
  width: 6px;
  height: 7px;
  border: 1.6px solid var(--green);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.workbench { padding-bottom: 24px; }

.zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dropzone {
  position: relative;
  min-height: 196px;
  padding: 28px 26px 24px;
  background: var(--card);
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--green-mid);
  box-shadow: var(--shadow), 0 0 0 3px rgba(27, 67, 50, 0.12);
}

.dropzone.is-drag {
  border-color: var(--green);
  border-style: solid;
  background: #f4faf6;
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--green-line);
}

.dz-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--green);
  color: #f4f1ea;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dz-icon-cd { background: #24425a; }

.dropzone h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
}

.dz-hint {
  margin: 0 0 16px;
  color: var(--faint);
  font-size: 0.88rem;
}

.dz-file {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  word-break: break-word;
}

.dropzone.has-file .dz-file { font-weight: 600; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--green);
  color: #f7f3ea;
  min-width: 140px;
}

.btn-primary:hover:not(:disabled) { background: #143528; }
.btn-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-ghost:hover { background: rgba(255, 253, 248, 0.8); border-color: var(--ink); }

.sample-note, .status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.status.is-error { color: var(--red); }
.status.is-busy { color: var(--green); }

.results { padding: 12px 0 72px; }

.swap-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: #eef3f7;
  border-left: 3px solid #24425a;
  color: #24425a;
  font-size: 0.94rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.chip-k {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip-v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.05rem;
}

.chip-s { font-size: 0.82rem; color: var(--muted); }
.chip.is-same { border-color: var(--green-line); }
.chip.is-up { border-color: var(--red-line); background: var(--red-soft); }
.chip.is-down { border-color: var(--green-line); background: var(--green-soft); }

.heroes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}

.hero-num {
  padding: 22px 24px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-num.is-up {
  background: var(--red-soft);
  border-color: var(--red-line);
}

.hero-num.is-down {
  background: var(--green-soft);
  border-color: var(--green-line);
}

.hero-k {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-v {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hero-num.is-up .hero-v { color: var(--red); }
.hero-num.is-down .hero-v { color: var(--green); }

.hero-s {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 0 4px;
  margin-bottom: 22px;
}

.panel-head {
  padding: 18px 24px 8px;
}

.panel-head h2, .ask h2, .disclaimer h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap { overflow-x: auto; }

.cmp {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.cmp th, .cmp td {
  padding: 12px 20px;
  text-align: left;
  border-top: 1px solid var(--rule);
  vertical-align: baseline;
}

.cmp th {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #faf7f0;
}

.cmp td:nth-child(2),
.cmp td:nth-child(3),
.cmp td:nth-child(4) { font-feature-settings: "tnum"; }

.cmp tr.is-up td { background: #fbf3f2; }
.cmp tr.is-down td { background: #f4f8f5; }

.change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.change.is-up { color: var(--red); }
.change.is-down { color: var(--green); }
.change.is-same { color: var(--muted); font-weight: 500; }

.marker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.ask { padding: 22px 24px 16px; }

.ask ul {
  margin: 10px 0 8px;
  padding-left: 1.15rem;
}

.ask li { margin: 0 0 8px; }

.disclaimer {
  padding: 20px 24px;
  background: #efe8d8;
  border: 1px solid #ddd3bb;
  border-radius: var(--radius);
}

.disclaimer p {
  margin: 0;
  color: #3f3a32;
  font-size: 0.94rem;
}

.paywall {
  margin: 8px 0 28px;
  padding: 28px 26px 24px;
  background: var(--card);
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.paywall h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.45rem;
}
.paywall p {
  margin: 0 auto 18px;
  max-width: 36rem;
  color: var(--muted);
}
.paywall .btn { display: inline-block; text-decoration: none; }

.price-note {
  margin: 28px 0 0;
  color: var(--faint);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  color: var(--faint);
  font-size: 0.88rem;
}

.site-footer p { margin: 0; }

.noscript {
  margin: 0;
  padding: 12px 20px;
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .header-note { display: none; }
  .hero { padding-top: 32px; }
  .zones, .heroes { grid-template-columns: 1fr; }
  .cmp th, .cmp td { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .dropzone { transition: none; }
}

.site-footer a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--green-mid); }
.site-footer p + p { margin-top: 10px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
}

.legal {
  padding: 40px 0 72px;
  max-width: 40rem;
}
.legal .updated {
  margin: 0 0 28px;
  color: var(--faint);
  font-size: 0.88rem;
}
.legal h2 {
  margin: 28px 0 8px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.legal p,
.legal li {
  color: var(--muted);
}
.legal ul {
  margin: 0 0 8px;
  padding-left: 1.2rem;
}
.legal li { margin: 0 0 6px; }
.legal a { color: var(--green); }
