:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --accent-border: #a7f3d0;
  --header-bg: rgba(255, 255, 255, 0.86);
  --glow-1: rgba(37, 99, 235, 0.12);
  --glow-2: rgba(16, 185, 129, 0.11);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px -8px rgba(15, 23, 42, 0.09);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-soft: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.35);
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.15);
  --accent-border: rgba(16, 185, 129, 0.35);
  --header-bg: rgba(11, 17, 32, 0.86);
  --glow-1: rgba(59, 130, 246, 0.18);
  --glow-2: rgba(16, 185, 129, 0.14);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 36px -8px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 420px at 50% -60px, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 55% 320px at 85% 40px, var(--glow-2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-nav {
  display: flex;
  gap: 6px;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}

.header-nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

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

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

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 0 auto 14px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 780px;
}

.hero h1 .accent {
  background: linear-gradient(125deg, #2563eb, #0ea5e9 50%, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto;
  max-width: 660px;
  font-size: 1.04rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  margin-bottom: 34px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.tool-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-soft) 100%);
  border-color: var(--primary-border);
  padding: 28px;
}

.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 3px 9px;
  border-radius: 999px;
}

.tool-badge.live {
  color: #047857;
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

[data-theme="dark"] .tool-badge.live {
  color: #6ee7b7;
}

.tool-meta {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-light);
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.tool-card.featured h3 {
  font-size: 1.4rem;
}

.tool-card p {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.sub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.sub-links a {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
}

.sub-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tool-cta-row {
  margin-top: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.12s ease, background 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(37, 99, 235, 0.42);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

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

/* Quick Converter Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.converter-card, .prose-card {
  padding: 28px;
}

.converter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.converter-head h2, .prose-card h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.converter-head p, .prose-card p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.holiday-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 5px 12px;
  border-radius: 999px;
}

.conv-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.conv-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.number-input {
  width: 110px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active, .chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.conv-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.conv-stat {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conv-stat.accent-stat {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-color: var(--primary-border);
}

.conv-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.conv-val {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.conv-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.conv-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.inline-cta {
  font-weight: 700;
  text-decoration: none;
}

/* Principles */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.principle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.principle-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.principle-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: 42px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.footer-inner p {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.8rem !important;
  color: var(--text-light) !important;
}

@media (max-width: 900px) {
  .tools-grid, .principles-grid { grid-template-columns: 1fr; }
  .conv-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .header-nav { display: none; }
  .hero { padding: 30px 0 22px; }
  .hero h1 { font-size: 1.72rem; }
  .converter-card, .prose-card, .tool-card.featured { padding: 18px 16px; }
  .theme-toggle { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
  .theme-toggle span:last-child { display: none; }
}
