/* ===== Затемнение фона ===== */
.backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2,9,22, .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.backdrop.is-open { opacity: 1; visibility: visible; }

/* ===== Боковое меню (бургер) ===== */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(420px, 100%); background: #071730; border-left: 1px solid var(--line);
  transform: translateX(105%); transition: transform .55s var(--ease);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer__nav { padding: 18px 16px; }
.drawer__nav a, .drawer__nav button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 12px; border-radius: 14px;
  font-family: var(--font-head); font-weight: 800; font-size: 22px; font-style: italic; text-transform: uppercase;
  opacity: 0; transform: translateX(40px);
  transition: background .25s, color .25s, padding .3s var(--ease);
}
.drawer.is-open .drawer__nav a, .drawer.is-open .drawer__nav button { animation: slideInR .6s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + .12s); }
.drawer__nav a:hover, .drawer__nav button:hover { background: rgba(255,255,255,.05); color: var(--red-2); padding-left: 20px; }
.drawer__nav .num { font-size: 12px; color: var(--dim); font-style: normal; font-weight: 700; min-width: 22px; }
.drawer__foot { margin-top: auto; padding: 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.drawer__foot .btn { width: 100%; }

/* ===== Поиск на весь экран ===== */
.search {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(3,12,28, .96); backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.search.is-open { opacity: 1; visibility: visible; }
.search__in { width: 100%; max-width: 860px; margin: 0 auto; padding: 60px 24px 24px; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.search__top { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--line-2); padding-bottom: 10px; transform: translateY(-20px); opacity: 0; transition: transform .5s var(--ease) .05s, opacity .5s .05s, border-color .3s; }
.search.is-open .search__top { transform: none; opacity: 1; }
.search__top:focus-within { border-color: var(--red); }
.search__input { flex: 1; background: none; border: 0; outline: none; font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 4vw, 40px); padding: 8px 0; min-width: 0; }
.search__input::placeholder { color: #2c4570; }
.search__hint { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--muted); transition: all .25s; }
.chip:hover { border-color: var(--red); color: #fff; background: rgba(30,136,255,.12); }
.search__results { margin-top: 24px; overflow-y: auto; flex: 1; }
.result { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 14px; animation: riseIn .45s var(--ease) both; transition: background .2s; }
.result:hover, .result.is-focus { background: rgba(255,255,255,.06); }
.result img { width: 96px; height: 62px; object-fit: cover; border-radius: 10px; }
.result__t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.result__t mark { background: none; color: var(--red-2); }
.result__m { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; align-items: center; }
.search__empty { color: var(--muted); padding: 30px 12px; }
.search__close { position: absolute; top: 18px; right: 20px; }

/* ===== Модальные окна ===== */
.modal {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 20px;
  visibility: hidden; pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal__bg { position: absolute; inset: 0; background: rgba(2,9,22,.7); backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s; }
.modal.is-open .modal__bg { opacity: 1; }
.modal__box {
  position: relative; width: 100%; max-width: 460px;
  background: linear-gradient(180deg, #10264a, #0a1b38);
  border: 1px solid var(--line-2); border-radius: 24px; padding: 34px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(30px) scale(.95);
  transition: opacity .35s var(--ease), transform .5s var(--ease-back);
  overflow: hidden;
}
.modal.is-open .modal__box { opacity: 1; transform: none; }
.modal__box::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal__title { font-size: 28px; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.05; }
.modal__text { color: var(--muted); margin-top: 10px; font-size: 15px; }
.modal__icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(30,136,255,.15); color: var(--red-2); margin-bottom: 20px; animation: wobble 2.4s var(--ease) infinite; }
.form { display: grid; gap: 12px; margin-top: 22px; }
.field { position: relative; }
.field input {
  width: 100%; height: 54px; padding: 18px 16px 4px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); outline: none;
  transition: border-color .25s, background .25s;
}
.field input:focus { border-color: var(--red); background: rgba(30,136,255,.05); }
.field label { position: absolute; left: 16px; top: 17px; color: var(--muted); font-size: 15px; pointer-events: none; transition: all .2s var(--ease); }
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: 7px; font-size: 11px; letter-spacing: .04em; color: var(--red-2); }
.form .btn { height: 52px; margin-top: 6px; }
.form__row { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--red); width: 18px; height: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(255,255,255,.04); margin-top: 20px; }
.seg button { padding: 10px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); transition: all .25s; }
.seg button.is-active { background: var(--surface-2); color: #fff; box-shadow: 0 4px 14px -4px rgba(0,0,0,.6); }

/* ===== Поп-ап с часами ===== */
.clock-pop {
  position: absolute; z-index: 80; top: calc(var(--topbar-h) + 8px); right: 28px;
  width: 340px; padding: 22px;
  background: rgba(10,27,55, .98); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.96); transform-origin: top right;
  transition: opacity .3s var(--ease), transform .4s var(--ease-back), visibility .3s;
}
.clock-pop.is-open { opacity: 1; visibility: visible; transform: none; }
.analog { width: 190px; height: 190px; margin: 0 auto; position: relative; }
.analog svg { width: 100%; height: 100%; }
.analog .hand { transform-origin: 100px 100px; }
.analog .hand--s { transition: transform .35s var(--ease-back); }
.clock-pop__big { text-align: center; margin-top: 12px; font-family: var(--font-head); font-weight: 900; font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-pop__date { text-align: center; color: var(--muted); font-size: 14px; }
.clock-pop__date::first-letter { text-transform: uppercase; }
.world { margin-top: 18px; display: grid; gap: 6px; }
.world li { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.03); font-size: 14px; }
.world li b { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.world li span { color: var(--muted); }
.world li small { color: var(--dim); font-size: 11px; margin-left: 6px; }

/* ===== Уведомления (тосты) ===== */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: grid; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: 14px;
  background: #14294f; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 500;
  animation: toastIn .5s var(--ease-back) both;
}
.toast.is-out { animation: toastOut .35s var(--ease) forwards; }
.toast__i { width: 26px; height: 26px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex-shrink: 0; }

/* ===== Кнопка «наверх» с прогрессом ===== */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 70;
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .35s, transform .45s var(--ease-back), background .25s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--red); }
.to-top svg.ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.to-top .ring circle { fill: none; stroke: var(--red-2); stroke-width: 2.5; stroke-linecap: round; }

/* ===== Прелоадер ===== */
.preloader {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .5s var(--ease) .1s, visibility .5s .1s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader { gap: 0; }
.preloader > * { grid-area: 1 / 1; }
.radar { width: 300px; height: 300px; border-radius: 50%; position: relative; overflow: hidden;
  background:
    repeating-radial-gradient(circle, transparent 0 36px, rgba(43,185,196,.18) 37px 38px),
    linear-gradient(rgba(43,185,196,.14), rgba(43,185,196,.14)) center / 1px 100% no-repeat,
    linear-gradient(rgba(43,185,196,.14), rgba(43,185,196,.14)) center / 100% 1px no-repeat,
    radial-gradient(circle, #0c2a55, #061228 70%);
  box-shadow: 0 0 0 1px rgba(43,185,196,.25), 0 0 80px -10px rgba(30,136,255,.5);
  animation: radarIn .6s var(--ease) both; }
.radar__sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(106,217,78,.55), rgba(43,185,196,.15) 60deg, transparent 90deg); animation: sweep 1.6s linear infinite; }
.radar__blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #6ad94e; box-shadow: 0 0 12px #6ad94e; left: 68%; top: 30%; animation: blip 1.6s ease-out infinite; }
.radar__blip + .radar__blip { left: 26%; top: 62%; background: #3aa8ff; box-shadow: 0 0 12px #3aa8ff; animation-delay: .8s; }
.preloader__img { width: 230px; position: relative; z-index: 1; filter: drop-shadow(0 4px 20px rgba(0,0,0,.7)); animation: riseIn .7s var(--ease) .15s both; }

/* ===== Индикатор чтения (статья) ===== */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 300; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); }
