:root {
  color-scheme: light dark;
  --ink: #17151f;
  --muted: #5f586a;
  --soft: #8d849b;
  --paper: #fbf9fe;
  --panel: #ffffff;
  --card-bg: rgb(255 255 255 / 78%);
  --pill-bg: rgb(255 255 255 / 82%);
  --pill-text: #4b4359;
  --nav-bg: rgb(251 249 254 / 82%);
  --nav-line: rgb(229 221 235 / 72%);
  --wash: #f2edf8;
  --line: #e5ddeb;
  --brand: #6d3fc0;
  --brand-dark: #44227e;
  --red: #e23b54;
  --mint: #00a884;
  --blue: #2478ff;
  --amber: #c98016;
  --shadow: 0 24px 70px rgb(36 27 58 / 14%);
  --button-shadow: 0 10px 25px rgb(36 27 58 / 8%);
  --hero-bg:
    radial-gradient(circle at 18% 8%, rgb(109 63 192 / 14%), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgb(226 59 84 / 10%), transparent 28rem),
    linear-gradient(180deg, #f9f5ff 0%, #fbf9fe 34%, #f6f7fb 100%);
}

html[data-theme="dark"] {
  --ink: #f8f4ff;
  --muted: #c9c0d5;
  --soft: #9f94b0;
  --paper: #121018;
  --panel: #1d1827;
  --card-bg: rgb(34 28 45 / 78%);
  --pill-bg: rgb(36 29 49 / 92%);
  --pill-text: #f2ebff;
  --nav-bg: rgb(18 16 24 / 82%);
  --nav-line: rgb(255 255 255 / 10%);
  --wash: #2c223d;
  --line: #3a304a;
  --brand: #c19cff;
  --brand-dark: #e4d5ff;
  --red: #ff5a73;
  --mint: #39d8b1;
  --blue: #70a7ff;
  --amber: #f0b45d;
  --shadow: 0 28px 90px rgb(0 0 0 / 38%);
  --button-shadow: 0 12px 30px rgb(0 0 0 / 22%);
  --hero-bg:
    radial-gradient(circle at 18% 8%, rgb(193 156 255 / 18%), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgb(255 90 115 / 12%), transparent 28rem),
    linear-gradient(180deg, #17121f 0%, #121018 44%, #151821 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color .28s ease, color .28s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--hero-bg);
  animation: atmosphere 18s ease-in-out infinite alternate;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-line);
}
.nav-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; border-radius: 8px; }
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 22px;
  font-size: .95rem;
}
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 650; }
.nav-links a:hover { color: var(--brand); }
.nav-links .button.primary,
.nav-links .button.primary:hover,
.nav-links .button.primary:focus-visible {
  color: #fff;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--button-shadow);
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.button:not(.primary) {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}
.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.button:hover { transform: translateY(-1px); text-decoration: none; }

.theme-toggle {
  width: 58px;
  height: 32px;
  min-width: 58px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, var(--wash));
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%), var(--button-shadow);
  overflow: hidden;
  transition: background-color .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.theme-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f6c453;
  box-shadow: 0 3px 12px rgb(36 27 58 / 20%), 0 0 18px rgb(246 196 83 / 30%);
  transition: transform .24s ease, box-shadow .24s ease, background-color .24s ease;
}
.theme-toggle::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--muted) 72%, transparent);
  opacity: .78;
  transition: opacity .2s ease, transform .24s ease;
}
html[data-theme="dark"] .theme-toggle::before {
  background: #d9d2ff;
  transform: translateX(26px);
  box-shadow: inset -7px -4px 0 #6f58c9, 0 0 18px rgb(193 156 255 / 34%);
}
html[data-theme="dark"] .theme-toggle::after {
  opacity: 0;
  transform: translateX(-12px);
}
html[data-theme="dark"] .theme-toggle {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: color-mix(in srgb, var(--brand) 18%, var(--panel));
}
.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 42%, transparent);
  outline-offset: 4px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr);
  gap: clamp(36px, 7vw, 80px);
  align-items: center;
  min-height: calc(100svh - 76px);
  padding: 56px 0 72px;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: 0; }
h1 { max-width: 780px; font-size: clamp(3.2rem, 7vw, 6.9rem); }
h2 { font-size: clamp(2.15rem, 4.8vw, 4.5rem); }
h3 { font-size: 1.18rem; }
.lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.34rem);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 32px 0 0;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 200px;
  height: 58px;
  min-height: 44px;
  line-height: 0;
  overflow: hidden;
  transition: transform .18s ease, filter .18s ease;
}
.store-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.store-badge ms-store-badge {
  display: block;
  transform: scale(.53);
  transform-origin: left center;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: .9rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgb(36 27 58 / 10%);
}
.dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 16%, transparent);
}
.dot.red { background: var(--red); }
.dot.blue { background: var(--blue); }

.device {
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 3%)),
    #17131f;
  box-shadow: var(--shadow);
  padding: 8px;
  transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
  animation: floatDevice 7s ease-in-out infinite;
  position: relative;
}
.slides {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #080b12;
}
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity .72s ease, transform .72s ease;
}
.slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
}
.slide figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(10 9 16 / 72%);
  color: #fff;
  font-size: .78rem;
  font-weight: 850;
  backdrop-filter: blur(12px);
}
.slide-controls {
  position: absolute;
  left: 50%;
  bottom: -18px;
  z-index: 4;
  display: flex;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(16 13 24 / 78%);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.slide-controls button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 42%);
  cursor: pointer;
}
.slide-controls button.is-active {
  width: 25px;
  background: var(--brand);
}
.slide-controls button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

section { padding: 84px 0; }
.section-head { display: flex; justify-content: space-between; gap: 34px; align-items: end; margin-bottom: 34px; }
.section-head p { max-width: 560px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 14px 45px rgb(36 27 58 / 7%);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .28s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin: 10px 0 0; }
.icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--brand);
  font-weight: 900;
}
.band {
  background: #16131d;
  color: #f8f5ff;
}
.band .section-head p, .band .card p { color: #cfc6dc; }
.band .card {
  background: rgb(255 255 255 / 7%);
  border-color: rgb(255 255 255 / 12%);
  box-shadow: none;
}
.steps {
  counter-reset: step;
  display: grid;
  gap: 12px;
}
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  transition: transform .2s ease, border-color .2s ease, background-color .28s ease;
}
.step:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}
.step h3 { margin-top: 2px; }
.step p { margin: 8px 0 0; color: var(--muted); }

.doc-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 44px;
  padding: 54px 0 92px;
}
.toc {
  position: sticky;
  top: 104px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}
.toc a { color: var(--muted); text-decoration: none; font-weight: 700; }
.toc a:hover { color: var(--brand); }
.doc {
  max-width: 850px;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 14px 45px rgb(36 27 58 / 7%);
}
.doc h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.doc h2 {
  margin-top: 44px;
  margin-bottom: 16px;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}
.doc h3 { margin-top: 28px; }
.doc p, .doc li { color: var(--muted); }
.doc li + li { margin-top: 8px; }
.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--wash);
}
.callout p { margin: 0; }
.support-section {
  padding-top: 28px;
}
.support-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 24px;
  align-items: stretch;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 13%, transparent), transparent 46%),
    color-mix(in srgb, var(--card-bg) 86%, var(--panel));
  box-shadow: var(--shadow);
}
.support-copy p {
  max-width: 780px;
  color: var(--muted);
}
.support-copy p + p { margin-top: 14px; }
.support-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}
.kofi-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  line-height: 0;
  transition: transform .18s ease, filter .18s ease;
}
.kofi-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.kofi-button img {
  width: auto;
  height: 36px;
  border: 0;
}
.support-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}
.support-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.support-card li + li { margin-top: 8px; }
.support-card p {
  margin: 0;
  color: var(--muted);
  font-size: .98rem;
}
.footer {
  padding: 44px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.footer strong { color: var(--ink); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
}
.footer a {
  color: var(--muted);
  text-decoration: none;
}
.footer a:hover { color: var(--brand); }
.footer-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
}
.legal-note {
  margin: 0;
  font-size: .9rem;
  color: var(--soft);
}
.copyright {
  margin: 0;
  color: var(--soft);
  font-size: .9rem;
  text-align: right;
  white-space: nowrap;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .62s ease, transform .62s ease;
}

@keyframes atmosphere {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

@keyframes floatDevice {
  0%, 100% { transform: perspective(1200px) rotateY(-3deg) rotateX(1deg) translateY(0); }
  50% { transform: perspective(1200px) rotateY(-1deg) rotateX(.4deg) translateY(-10px); }
}

@media (max-width: 920px) {
  .hero, .grid-3, .grid-2, .doc-layout, .support-panel { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 38px; }
  .device { transform: none; animation: none; }
  .section-head { display: block; }
  .section-head p { margin-top: 14px; }
  .toc { position: static; }
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-inner { min-height: 68px; }
  .theme-toggle { margin-left: auto; }
}

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

@media (max-width: 680px) {
  .shell { width: min(100% - 26px, 1180px); }
  .nav-inner { min-height: auto; padding: 14px 0; align-items: flex-start; }
  .theme-toggle { margin-left: auto; }
  h1 { font-size: clamp(2.75rem, 16vw, 4.4rem); }
  section { padding: 58px 0; }
  .doc { padding: 22px; }
  .footer-links { justify-content: flex-start; }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .copyright {
    text-align: left;
    white-space: normal;
  }
  .slide figcaption { left: 10px; bottom: 10px; font-size: .72rem; }
  .slide-controls { bottom: -16px; }
}

@media (max-width: 480px) {
  .hero { padding-top: 30px; }
  .store-badge { width: 100%; justify-content: flex-start; }
  .hero-actions .button { width: 100%; }
  .trust-row { display: grid; grid-template-columns: 1fr; }
  .pill { width: 100%; }
  .device { margin-inline: -4px; padding: 7px; border-radius: 18px; }
  .slide figcaption { display: none; }
  .slide-controls { padding: 6px 8px; }
}

.ticket-page { padding-top: 56px; padding-bottom: 92px; }
.ticket-heading { max-width: 800px; margin-bottom: 36px; }
.ticket-heading h1 { font-size: clamp(2.7rem, 6vw, 5.3rem); }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.ticket-workspace { min-width: 0; }
.ticket-form, .ticket-guide, .ticket-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 14px 45px rgb(36 27 58 / 7%);
}
.ticket-form { display: grid; gap: 18px; padding: clamp(22px, 4vw, 34px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label, .admin-tools label { font-weight: 800; }
.field input, .field select, .field textarea, .admin-row input, .reply-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  color: var(--ink); padding: 11px 13px; font: inherit;
}
.field textarea, .reply-form textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .admin-row input:focus, .reply-form textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent); border-color: var(--brand);
}
.bot-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; }
.turnstile-wrap { min-height: 65px; }
.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-message { color: var(--muted); font-weight: 700; }
.ticket-board { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.ticket-column { min-width: 0; padding: 18px; }
.ticket-column-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ticket-column-head h2, .ticket-guide h2 { font-size: 1.35rem; }
.ticket-column-head span, .ticket-status { padding: 3px 9px; border-radius: 999px; background: var(--wash); color: var(--brand); font-weight: 850; font-size: .82rem; }
.ticket-list { display: grid; gap: 12px; }
.ticket-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ticket-card h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.ticket-card > p { margin: 8px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; margin-top: 13px; color: var(--soft); font-size: .78rem; }
.ticket-comments { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ticket-comment { padding: 11px; border-radius: 8px; background: var(--wash); }
.ticket-comment.admin-comment { border-left: 3px solid var(--brand); }
.ticket-comment-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; font-size: .75rem; color: var(--soft); }
.ticket-comment p { margin: 5px 0 0; overflow-wrap: anywhere; }
.reply-form { display: grid; gap: 8px; margin-top: 13px; }
.reply-note, .empty-state { color: var(--soft); font-size: .86rem; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.ticket-action { min-height: 34px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.ticket-action:hover { border-color: var(--brand); }
.ticket-action.danger { color: var(--red); }
.ticket-guide { position: sticky; top: 100px; padding: 22px; }
.ticket-guide ol { padding-left: 21px; color: var(--muted); }
.ticket-guide p { color: var(--muted); font-size: .92rem; }
.admin-tools { display: grid; gap: 7px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

@media (max-width: 920px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-guide { position: static; }
}
@media (max-width: 680px) {
  .ticket-page { padding-top: 38px; }
  .form-grid, .ticket-board { grid-template-columns: 1fr; }
}
