/* NestCompare — teal & coral design system */

:root {
  --paper: #eef5f4;
  --surface: #ffffff;
  --surface-2: #e2eeec;
  --ink: #0f2e2e;
  --slate: #4c6b66;
  --slate-soft: #7d9994;
  --line: #cdded9;
  --line-strong: #a9c2bc;
  --brass: #d9704f;
  --brass-ink: #a84a2c;
  --good: #2f7d5e;
  --good-bg: #e2f1ea;
  --warn: #b2503a;
  --warn-bg: #f7e4de;
  --shadow: 0 1px 2px rgba(15, 46, 46, 0.06), 0 8px 24px -12px rgba(15, 46, 46, 0.18);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", SFMono-Regular, Consolas, monospace;

  --radius: 10px;
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1616;
    --surface: #11201f;
    --surface-2: #16302e;
    --ink: #e7f2f0;
    --slate: #9db8b3;
    --slate-soft: #6f8c87;
    --line: #1f3a37;
    --line-strong: #2c4a46;
    --brass: #e88a68;
    --brass-ink: #f0a483;
    --good: #6cbf95;
    --good-bg: #16332a;
    --warn: #e0917e;
    --warn-bg: #3a231e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --paper: #0a1616;
  --surface: #11201f;
  --surface-2: #16302e;
  --ink: #e7f2f0;
  --slate: #9db8b3;
  --slate-soft: #6f8c87;
  --line: #1f3a37;
  --line-strong: #2c4a46;
  --brass: #e88a68;
  --brass-ink: #f0a483;
  --good: #6cbf95;
  --good-bg: #16332a;
  --warn: #e0917e;
  --warn-bg: #3a231e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}

a {
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ---------- Layout shell ---------- */

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

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill-link {
  font-size: 0.85rem;
  color: var(--slate);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid transparent;
}

.pill-link:hover {
  border-color: var(--line);
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}

.btn:hover {
  border-color: var(--brass);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:hover {
  border-color: var(--brass);
  box-shadow: 0 0 0 2px var(--brass) inset;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.hero {
  position: relative;
  padding: 72px 0 68px;
  overflow: hidden;
}

.hero-skyline {
  position: absolute;
  right: -20px;
  bottom: -12px;
  width: min(60%, 480px);
  height: auto;
  max-height: 100%;
  color: var(--ink);
  opacity: 0.08;
  mask-image: linear-gradient(to left, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, black 55%, transparent 100%);
  pointer-events: none;
}

@media (max-width: 760px) {
  .hero-skyline {
    width: 85%;
    opacity: 0.06;
  }
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 20px;
  max-width: 640px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  color: var(--brass-ink);
}

.hero p {
  font-size: 1.08rem;
  color: var(--slate);
  max-width: 52ch;
}

.hero-meta {
  display: flex;
  gap: 20px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate-soft);
  flex-wrap: wrap;
}

.hero-meta span {
  display: flex;
  gap: 6px;
  align-items: center;
}

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

.hero-cta {
  margin-top: 8px;
  padding-bottom: 8px;
}

.btn-lg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  font-size: 1.02rem;
  border-radius: 10px;
}

.btn-lg .arrow {
  transition: transform 0.12s ease;
}

.btn-lg:hover .arrow {
  transform: translateX(4px);
}

/* ---------- Feature strip ---------- */

.footnote-strip {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
}

.footnote-strip .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 760px) {
  .footnote-strip .grid {
    grid-template-columns: 1fr;
  }
}

.footnote-strip h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.footnote-strip p {
  color: var(--slate);
  font-size: 0.88rem;
  margin: 0;
}

.footnote-strip code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.82em;
}

/* ---------- WebMCP panel ---------- */

.webmcp-panel {
  padding-bottom: 64px;
}

.webmcp-inner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 32px clamp(20px, 4vw, 44px);
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.webmcp-inner h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  max-width: 26ch;
}

.webmcp-inner > p {
  color: var(--slate);
  margin: 0;
  max-width: 62ch;
}

.webmcp-inner code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

.webmcp-inner strong {
  color: var(--brass-ink);
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 2px;
}

.tool-chips code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 0.78rem;
}

.webmcp-inner .webmcp-fallback {
  font-size: 0.85rem;
  color: var(--slate-soft);
}

/* ---------- Comparison toolbar ---------- */

.page-header {
  padding: 28px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.page-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.page-header p {
  color: var(--slate);
  margin: 6px 0 0;
  max-width: 60ch;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--slate);
  padding: 0 0 18px;
}

.legend .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--good-bg);
  color: var(--good);
  border-radius: 100px;
  padding: 3px 10px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ---------- Sheet / table ---------- */

.sheet {
  padding-bottom: 72px;
}

.sheet-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 640px;
}

.sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--ink);
  color: var(--paper);
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.sheet-table thead th.corner {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 200px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 16px;
  color: var(--slate-soft);
}

.apt-head-cell {
  min-width: 220px;
}

.apt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.apt-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 4px 2px;
  min-width: 0;
}

.apt-name-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.remove-apt {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.remove-apt:hover {
  border-color: var(--warn);
  color: var(--warn);
}

.add-col {
  min-width: 130px;
  text-align: center;
}

.btn-add-col {
  background: transparent;
  color: var(--paper);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  padding: 10px 12px;
  width: calc(100% - 20px);
  margin: 10px;
}

.btn-add-col:hover {
  border-color: var(--brass);
  color: var(--brass);
}

.group-row td {
  background: var(--surface-2);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  position: sticky;
  left: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field-row .field-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--slate);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 200px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.remove-row {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--slate-soft);
  width: 20px;
  height: 20px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.remove-row:hover {
  border-color: var(--warn);
  color: var(--warn);
}

.add-row-row td {
  padding: 10px 16px;
  border-bottom: none;
}

.add-row-form {
  display: flex;
  gap: 8px;
  max-width: 360px;
}

.add-row-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
}

.add-row-form input:focus {
  border-style: solid;
  border-color: var(--brass);
  outline: none;
}

.field-cell {
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.field-cell.is-best {
  background: var(--good-bg);
}

.field-cell.is-best .cell-input,
.field-cell.is-best .cell-static,
.field-cell.is-best .cell-currency input {
  color: var(--good);
  font-weight: 600;
}

.cell-input, .cell-currency input, .rating-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 8px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink);
}

.cell-input:hover, .cell-currency:hover, select.cell-input:hover {
  border-color: var(--line);
}

.cell-input:focus, .cell-currency input:focus, .rating-input:focus {
  border-color: var(--brass);
  background: var(--surface-2);
  outline: none;
}

.cell-textarea {
  min-height: 64px;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.cell-currency {
  display: flex;
  align-items: center;
  border-radius: 6px;
}

.cell-currency span {
  color: var(--slate-soft);
  padding-left: 6px;
}

.cell-currency input {
  border: none;
  padding-left: 2px;
}

.cell-static {
  padding: 8px;
  font-weight: 600;
  color: var(--ink);
}

.cell-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-input {
  width: 44px;
  flex-shrink: 0;
}

.rating-stars {
  color: var(--brass);
  letter-spacing: 1px;
}

/* ---------- Empty sheet hint ---------- */

.sheet-hint {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--slate);
  font-size: 0.88rem;
}

.sheet-hint strong {
  color: var(--ink);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--slate-soft);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a {
  color: var(--slate);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brass-ink);
}
