:root {
  color-scheme: dark light;

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shell: min(1180px, calc(100vw - 40px));

  --brand-ink: #0b1720;
  --brand-primary: #16b8a6;
  --brand-primary-strong: #0e8f81;
  --brand-secondary: #f1b84b;
  --brand-danger: #ef5b5b;
  --brand-info: #5f86ff;

  --motion-fast: 160ms ease;
  --motion-med: 260ms ease;
}

html[data-theme="dark"] {
  --bg: #071116;
  --bg-elevated: #0d1b22;
  --bg-soft: #10242c;
  --surface: rgba(13, 27, 34, 0.86);
  --surface-solid: #0d1b22;
  --surface-hover: #142d36;
  --border: rgba(183, 219, 221, 0.16);
  --border-strong: rgba(183, 219, 221, 0.28);
  --text: #edf7f5;
  --text-muted: #a7bab9;
  --text-soft: #73918f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --hero-glow: rgba(22, 184, 166, 0.22);
  --grid-line: rgba(237, 247, 245, 0.08);
}

html[data-theme="light"] {
  --bg: #f6f8f7;
  --bg-elevated: #ffffff;
  --bg-soft: #e9f1ee;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-hover: #edf7f4;
  --border: rgba(15, 45, 48, 0.13);
  --border-strong: rgba(15, 45, 48, 0.24);
  --text: #0b1720;
  --text-muted: #4f6568;
  --text-soft: #738588;
  --shadow: 0 24px 68px rgba(22, 46, 48, 0.13);
  --hero-glow: rgba(22, 184, 166, 0.18);
  --grid-line: rgba(13, 43, 45, 0.08);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: transform var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast);
}

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

.theme-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.theme-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

html[data-theme="dark"] .theme-icon::after {
  content: "";
  position: absolute;
  inset: -3px 5px -3px -3px;
  border-radius: 50%;
  background: var(--surface-solid);
}

html[data-theme="light"] .theme-icon::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px dotted currentColor;
  border-radius: 50%;
}
