@import url("/static/fonts/fonts.css");

/* ============================================================
   Ярмарка олимпиад — школа № 1257. Тёмная тема.
   ============================================================ */

:root {
  --bg:          #07070d;
  --bg-deep:     #04040a;
  --surface:     #101019;
  --surface-2:   #16161f;
  --surface-3:   #1d1d29;
  --line:        rgba(255, 255, 255, .075);
  --line-2:      rgba(255, 255, 255, .14);
  --line-3:      rgba(255, 255, 255, .24);

  --ink:         #eeeef6;
  --ink-2:       #b9b9cd;
  --ink-3:       #8686a0;
  --ink-4:       #5c5c75;

  --gold:        #ffb03b;
  --rose:        #ff4d6d;
  --teal:        #4fe3cc;
  --violet:      #a78bfa;
  --green:       #46d98b;
  --red:         #ff5f56;

  --accent:      var(--gold);
  --accent-ink:  #0a0a0f;

  --radius:      14px;
  --radius-lg:   22px;
  --radius-sm:   9px;

  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-body:    "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

[data-accent="programming"] { --accent: var(--gold); }
[data-accent="security"]    { --accent: var(--rose); }
[data-accent="math"]        { --accent: var(--teal); }
[data-accent="logic"]       { --accent: var(--violet); }

*, *::before, *::after { box-sizing: border-box; }

/* Собственный display у класса перебивает атрибут hidden из стилей браузера */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}

h1 { font-size: clamp(1.95rem, 4.4vw, 3.1rem); font-weight: 900; letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.32rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; transition: opacity .18s; }
a:hover { opacity: .78; }

code, kbd, pre, .mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

code {
  font-size: .88em;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .12em .42em;
  color: #ffd79a;
  word-break: break-word;
}

kbd {
  font-size: .8em;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .16em .5em;
  color: var(--ink);
  white-space: nowrap;
}

pre {
  margin: 1.1em 0;
  padding: 1.05rem 1.15rem;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.62;
  -webkit-overflow-scrolling: touch;
}
pre code { background: none; border: 0; padding: 0; color: #d9e6ff; font-size: 1em; }

ul, ol { margin: 0 0 1.05em; padding-left: 1.3em; }
li { margin-bottom: .42em; }
li::marker { color: var(--accent); }

strong { font-weight: 700; color: #fff; }
em { color: var(--ink-2); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-3); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- фон: сияние, сетка, зерно ---------- */

.bg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.bg-aurora { overflow: hidden; }
.bg-aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .3;
  will-change: transform;
}
.bg-aurora span:nth-child(1) {
  width: 52vw; height: 52vw; left: -14vw; top: -18vw;
  background: radial-gradient(circle, rgba(255, 176, 59, .55), transparent 68%);
  animation: drift-a 34s var(--ease) infinite alternate;
}
.bg-aurora span:nth-child(2) {
  width: 46vw; height: 46vw; right: -12vw; top: 6vh;
  background: radial-gradient(circle, rgba(167, 139, 250, .5), transparent 68%);
  animation: drift-b 41s var(--ease) infinite alternate;
}
.bg-aurora span:nth-child(3) {
  width: 44vw; height: 44vw; left: 26vw; bottom: -22vw;
  background: radial-gradient(circle, rgba(79, 227, 204, .38), transparent 68%);
  animation: drift-c 47s var(--ease) infinite alternate;
}

@keyframes drift-a { to { transform: translate3d(9vw, 7vh, 0) scale(1.18); } }
@keyframes drift-b { to { transform: translate3d(-8vw, 11vh, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(6vw, -9vh, 0) scale(1.22); } }

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 12%, transparent 78%);
}

.bg-grain {
  opacity: .04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-vignette {
  background: radial-gradient(ellipse 120% 90% at 50% 0%, transparent 40%, rgba(0, 0, 0, .55) 100%);
}

/* ---------- каркас ---------- */

.page { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 4vw, 34px); }
main { flex: 1 0 auto; padding: clamp(28px, 5vw, 54px) 0 clamp(56px, 8vw, 96px); }

/* ---------- шапка ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  background: linear-gradient(180deg, rgba(7, 7, 13, .92), rgba(7, 7, 13, .72));
  border-bottom: 1px solid var(--line);
}
.site-head__in {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 26px);
  min-height: 68px; padding-top: 10px; padding-bottom: 10px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); flex-shrink: 0; }
.brand:hover { opacity: 1; }
.brand__mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 176, 59, .4);
  background: linear-gradient(145deg, rgba(255, 176, 59, .18), rgba(167, 139, 250, .12));
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  letter-spacing: -.03em; color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: transform .3s var(--ease-out);
}
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.05); }
.brand__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand__title { font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.brand__sub { font-size: .655rem; color: var(--ink-4); letter-spacing: .09em;
  text-transform: uppercase; line-height: 1.1; white-space: nowrap; }

.head-spacer { flex: 1 1 auto; }

.head-score {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 18px 6px 7px;
  border: 1px solid var(--line); border-radius: 100px;
  background: rgba(255, 255, 255, .028);
}
.head-score__ring { width: 34px; height: 34px; flex: none; }
.head-score__text { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.head-score__num { font-family: var(--font-mono); font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.head-score__num b { color: var(--gold); font-weight: 600; }
.head-score__of { color: var(--ink-4); }
.head-score__label { font-size: .63rem; color: var(--ink-4); text-transform: uppercase; letter-spacing: .12em; }

/* профиль справа сверху */
.profile {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 6px 6px 13px;
  border: 1px solid var(--line-2); border-radius: 100px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}
.profile__meta { display: flex; flex-direction: column; line-height: 1.2; align-items: flex-end; text-align: right; }
.profile__name {
  font-weight: 600; font-size: .9rem; max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile__id {
  font-family: var(--font-mono); font-size: .7rem; color: var(--ink-4);
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.profile__id b { color: var(--gold); font-weight: 600; }
.profile__avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--gold), #ff8f6b 55%, var(--rose));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 3px 14px rgba(255, 140, 60, .28);
}
.profile__exit {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  color: var(--ink-3); transition: .18s;
}
.profile__exit:hover { color: var(--red); border-color: rgba(255, 95, 86, .5); background: rgba(255, 95, 86, .1); }
.profile__exit svg { width: 15px; height: 15px; }

/* ---------- подвал ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 38px;
  font-size: .84rem; color: var(--ink-4);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .4));
}
.site-foot__in { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
.site-foot a { color: var(--ink-3); }
.site-foot a:hover { color: var(--gold); opacity: 1; }
.site-foot__legal { max-width: 62ch; }

/* ---------- кнопки ---------- */

.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border: 0; border-radius: 100px;
  font-family: var(--font-body); font-size: .96rem; font-weight: 600;
  line-height: 1; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none;
  background: var(--btn-bg); color: var(--accent-ink);
  transition: transform .16s var(--ease-out), box-shadow .22s, background .18s, opacity .18s;
  box-shadow: 0 3px 20px -6px var(--btn-bg);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--btn-bg); opacity: 1; }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; box-shadow: none; }
.btn svg { width: 17px; height: 17px; }

.btn--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2); box-shadow: none;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

.btn--quiet {
  background: rgba(255, 255, 255, .05); color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: none;
}
.btn--quiet:hover { background: rgba(255, 255, 255, .09); color: var(--ink); box-shadow: none; }

.btn--danger { background: rgba(255, 95, 86, .14); color: #ff8f88; border: 1px solid rgba(255, 95, 86, .38); box-shadow: none; }
.btn--danger:hover { background: rgba(255, 95, 86, .22); box-shadow: none; }

.btn--lg { padding: 16px 32px; font-size: 1.04rem; }
.btn--sm { padding: 9px 16px; font-size: .86rem; }
.btn--block { width: 100%; }

/* ---------- карточки и мелочи ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .012));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 30px);
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 100px;
  font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--ink-3);
  background: rgba(255, 255, 255, .03);
  white-space: nowrap;
}
.tag--accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 42%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tag--ok { color: var(--green); border-color: rgba(70, 217, 139, .4); background: rgba(70, 217, 139, .1); }
.tag--muted { color: var(--ink-4); }

.eyebrow {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}

.lead { font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: var(--ink-2); max-width: 68ch; }
.muted { color: var(--ink-3); }
.tiny { font-size: .84rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.divider-dots { display: flex; gap: 6px; align-items: center; }
.divider-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-3); display: block; }

/* полоса прогресса */
.bar { height: 5px; border-radius: 100px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar__fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #fff));
  transition: width .7s var(--ease-out);
}

/* всплывающее уведомление */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  padding: 12px 20px; border-radius: 100px;
  background: rgba(20, 20, 30, .96); border: 1px solid var(--line-2);
  color: var(--ink); font-size: .92rem; font-weight: 500;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .6);
  animation: toast-in .4s var(--ease-out) both;
  backdrop-filter: blur(10px);
  max-width: min(92vw, 460px); text-align: center;
}
.toast--ok { border-color: rgba(70, 217, 139, .5); color: #8ff0be; }
.toast--err { border-color: rgba(255, 95, 86, .5); color: #ffa79f; }
.toast.is-out { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* появление блоков */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { animation: reveal-in .72s var(--ease-out) both; }
@keyframes reveal-in { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-head__in { min-height: 60px; gap: 10px; }
  .brand__sub { display: none; }
  .head-score { display: none; }
  .profile__meta { display: none; }
  .profile { padding: 5px; gap: 6px; border-radius: 100px; }
  .site-foot__in { flex-direction: column; align-items: flex-start; }
}
