:root {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1d2430;
  --border: #30363d;
  --text: #f0f6fc;
  --muted: #8b949e;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --good: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --border: #d0d7de;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --good: #16a34a;
  --warning: #d97706;
  --shadow: 0 18px 55px rgba(31, 35, 40, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 180ms ease, color 180ms ease;
}

button,
a {
  font: inherit;
}

.site-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 54px;
}

.site-name,
.back-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--surface-hover);
}

.intro {
  margin-bottom: 28px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  gap: 18px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
  border-color: var(--accent);
}

.tool-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  font-size: 1.7rem;
  margin-bottom: 18px;
}

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.tool-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.launch-button,
.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.launch-button:hover,
.start-button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
}

.start-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.tuner-shell {
  width: min(760px, calc(100% - 32px));
}

.tuner-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(24px, 6vw, 44px);
  box-shadow: var(--shadow);
  text-align: center;
}

.tuner-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4rem);
  letter-spacing: -0.05em;
}

.subtitle {
  margin: 10px 0 30px;
  color: var(--muted);
  line-height: 1.55;
}

.note {
  font-size: clamp(5rem, 24vw, 10rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.08em;
  margin: 26px 0 8px;
}

.frequency {
  min-height: 24px;
  color: var(--muted);
}

.meter {
  position: relative;
  height: 104px;
  margin: 28px 0 8px;
  overflow: hidden;
}

.center-line {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 3px;
  height: 70px;
  border-radius: 999px;
  background: var(--good);
  transform: translateX(-50%);
}

.tick {
  position: absolute;
  top: 28px;
  width: 1px;
  height: 26px;
  background: var(--border);
}

.needle {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 4px;
  height: 76px;
  border-radius: 999px;
  background: var(--warning);
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(0deg);
  transition: transform 90ms linear, background 120ms ease;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.status {
  min-height: 26px;
  margin: 18px 0;
  font-weight: 700;
}

.privacy {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .site-shell {
    padding-top: 18px;
  }

  .site-header {
    margin-bottom: 42px;
  }

  .intro {
    margin-bottom: 24px;
  }
}
