/* ============================================================
   Dotenvdiff — Design System & Styles
   Brand: Dense / Utilitarian
   ============================================================ */

/* ── CSS Custom Properties (brand tokens) ─────────────────── */
:root {
  --primary:        #3d352a;
  --accent:         #c87a28;
  --positive:       #2b7d4b;
  --negative:       #b33a3a;
  --warning:        #b88a2a;
  --secret-indicator: #8a4b6b;
  --bg:             #f6f6f4;
  --surface:        #efeeeb;
  --border:         #d6d4cf;
  --text-primary:   #1b1a18;
  --text-muted:     #7a766f;

  --font-display:   'DM Mono', 'Courier New', monospace;
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --radius:         2px;
  --space:          4px;
  --max-width:      1120px;

  --accent-bg:      #f0e6d6;
  --positive-bg:    #e4f0e8;
  --negative-bg:    #f0dcdc;
  --warning-bg:     #f0e8d0;
  --surface-hover:  #e6e5e0;
}

/* ── Dark theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:        #b8a99a;
  --accent:         #d48a3a;
  --positive:       #4aad6a;
  --negative:       #d44a4a;
  --warning:        #ccaa3a;
  --secret-indicator: #a07b8a;
  --bg:             #1a1917;
  --surface:        #242220;
  --border:         #3a3733;
  --text-primary:   #e0ddd6;
  --text-muted:     #9e9a92;
  --accent-bg:      #2a2218;
  --positive-bg:    #1a2a1e;
  --negative-bg:    #2a1a1a;
  --warning-bg:     #2a2418;
  --surface-hover:  #2e2c28;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Layout container ──────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Navigation ────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  gap: 12px;
}
.site-header .logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-header .logo-link:hover {
  text-decoration: none;
  opacity: 0.8;
}
.site-header .logo-link img {
  flex-shrink: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  display: block;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  text-decoration: none;
}
.site-nav a.active {
  color: var(--text-primary);
  background: var(--surface);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Split hero ────────────────────────────────────────────── */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1.5fr;
  gap: 32px;
  padding: 32px 0 24px;
  align-items: start;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.hero-text h1 .accent-word {
  color: var(--accent);
}
.hero-text .sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Hero screenshot ────────────────────────────────────────── */
.hero-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

/* ── Paste panes (the tool) ────────────────────────────────── */
.pane-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pane-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pane-head label {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
}
.pane-head label:hover {
  text-decoration: underline;
}
.pane-head input[type="file"] {
  display: none;
}
.pane-box textarea {
  width: 100%;
  min-height: 180px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
  border: none;
  resize: vertical;
  tab-size: 2;
}
.pane-box textarea:focus {
  outline: none;
}
.pane-box textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 8px 8px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Action bar ────────────────────────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: var(--font-display);
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.checkbox-label input {
  accent-color: var(--accent);
}

/* ── Section numbered eyebrow ──────────────────────────────── */
.section-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-eyebrow .eyebrow-num {
  color: var(--text-muted);
}
.section-eyebrow .eyebrow-label {
  color: var(--accent);
}

/* ── Section layout ────────────────────────────────────────── */
.section-block {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.section-block:first-of-type {
  border-top: none;
}
.section-block h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.section-block h2 .accent-word {
  color: var(--accent);
}
.section-block p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 680px;
  margin-bottom: 16px;
}
.section-block p:last-child {
  margin-bottom: 0;
}

/* ── Count / stat badges in text ───────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  margin: 16px 0;
}
.stat-cell {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-cell:nth-last-child(-n+4) {
  border-bottom: none;
}
.stat-cell:nth-child(4n) {
  border-right: none;
}
.stat-cell .stat-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}
.stat-cell .stat-num.accent {
  color: var(--accent);
}
.stat-cell .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
}

/* ── Results sections (tool output) ────────────────────────── */
#counts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.count-pill.count-missing {
  background: var(--negative-bg);
  color: var(--negative);
  border-color: var(--negative);
}
.count-pill.count-changed {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}
.count-pill.count-same {
  background: var(--positive-bg);
  color: var(--positive);
  border-color: var(--positive);
}

.results-section {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.results-section:first-of-type {
  border-top: none;
}
.results-section h3 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.results-section h3 .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.results-section.secret-section h3 {
  color: var(--secret-indicator);
}
.results-section.secret-section h3 .count-badge {
  border-color: var(--secret-indicator);
  color: var(--secret-indicator);
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.diff-table th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.diff-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.diff-table tr:last-child td {
  border-bottom: none;
}
.diff-table tr:hover {
  background: var(--surface);
  transition: background 0.1s ease;
}
.key-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.val-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  max-width: 300px;
}
.masked {
  color: var(--secret-indicator);
  font-weight: 500;
  letter-spacing: 3px;
}
.badge-secret {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--secret-indicator);
  color: #fff;
  border-radius: var(--radius);
  vertical-align: middle;
  margin-left: 4px;
}
.secret-row {
  background: rgba(138, 75, 107, 0.06);
}
.secret-row:hover {
  background: rgba(138, 75, 107, 0.1);
}
.unmask-btn {
  padding: 2px 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.1s ease;
}
.unmask-btn:hover {
  background: var(--surface-hover);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.error {
  color: var(--negative);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

/* ── Inline SVG figure ─────────────────────────────────────── */
.figure-wrapper {
  margin: 20px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.figure-wrapper svg {
  width: 100%;
  height: auto;
}

/* ── Feature list ──────────────────────────────────────────── */
.feature-list {
  list-style: none;
  padding: 0;
}
.feature-list li {
  position: relative;
  padding: 4px 0 4px 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.feature-list li strong {
  color: var(--text-primary);
}

/* ── How it works steps ────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  margin: 16px 0;
}
.step {
  padding: 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.step:nth-child(4n) {
  border-right: none;
}
.step:nth-last-child(-n+4) {
  border-bottom: none;
}
.step .step-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.step .step-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}
.step p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: none;
  margin: 0;
}

/* ── Pricing table ─────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin: 24px 0;
}
.pricing-card {
  border: 1px solid var(--border);
  padding: 24px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
}
.pricing-card h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.pricing-card .price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.pricing-card .price-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.pricing-card ul {
  list-style: none;
  padding: 0;
  flex: 1;
  margin-bottom: 16px;
}
.pricing-card ul li {
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.pricing-card ul li::before {
  content: '\2014\00a0';
  color: var(--accent);
}
.pricing-card ul li.unavailable {
  color: var(--border);
}

/* ── Legal pages ───────────────────────────────────────────── */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.legal-content h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.legal-content .last-updated {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.legal-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.legal-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}
.legal-content ul li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer .footer-tagline {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-footer .footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer .footer-links a {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-footer .footer-links a:hover {
  color: var(--accent);
}
.site-footer .footer-copy {
  font-size: 11px;
  color: var(--border);
}

/* ── Limits notice ─────────────────────────────────────────── */
.limits-notice {
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 16px 0;
}
.limits-notice .limits-head {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
  margin-bottom: 4px;
}
.limits-notice p {
  font-size: 13px;
  color: var(--text-primary);
  margin: 0;
  max-width: none;
}

/* ── Figure animation ──────────────────────────────────────── */
@keyframes flow-down {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.flow-path {
  stroke-dasharray: 100;
  animation: flow-down 2s ease-in-out infinite alternate;
}
.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .flow-path {
    animation: none;
    stroke-dasharray: none;
  }
  .pulse-dot {
    animation: none;
  }
}
.motion-paused .flow-path,
.motion-paused .pulse-dot {
  animation: none !important;
}
.motion-toggle {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.motion-toggle:hover {
  color: var(--text-primary);
}

/* ── Compound control (copy) ──────────────────────────────── */
.copy-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.copy-control .copy-text {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.copy-control .copy-btn {
  padding: 4px 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.1s ease;
}
.copy-control .copy-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 800px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0 16px;
  }
  .hero-text h1 {
    font-size: 20px;
  }
  .pane-group {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-cell:nth-last-child(-n+2) {
    border-bottom: none;
  }
  .stat-cell:nth-child(2n) {
    border-right: none;
  }
  .stat-cell:nth-child(4n) {
    border-right: 1px solid var(--border);
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .step:nth-child(2n) {
    border-right: none;
  }
  .step:nth-last-child(-n+2) {
    border-bottom: none;
  }
  .diff-table {
    font-size: 11px;
  }
  .diff-table th,
  .diff-table td {
    padding: 3px 6px;
  }
}

@media (max-width: 500px) {
  .site-header .logo-link span {
    display: none;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .step {
    border-right: none;
  }
  .step:last-child {
    border-bottom: none;
  }
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}