@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,800&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --bg: #0F172A;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --surface-muted: rgba(255, 255, 255, 0.05);
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.12);
  --brand: #6366f1;
  --brand-strong: #4f46e5;
  --accent: #22d3ee;
  --warm: #f59e0b;
  --success: #10B981;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --theme-primary: #6366f1;
  --theme-primary-strong: #4f46e5;
  --theme-secondary: #22d3ee;
  --theme-accent: #f59e0b;
  --theme-surface: rgba(99, 102, 241, 0.08);
  --theme-primary-rgb: 99, 102, 241;
  --theme-secondary-rgb: 34, 211, 238;
  --theme-accent-rgb: 245, 158, 11;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 6%, rgba(var(--theme-primary-rgb), 0.34), transparent 27%),
    radial-gradient(circle at 84% 12%, rgba(var(--theme-secondary-rgb), 0.22), transparent 30%),
    linear-gradient(135deg, #0F172A, #1E293B);
}

body[data-theme="memovivid"] {
  --theme-primary: #7c3aed;
  --theme-primary-strong: #6d28d9;
  --theme-secondary: #22d3ee;
  --theme-accent: #fbbf24;
  --theme-surface: rgba(124, 58, 237, 0.08);
  --theme-primary-rgb: 124, 58, 237;
  --theme-secondary-rgb: 34, 211, 238;
  --theme-accent-rgb: 251, 191, 36;
}

body[data-theme="logicforge"] {
  --theme-primary: #1d4ed8;
  --theme-primary-strong: #1e40af;
  --theme-secondary: #10b981;
  --theme-accent: #f59e0b;
  --theme-surface: rgba(29, 78, 216, 0.08);
  --theme-primary-rgb: 29, 78, 216;
  --theme-secondary-rgb: 16, 185, 129;
  --theme-accent-rgb: 245, 158, 11;
}

body[data-theme="qrcodecreator"] {
  --theme-primary: #16a34a;
  --theme-primary-strong: #0f766e;
  --theme-secondary: #0f766e;
  --theme-accent: #F0FDF4;
  --theme-surface: rgba(22, 163, 74, 0.08);
  --theme-primary-rgb: 22, 163, 74;
  --theme-secondary-rgb: 15, 118, 110;
  --theme-accent-rgb: 240, 253, 244;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
select,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner,
.page,
.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand span {
  overflow-wrap: anywhere;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.hero-logo-wrap picture {
  display: block;
}

.vm-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.12em;
  padding-right: 3px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.24);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.nav a {
  color: var(--text-muted);
  font-weight: 700;
}

.nav a:hover,
.nav a:focus-visible {
  color: #ffffff;
}

.lang-selector select {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lang-selector select option {
  background: #1e293b;
  color: #ffffff;
}

.page {
  padding: 36px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 30px;
  align-items: stretch;
  padding: 40px 0 28px;
}

.content-stack,
.hero-card,
.card,
.mail-card,
.legal-shell,
.screenshot-frame {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.content-stack {
  position: relative;
  overflow: hidden;
  padding: 32px;
}

.content-stack::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -52px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(var(--theme-secondary-rgb), 0.16) 0%, rgba(var(--theme-secondary-rgb), 0) 72%);
  pointer-events: none;
}

.hero-card {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(var(--theme-secondary-rgb), 0.24), transparent 30%),
    radial-gradient(circle at bottom left, rgba(var(--theme-primary-rgb), 0.18), transparent 36%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.logo-card {
  text-align: center;
}

.app-icon {
  width: 360px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 72px;
  object-fit: cover;
  display: block;
}

.hero-logo-wrap {
  width: 100%;
  max-width: 360px;
  border-radius: 72px;
  overflow: hidden;
  position: relative;
}

.hero-logo {
  width: 100%;
  height: auto;
  display: block;
}

.series-logo-img {
  width: min(280px, 100%);
  height: auto;
}

.series-logo-caption {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.32);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.kicker,
.back-link,
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.kicker,
.badge {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(var(--theme-primary-rgb), 0.12);
  border: 1px solid rgba(var(--theme-primary-rgb), 0.22);
}

.back-link {
  margin-bottom: 18px;
  color: #A5F3FC;
  background: rgba(var(--theme-secondary-rgb), 0.08);
  border: 1px solid rgba(var(--theme-secondary-rgb), 0.24);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h1 {
  margin-top: 16px;
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0;
  color: var(--text-muted);
}

.gradient-text {
  background: linear-gradient(135deg, var(--theme-primary-strong), var(--theme-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin-top: 16px;
  max-width: 60ch;
  font-size: 1.04rem;
}

.download-buttons,
.badge-container,
.trust-line,
.footer-links,
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-buttons {
  margin-top: 24px;
}

.badge-container,
.trust-line {
  margin-top: 18px;
}

.trust-line {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.btn-primary {
  border-color: var(--theme-primary);
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-strong));
  color: #ffffff;
}

.btn-green {
  border-color: var(--theme-primary);
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-strong));
  color: #ffffff;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.section {
  padding: 24px 0;
}

.section-title {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  max-width: 66ch;
}

.grid-3,
.grid-4,
.support-grid,
.screenshots-grid,
.error-links {
  display: grid;
  gap: 18px;
}

.grid-3,
.support-grid,
.error-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screenshots-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.mail-card,
.screenshot-frame {
  padding: 22px;
}

.card {
  display: grid;
  gap: 12px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
  border-color: rgba(var(--theme-primary-rgb), 0.32);
}

.tag {
  justify-self: flex-start;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(var(--theme-primary-rgb), 0.15);
  border: 1px solid rgba(var(--theme-primary-rgb), 0.24);
}

.mail-card strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.legal-shell {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at top right, rgba(var(--theme-secondary-rgb), 0.12), transparent 28%);
}

.legal-copy {
  display: grid;
  gap: 14px;
}

.legal-copy ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.legal-copy li + li {
  margin-top: 8px;
}

.screenshot-frame {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
}

.screenshot {
  border-radius: 18px;
}

.footer {
  margin-top: 28px;
  padding: 28px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.footer-meta {
  display: grid;
  gap: 12px;
}

.footer-languages a,
.footer-links a {
  color: var(--text-muted);
  font-weight: 600;
}

.footer-languages a:hover,
.footer-links a:hover,
.footer-languages a:focus-visible,
.footer-links a:focus-visible {
  color: #ffffff;
}

.status-code {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 0.95;
  color: var(--theme-primary-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero .content-stack > *,
.hero .hero-card,
.section .card,
.section .mail-card,
.section .screenshot-frame,
.section .legal-shell {
  animation: rise-in 540ms ease both;
}

.hero .content-stack > *:nth-child(1) {
  animation-delay: 40ms;
}

.hero .content-stack > *:nth-child(2) {
  animation-delay: 100ms;
}

.hero .content-stack > *:nth-child(3) {
  animation-delay: 160ms;
}

.hero .content-stack > *:nth-child(4) {
  animation-delay: 220ms;
}

.hero .content-stack > *:nth-child(5) {
  animation-delay: 280ms;
}

.hero .hero-card {
  animation-delay: 180ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.72fr);
  }
}

@media (max-width: 960px) {
  .hero,
  .grid-3,
  .grid-4,
  .support-grid,
  .screenshots-grid,
  .error-links {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .header-inner {
    align-items: flex-start;
    padding: 14px 0;
  }

  .brand-logo {
    height: 28px;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .content-stack,
  .hero-card,
  .card,
  .mail-card,
  .legal-shell,
  .screenshot-frame {
    border-radius: 20px;
  }

  h1 {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .brand-logo {
    height: 24px;
  }
}

@media (max-width: 560px) {
  .page,
  .header-inner,
  .footer-inner {
    width: min(100% - 24px, 1120px);
  }

  .page {
    padding-top: 20px;
    padding-bottom: 56px;
  }

  .content-stack,
  .hero-card,
  .card,
  .mail-card,
  .legal-shell,
  .screenshot-frame {
    padding: 18px;
  }

  .download-buttons,
  .footer-links,
  .footer-languages {
    gap: 10px;
  }

  .download-buttons .btn,
  .lang-selector select {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .brand {
    font-size: 0.95rem;
  }

  .brand-logo {
    height: 20px;
  }

  .vm-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .nav {
    gap: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
