:root {
  --ease-wave: cubic-bezier(.37, 0, .2, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --dur: .7s;
}

body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(200, 16, 46, .07), transparent 55%),
    radial-gradient(900px 420px at 110% 8%, rgba(27, 54, 93, .06), transparent 50%),
    var(--paper);
}

body.page-ready .reveal {
  animation: rise-in var(--dur) var(--ease-soft) both;
}

.site-header {
  background: linear-gradient(180deg, #9a1a2a 0%, var(--header) 70%);
  box-shadow: 0 10px 28px rgba(90, 10, 20, .18);
}

.brand img {
  transition: transform .55s var(--ease-wave);
}
.brand:hover img { transform: rotate(-6deg) scale(1.06); }

.nav a {
  position: relative;
  transition: background .35s var(--ease-soft), transform .35s var(--ease-wave);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 99px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease-wave);
}
.nav a:hover, .nav a.is-on { transform: translateY(-1px); }
.nav a:hover::after, .nav a.is-on::after { transform: scaleX(1); }

.wave-wrap {
  position: relative;
  height: 42px;
  margin-top: -1px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.wave-wrap svg {
  display: block;
  width: 200%;
  height: 42px;
  animation: wave-drift 11s ease-in-out infinite;
}
.wave-wrap.footer {
  height: 52px;
  margin: 0;
}
.wave-wrap.footer svg {
  height: 52px;
  animation-duration: 14s;
  animation-direction: reverse;
}
.wave-a { fill: var(--paper); opacity: 1; }
.wave-b { fill: #dbe4ea; opacity: .7; }
.wave-wrap.footer .wave-a { fill: var(--anthracite); }
.wave-wrap.footer .wave-b { fill: #334048; opacity: .85; }
.admin-wave .wave-a { fill: #f4f7f9; }
.admin-wave .wave-b { fill: #e8eef2; opacity: .8; }

.card {
  transition:
    transform .5s var(--ease-wave),
    box-shadow .5s var(--ease-soft);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px rgba(28, 33, 38, .12);
}
.card-media img {
  transition: transform 1.1s var(--ease-wave);
}
.card:hover .card-media img { transform: scale(1.06); }
.card-foot {
  transition: background .35s var(--ease-soft);
}
.card:hover .card-foot { background: #f3e9ea; }

.grid .card:nth-child(1) { animation-delay: .02s; }
.grid .card:nth-child(2) { animation-delay: .07s; }
.grid .card:nth-child(3) { animation-delay: .12s; }
.grid .card:nth-child(4) { animation-delay: .17s; }
.grid .card:nth-child(5) { animation-delay: .22s; }
.grid .card:nth-child(6) { animation-delay: .27s; }
.grid .card:nth-child(7) { animation-delay: .32s; }
.grid .card:nth-child(8) { animation-delay: .37s; }
.grid .card:nth-child(9) { animation-delay: .42s; }
.grid .card:nth-child(n+10) { animation-delay: .48s; }
body.page-ready .grid .card { animation: card-in .8s var(--ease-soft) both; }

.btn {
  border-radius: 999px;
  transition: transform .35s var(--ease-wave), box-shadow .35s var(--ease-soft), background .3s ease, filter .3s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-red { box-shadow: 0 10px 22px rgba(200, 16, 46, .22); }
.btn-navy { box-shadow: 0 10px 22px rgba(27, 54, 93, .18); }
.btn:active { transform: translateY(0) scale(.98); }

.page-title, .course-title, .course-hero, .course-block, .pay-card, .side-card, .catalog-head,
.panel, .prose, .news-item, .faq details, .sort-item, .stat, .task, .receipt-card,
.about-hero, .about-split, .about-axes, .about-steps, .about-docs, .about-team, .about-cta {
  animation: rise-in .75s var(--ease-soft) both;
}

.panel {
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(28, 33, 38, .06);
  transition: transform .45s var(--ease-wave), box-shadow .45s ease;
}
.panel:hover { box-shadow: 0 16px 36px rgba(28, 33, 38, .09); }

.field input, .field select, .field textarea,
.login-box input {
  transition: border-color .3s ease, box-shadow .35s var(--ease-soft), transform .35s var(--ease-wave);
}
.field input:focus, .field select:focus, .field textarea:focus {
  transform: translateY(-1px);
}

.acc details { transition: box-shadow .4s var(--ease-soft), border-color .35s ease; }
.acc summary { transition: background .35s ease; }
.acc summary:hover { background: #fbf6f6; }
.acc .acc-body {
  animation: rise-in .45s var(--ease-soft) both;
}
.course-hero-media img {
  transition: transform 1.2s var(--ease-wave);
}
.course-hero:hover .course-hero-media img { transform: scale(1.04); }

.step { transition: background .4s var(--ease-soft), transform .35s var(--ease-wave), color .3s ease; }
.step:hover { transform: translateY(-2px); }
.step-pane { animation: none; }
.step-pane.is-on { animation: pane-wave .55s var(--ease-soft) both; }

.task, .stat {
  transition: transform .45s var(--ease-wave), box-shadow .45s ease;
}
.task:hover, .stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px rgba(28, 33, 38, .1);
}

.admin {
  grid-template-rows: 56px auto 1fr;
}
.admin-top {
  background: linear-gradient(90deg, #7a1220, #a31b2c 55%, #8a1422);
}
.login-box .btn,
.login-submit {
  background: #7a4a4e;
  color: #fff;
}
.admin-nav a {
  transition: background .35s var(--ease-soft), transform .35s var(--ease-wave), color .25s ease;
}
.admin-nav a:hover, .admin-nav a.is-on { transform: translateX(4px); }

.cookie-bar {
  animation: cookie-up .7s var(--ease-soft) both;
}

html:has(body.login-page) {
  overflow: hidden;
  height: 100%;
}
.login-page {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(180, 140, 130, .16), transparent 55%),
    radial-gradient(700px 400px at 100% 20%, rgba(140, 155, 165, .12), transparent 50%),
    linear-gradient(180deg, #f7f5f2, #eeeae6);
}
.login-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  height: 42%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.login-waves svg {
  display: block;
  width: 200%;
  max-width: none;
  height: 100%;
  animation: wave-drift 12s ease-in-out infinite;
}
.login-box {
  position: relative;
  z-index: 2;
  background: rgba(255, 252, 250, .92);
  backdrop-filter: blur(14px);
  padding: 36px 32px 32px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 28px 60px rgba(70, 55, 52, .1);
}
.login-box img {
  animation: float-soft 4.5s ease-in-out infinite;
}
.login-field input,
.login-box input {
  transition: border-color .35s ease, box-shadow .4s var(--ease-soft), background .3s ease, transform .35s var(--ease-wave);
}
.login-field input:focus,
.login-box input:focus {
  outline: none;
  border-color: #c4a8a6;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(122, 74, 78, .1);
}
.login-submit:hover {
  background: #6a3f43 !important;
  transform: translateY(-2px);
}

.site-footer {
  position: relative;
  background: linear-gradient(180deg, #36424b, var(--anthracite));
}
.site-footer a {
  transition: transform .3s var(--ease-wave), color .3s ease;
}
.site-footer a:hover { transform: translateX(4px); }

@keyframes wave-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-50%); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) rotate(.6deg); }
  to { opacity: 1; transform: none; }
}
@keyframes pane-wave {
  from { opacity: 0; transform: translateX(18px) translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes cookie-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.light-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 55;
}

@media (pointer: coarse), (max-width: 720px) {
  .light-trail { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .wave-wrap svg, .login-waves svg { animation: none !important; }
  .light-trail { display: none !important; }
}
