:root {
  --ink: #142033;
  --muted: #5d6f86;
  --line: rgba(30, 55, 90, 0.12);
  --paper: rgba(255, 255, 255, 0.9);
  --paper-solid: #ffffff;
  --amber: #f0b429;
  --amber-deep: #d4920f;
  --sky: #4ea3d9;
  --sky-deep: #2f7fb8;
  --ok: #1f9d63;
  --danger: #c0392b;
  --radius: 28px;
  --shadow: 0 18px 50px rgba(28, 55, 95, 0.12);
  --font: "Outfit", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  --page-bg:
    radial-gradient(ellipse 90% 50% at 10% 0%, #d7ebfa 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 90% 10%, #ffe9b8 0%, transparent 45%),
    linear-gradient(180deg, #c8e0f4 0%, #e8f1fa 28%, #f4f7fb 100%);
  --topbar-bg: rgba(255, 255, 255, 0.78);
  --chip-bg: rgba(255, 255, 255, 0.92);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --nav-hover: #eef5fb;
  --field-bg: rgba(255, 255, 255, 0.95);
  --qty-bg: linear-gradient(135deg, #eef6fc, #fff8e8);
  --check-bg: #eef5fb;
  --check-ok: #e5f7ee;
  --check-bad: #fdecea;
  --tab-bg: rgba(255, 255, 255, 0.9);
  --tab-count: #eef3f8;
  --tab-active: #142033;
  --product-bg: rgba(255, 255, 255, 0.94);
  --rules-card: rgba(255, 255, 255, 0.6);
  --hero-veil: linear-gradient(180deg, rgba(10, 20, 35, 0.35) 0%, transparent 38%, rgba(232, 241, 250, 0.45) 72%, #e8f1fa 100%);
  --brand-word: #fff8e7;
  --brand-line: rgba(255, 248, 231, 0.92);
  --brand-sub: rgba(232, 242, 255, 0.88);
  --toast-bg: #152033;
  --topbar-h: 76px;
}

html[data-theme="dark"] {
  --ink: #e8eef8;
  --muted: #9aadc4;
  --line: rgba(180, 205, 235, 0.12);
  --paper: rgba(22, 32, 48, 0.88);
  --paper-solid: #162030;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --page-bg:
    radial-gradient(ellipse 80% 45% at 12% 0%, rgba(78, 163, 217, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 8%, rgba(240, 180, 41, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #0c121c 0%, #121b2a 40%, #0e1622 100%);
  --topbar-bg: rgba(12, 18, 28, 0.82);
  --chip-bg: rgba(24, 36, 54, 0.9);
  --nav-bg: rgba(18, 28, 42, 0.94);
  --nav-hover: rgba(255, 255, 255, 0.06);
  --field-bg: rgba(12, 18, 28, 0.85);
  --qty-bg: linear-gradient(135deg, rgba(47, 127, 184, 0.18), rgba(240, 180, 41, 0.12));
  --check-bg: rgba(255, 255, 255, 0.05);
  --check-ok: rgba(31, 157, 99, 0.18);
  --check-bad: rgba(192, 57, 43, 0.18);
  --tab-bg: rgba(18, 28, 42, 0.9);
  --tab-count: rgba(255, 255, 255, 0.08);
  --tab-active: #f0b429;
  --product-bg: rgba(22, 32, 48, 0.92);
  --rules-card: rgba(255, 255, 255, 0.04);
  --hero-veil: linear-gradient(180deg, rgba(8, 12, 20, 0.55) 0%, transparent 40%, rgba(12, 18, 28, 0.55) 75%, #0e1622 100%);
  --brand-word: #ffe8a3;
  --brand-line: rgba(255, 248, 231, 0.95);
  --brand-sub: rgba(200, 220, 240, 0.85);
  --toast-bg: #0a1018;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .35s ease, color .25s ease;
}

.bg-glow {
  position: fixed;
  inset: auto -10% -20% auto;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.16), transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
}
html[data-theme="dark"] .bg-glow {
  background: radial-gradient(circle, rgba(78, 163, 217, 0.14), transparent 65%);
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-8%, -6%, 0) scale(1.08); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(20, 40, 70, 0.08);
}
.topbar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero {
  position: relative;
  min-height: min(68vh, 620px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 40, 70, 0.22), rgba(20, 40, 70, 0.38)),
    url("/img/hero-sky.png") center / cover no-repeat;
  transform: scale(1.04);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background: var(--hero-veil);
}
@keyframes heroZoom {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.1) translateY(-1.5%); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 48px 24px 56px;
}
.brand-corner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--chip-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  box-shadow: var(--shadow);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: .08em;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.brand-corner img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.brand-corner:hover { transform: translateY(-2px); }
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: var(--chip-bg);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: inherit;
  text-decoration: none;
  min-width: 150px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip-link { display: inline-flex; flex-direction: column; }
.chip-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip-main { font-weight: 800; font-size: 14px; margin-top: 1px; }
.chip-sub { color: var(--muted); font-size: 11px; margin-top: 1px; }

.theme-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--amber-deep);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  transition: transform .2s ease, background .25s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-8deg); }
.theme-icon { display: none; line-height: 0; }
html[data-theme="light"] .theme-moon { display: block; }
html[data-theme="dark"] .theme-sun { display: block; color: var(--amber); }

.brand-block { text-align: center; padding-bottom: 8px; }
.brand-logo {
  display: block;
  margin: 0 auto;
  width: clamp(96px, 16vw, 132px);
  height: clamp(96px, 16vw, 132px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 6px rgba(255,255,255,.28),
    0 18px 40px rgba(10, 20, 40, .35);
  animation: brandIn .9s cubic-bezier(.2,.8,.2,1) both, floaty 4.8s ease-in-out infinite;
}
.brand-word {
  display: block;
  margin: 18px 0 0;
  font-family: var(--display);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--brand-word);
  text-shadow: 0 10px 36px rgba(0, 0, 0, .35);
  animation: brandIn .9s .08s cubic-bezier(.2,.8,.2,1) both;
}
.brand-line {
  margin: 10px 0 8px;
  color: var(--brand-line);
  font-weight: 700;
  font-size: clamp(16px, 2.4vw, 22px);
  animation: brandIn .9s .12s cubic-bezier(.2,.8,.2,1) both;
}
.brand-sub {
  margin: 0 0 22px;
  color: var(--brand-sub);
  font-weight: 600;
  animation: brandIn .9s .14s cubic-bezier(.2,.8,.2,1) both;
}
.rate-line {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.rate-line b { color: var(--amber-deep); }
.cta-scroll {
  display: inline-flex;
  text-decoration: none;
  color: #1a2a3d;
  font-weight: 800;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(212, 146, 15, .35);
  animation: brandIn .9s .18s cubic-bezier(.2,.8,.2,1) both, pulse 2.8s ease-in-out infinite;
}
@keyframes brandIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(212, 146, 15, .35); }
  50% { box-shadow: 0 16px 36px rgba(212, 146, 15, .5); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.nav {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 32px));
  margin: -18px auto 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 6px;
  padding: 10px;
}
.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 14px;
}
.nav-link.active, .nav-link:hover { color: var(--ink); background: var(--nav-hover); }

.wrap {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 20px 70px;
}
.grid-two {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  margin-bottom: 42px;
}
.panel {
  background: var(--paper);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.rise { animation: brandIn .7s ease both; }
.rise.delay { animation-delay: .12s; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-family: var(--display);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--sky-deep));
  box-shadow: 0 0 0 4px rgba(78, 163, 217, .18);
}
.dot.amber {
  background: linear-gradient(135deg, #ffd166, var(--amber-deep));
  box-shadow: 0 0 0 4px rgba(240, 180, 41, .18);
}

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--field-bg);
  outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(78, 163, 217, .18);
}

.qty-box {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--qty-bg);
  border: 1px solid var(--line);
}
.qty-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}
.qty-head strong {
  font-size: 22px;
  font-family: var(--display);
  color: var(--amber-deep);
}
#qtySlider {
  width: 100%;
  accent-color: var(--amber-deep);
  height: 28px;
  cursor: pointer;
}
.qty-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.check-row {
  min-height: 42px;
  border-radius: 16px;
  background: var(--check-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 12px;
  margin-bottom: 16px;
}
.check-row.ok { color: var(--ok); background: var(--check-ok); }
.check-row.bad { color: var(--danger); background: var(--check-bad); }

.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.muted { color: var(--muted); font-size: 13px; }
.total {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--display);
  color: var(--ink);
}
.btn-primary {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  color: #1a2a3d;
  font: inherit;
  font-weight: 800;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(212, 146, 15, .35);
}
.btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  background: #9eb3c8;
  color: #fff;
}
.btn-primary:not(:disabled):hover { filter: brightness(1.05); }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; }

.recent { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.recent li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #d7ebfa, #fff3d0);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.recent-title { font-weight: 800; font-size: 14px; }
.recent-sub, .recent-time { color: var(--muted); font-size: 12px; }

.section-title {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 34px);
  margin: 0;
}
.section-sub { margin: 6px 0 0; color: var(--muted); font-weight: 600; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
  background: var(--tab-bg);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.tab span {
  display: inline-block;
  margin-left: 6px;
  background: var(--tab-count);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.tab.active { background: var(--tab-active); color: #fff; }
html[data-theme="dark"] .tab.active { color: #142033; }
.tab.active span { background: rgba(255,255,255,.16); color: inherit; }

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.product {
  position: relative;
  background: var(--product-bg);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  min-height: 220px;
  border: 2px solid transparent;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.product::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c, #5B8CFF) 16%, transparent), transparent 55%);
  pointer-events: none;
}
.product:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c, #5B8CFF) 50%, white);
}
.product.selected {
  border-color: var(--c, var(--sky-deep));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, #5B8CFF) 22%, transparent);
}
.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  background: linear-gradient(135deg, #ff6b6b, #e63946);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
}
.product-type {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 28px 0 4px;
}
.product-name {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 24px;
  margin: 0;
  max-width: 58%;
}
.product-price {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  font-size: 28px;
  font-weight: 800;
}
.product-cta {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.product-art {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 112px;
  height: 112px;
  z-index: 1;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  animation: floaty 4.5s ease-in-out infinite;
}
.product-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  filter: drop-shadow(0 10px 16px rgba(20, 40, 70, .22));
}

.rules { margin-top: 28px; }
.rules h2 { font-family: var(--display); margin-top: 0; }
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rules-grid article {
  background: var(--rules-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
}
.rules-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-family: var(--display);
}
.rules-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}
.rules-foot {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #152033 0%, #0f1826 100%);
  color: #d7e2f0;
  padding: 44px 20px 22px;
  margin-top: 48px;
}
.footer-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
}
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.footer-brand-row img { border-radius: 50%; }
.footer-brand {
  font-family: var(--display);
  font-size: 24px;
  color: var(--amber);
}
.footer a {
  display: block;
  color: #a9bdd6;
  text-decoration: none;
  margin: 6px 0;
  font-weight: 600;
}
.footer h3 { margin: 0 0 8px; font-size: 14px; color: #fff; }
.footer-ip { margin: 12px 0; background: #1e2d45; color: #fff; min-width: 0; border-color: transparent; }
.footer-bottom {
  width: min(1120px, 100%);
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid #24344d;
  color: #7f93ad;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 50;
}

@media (max-width: 900px) {
  .grid-two, .products, .footer-grid, .rules-grid { grid-template-columns: 1fr; }
  .hero { min-height: 56vh; }
  .topbar-inner { flex-wrap: wrap; }
  .hero-actions { width: 100%; justify-content: stretch; }
  .chip { flex: 1; min-width: 0; }
  .product-name { max-width: 70%; }
  .brand-corner span { letter-spacing: .06em; }
}
