:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --surface-3: #e4ecf5;
  --ink: #0b1220;
  --muted: #556070;
  --line: #d8e2ed;
  --brand: #102033;
  --bq-mint: #51d8b4;
  --bq-gold: #d5a33d;
  --accent: var(--bq-mint);
  --accent-2: var(--bq-gold);
  --danger: #b42318;
  --radius: 22px;
  --shadow: 0 18px 48px rgba(12, 20, 36, 0.10);
  --max: 1180px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0b1628;
  --surface-2: #101f35;
  --surface-3: #162740;
  --ink: #edf7ff;
  --muted: #a9b7c8;
  --line: #263a56;
  --brand: #eef8ff;
  --bq-mint: #74f0c7;
  --bq-gold: #f0bd55;
  --accent: var(--bq-mint);
  --accent-2: var(--bq-gold);
  --danger: #ffb4ab;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 191, 146, 0.14), transparent 34rem),
    radial-gradient(circle at top right, rgba(60, 125, 240, 0.12), transparent 30rem),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent), white 12%); outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
}
.skip-link:focus { top: 12px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 12%);
  backdrop-filter: blur(16px);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.055em;
  font-size: clamp(1.34rem, 2.8vw, 1.78rem);
  line-height: 1;
}
.logo-text {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.logo-edge { color: var(--bq-mint); }
.logo-mid { color: var(--bq-gold); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a, .ghost-button, .primary-button, .tool-copy {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
  font-size: 0.93rem;
}
.primary-button {
  border-color: color-mix(in srgb, var(--accent), var(--accent-2) 24%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f;
  box-shadow: 0 12px 28px rgba(11, 191, 146, 0.18);
}
.ghost-button:hover, .nav-links a:hover, .tool-copy:hover { transform: translateY(-1px); }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 20px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 32px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  color: var(--muted);
}
.badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent), transparent 78%);
}
.hero h1 {
  margin: 20px 0 14px;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.08em;
}
.hero p {
  max-width: 64ch;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0; }
.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.trust-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  border-radius: 18px;
  padding: 14px;
}
.trust-card strong { display: block; font-size: 1.1rem; }
.trust-card span { display: block; color: var(--muted); font-size: 0.9rem; }

.hero-panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 6%);
  border-radius: 32px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-top strong { letter-spacing: -0.03em; }
.mini-dots { display: flex; gap: 6px; }
.mini-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.quick-calc {
  display: grid;
  gap: 12px;
}
.quick-display {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 20px;
  min-height: 84px;
  font-size: clamp(1.9rem, 6vw, 3rem);
  text-align: right;
  letter-spacing: -0.05em;
  overflow: hidden;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.keypad button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(12, 20, 36, 0.06);
}
.keypad button[data-op], .keypad .equals { background: var(--surface-3); }
.keypad .equals {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f;
}
.keypad .wide { grid-column: span 2; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}
.section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.06em;
}
.section-head p { max-width: 62ch; margin: 8px 0 0; color: var(--muted); }
.search-box {
  width: min(100%, 340px);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 13px 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tool-card {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 4%);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(12, 20, 36, 0.06);
}
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}
.tool-card .tool-intro { margin: 0 0 16px; color: var(--muted); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { color: var(--muted); font-weight: 760; font-size: 0.92rem; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 15px;
  padding: 12px 13px;
}
.result-box {
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--accent), var(--line) 70%);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 4px;
}
.result-label { color: var(--muted); font-weight: 800; font-size: 0.9rem; }
.result-value { font-size: 1.55rem; font-weight: 900; letter-spacing: -0.04em; color: var(--ink); }
.result-note { color: var(--muted); font-size: 0.92rem; }
.tool-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.tool-copy { padding: 9px 12px; }
.small-note { color: var(--muted); font-size: 0.88rem; }

.content-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.content-panel p, .content-panel li { color: var(--muted); }
.content-panel h3 { margin-top: 0; letter-spacing: -0.03em; }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
details {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 18px;
  padding: 14px 16px;
}
summary { cursor: pointer; font-weight: 850; }
details p { margin-bottom: 0; }

.site-footer {
  margin-top: 40px;
  background: #07111f;
  color: #eaf6ff;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.footer-inner p { margin: 8px 0 0; color: #a9b7c8; }
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { color: #eaf6ff; text-decoration: none; border-bottom: 1px solid transparent; }
.footer-links a:hover { border-bottom-color: currentColor; }

.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-panel { order: -1; }
  .tool-grid, .faq-grid { grid-template-columns: 1fr; }
  .section-head { display: grid; align-items: start; }
  .search-box { width: 100%; }
}

@media (max-width: 640px) {
  .nav { align-items: flex-start; }
  .nav-links { width: 100%; }
  .nav-links a { display: none; }
  .nav-links .ghost-button { margin-left: auto; }
  .hero { padding-top: 30px; }
  .trust-row, .form-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .keypad button { min-height: 50px; }
}

@media print {
  .site-header, .hero-panel, .hero-actions, .search-box, .tool-actions, .scroll-top { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card, .content-panel { break-inside: avoid; box-shadow: none; }
}
