:root {
  --bg: #08080A;
  --surface-1: #0E0E11;
  --surface-2: #141418;
  --border: #1C1C22;
  --border-strong: #26262E;
  --text: #F2F2F4;
  --text-dim: #A5A5B0;
  --text-mute: #7C7C88;

  --accent: #4EE8E8;
  --accent-dim: rgba(78, 232, 232, 0.08);
  --accent-glow: rgba(78, 232, 232, 0.22);
  --magenta: #E84EC6;
  --magenta-dim: rgba(232, 78, 198, 0.10);

  --busy: #5A3A3A;
  --busy-dim: rgba(90, 58, 58, 0.15);
  --red: #F87171;
  --green: #4ADE80;
  --yellow: #FFD34E;

  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --container: 1280px;
  --gutter: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #08080A; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* PAGE LOADER */
.page-loader {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.page-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader__logo {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 400; letter-spacing: -0.03em; color: var(--text);
}
.page-loader__logo span { color: var(--accent); }
.page-loader__bar { width: 200px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.page-loader__fill {
  height: 100%; width: 0; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: loaderFill 1.2s var(--ease) forwards;
}
@keyframes loaderFill { 0% { width: 0; } 100% { width: 100%; } }

/* CURSOR GLOW */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(80px);
  opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity 0.5s var(--ease);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
.cursor-glow.is-active { opacity: 0.22; }
@media (max-width: 1024px), (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none !important; }
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-body);
  text-decoration: none;
}
.btn--primary { background: var(--accent); color: #08080A; border-color: var(--accent); }
.btn--primary:hover { background: #66F0F0; box-shadow: 0 8px 24px var(--accent-glow); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--text-dim); background: var(--surface-1); transform: translateY(-1px); }
.btn--outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--outline:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn--danger { background: transparent; color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.btn--danger:hover { background: rgba(248, 113, 113, 0.08); border-color: var(--red); }
.btn--icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--border-strong); color: var(--text-dim); }
.btn--icon:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: 14px 26px; font-size: 15px; border-radius: var(--radius-lg); }
.btn--sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* CHIPS */
.chip {
  display: inline-flex; align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text-dim);
  transition: all 0.25s var(--ease);
  background: var(--surface-1);
}
.chip:hover { border-color: var(--text-dim); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #08080A; font-weight: 600; }
.chip.is-shake { animation: chipShake 0.4s var(--ease); }
@keyframes chipShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* FILTERS */
.filter {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.filter:hover { color: var(--text); background: var(--surface-1); }
.filter.is-active { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

/* SECTION HEAD */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head--left { text-align: left; margin-left: 0; }
.section-head__eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  margin-bottom: 14px;
}
.section-head__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400; line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 16px;
}
.section-head__lead { color: var(--text-dim); font-size: 17px; }

/* GRID */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* FIELDS */
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23A5A5B0' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 40px;
}
.field textarea { resize: vertical; min-height: 100px; }

/* SVG ICON */
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--lg { width: 32px; height: 32px; stroke-width: 1.2; }
.icon--sm { width: 16px; height: 16px; }

/* ЦВЕТА КАБИНЕТОВ */
.page-student { --cabinet-accent: #4EA8E8; --cabinet-accent-dim: rgba(78, 168, 232, 0.12); }
.page-teacher { --cabinet-accent: #E84EC6; --cabinet-accent-dim: rgba(232, 78, 198, 0.12); }

@media (max-width: 1024px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
}
/* ---- FIXES ---- */
/* display:flex у .btn/.tp-contact/.preview-contact перебивал атрибут hidden */
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, [data-hero-el], .nav__logo[data-logo] span { opacity: 1; transform: none; }
}
