:root {
  --bg: #f4f4f1;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --text: #090909;
  --muted: #686862;
  --line: #deded8;
  --accent: #b89b5e;
  --accent-2: #1d3f72;
  --radius: 26px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.07);
  --header-bg: rgba(244, 244, 241, 0.76);
  --page-bg:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 34%),
    radial-gradient(circle at bottom right, rgba(184, 155, 94, 0.08), transparent 34%),
    linear-gradient(135deg, #f8f8f6 0%, #f4f4f1 55%, #e9e9e5 100%);
}

html[data-theme="neo"] {
  --bg: #05070c;
  --surface: rgba(13, 17, 28, 0.78);
  --surface-strong: #0d111c;
  --text: #f7f8fb;
  --muted: rgba(247, 248, 251, 0.64);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #6aa8ff;
  --accent-2: #8f6dff;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  --header-bg: rgba(5, 7, 12, 0.72);
  --page-bg:
    radial-gradient(circle at top left, rgba(106, 168, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(143, 109, 255, 0.16), transparent 34%),
    linear-gradient(135deg, #05070c 0%, #090d17 55%, #0d1321 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page-bg);
  transition: background 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  width: 100%;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

body.menu-open header {
  z-index: 110;
}

.brand-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.brand img {
  height: 32px;
  width: auto;
  display: block;
}

.brand .brand-logo-dark {
  display: block;
}

.brand .brand-logo-light {
  display: none;
}

html[data-theme="neo"] .brand .brand-logo-dark {
  display: none;
}

html[data-theme="neo"] .brand .brand-logo-light {
  display: block;
}

.ui-backdrop[hidden] {
  display: none;
}

.ui-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.brand-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  z-index: 100;
  width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
}

.brand-menu[hidden] {
  display: none;
}

.brand-menu a {
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-menu a:hover {
  background: var(--surface);
}

.brand-menu a.is-active {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

html[data-theme="neo"] .brand-menu a.is-active {
  background: #f7f8fb;
  color: #05070c;
}

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

.theme-toggle {
  min-width: 68px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4fd16b;
  box-shadow: 0 0 0 4px rgba(79, 209, 107, 0.14);
  flex: 0 0 auto;
}

