:root {
  color-scheme: light;
  --background: 220 20% 98%;
  --foreground: 220 18% 10%;
  --card: 0 0% 100%;
  --surface: 220 18% 95%;
  --primary: 220 16% 12%;
  --primary-foreground: 220 20% 98%;
  --secondary: 220 14% 92%;
  --accent: 42 88% 48%;
  --accent-foreground: 220 18% 8%;
  --muted-foreground: 220 10% 38%;
  --border: 220 12% 82%;
  --focus: 217 90% 50%;
  --destructive: 356 72% 46%;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --max-width: 1280px;
}

:root.dark {
  color-scheme: dark;
  --background: 220 18% 5%;
  --foreground: 42 30% 92%;
  --card: 220 16% 8%;
  --surface: 220 14% 11%;
  --primary: 42 42% 88%;
  --primary-foreground: 220 18% 5%;
  --secondary: 220 12% 15%;
  --accent: 42 88% 55%;
  --accent-foreground: 220 18% 6%;
  --muted-foreground: 42 12% 63%;
  --border: 220 12% 22%;
  --focus: 217 92% 64%;
  --destructive: 356 76% 59%;
}

* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: hsl(var(--background));
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: hsl(var(--foreground));
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Noto Sans SC',
    sans-serif;
  background: hsl(var(--background));
  font-feature-settings:
    'rlig' 1,
    'calt' 1;
}

button,
a {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: hsl(var(--accent) / 0.14);
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid hsl(var(--focus));
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 13px;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: hsl(var(--background) / 0.95);
  border-bottom: 1px solid hsl(var(--border));
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  width: 100%;
  height: 72px;
  padding: 0 12px;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  color: hsl(var(--foreground));
}

.brand-logo {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  transition: transform 280ms ease;
}

.brand-lockup:hover .brand-logo {
  transform: translateY(-2px);
}

.brand-logo img,
.footer-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-dark,
.dark .logo-light {
  display: none !important;
}

.dark .logo-dark {
  display: block !important;
}

.brand-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  font-family: 'Avenir Next', ui-sans-serif, sans-serif;
}

.brand-name strong {
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.brand-name small {
  margin-top: 5px;
  white-space: nowrap;
  color: hsl(var(--accent));
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.desktop-nav a,
.mobile-menu a {
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}

.desktop-nav a {
  padding: 6px 12px;
  white-space: nowrap;
  color: hsl(var(--primary));
}

.desktop-nav a:hover,
.mobile-menu a:hover {
  color: hsl(var(--accent));
  background: hsl(var(--surface) / 0.75);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-download,
.language-link,
.icon-button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.header-download {
  width: 36px;
  gap: 8px;
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
  font-size: 14px;
  font-weight: 500;
}

.header-download span {
  display: none;
}

.header-download .icon,
.icon-button .icon,
.language-link .icon {
  width: 16px;
  height: 16px;
}

.header-download:hover,
.icon-button:hover,
.language-link:hover {
  background: hsl(var(--secondary) / 0.72);
}

.icon-button {
  width: 36px;
  padding: 0;
  background: transparent;
}

.theme-sun,
.dark .theme-moon {
  display: none;
}

.dark .theme-sun {
  display: block;
}

.language-link {
  width: 36px;
  gap: 7px;
  color: hsl(var(--foreground));
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

.language-link span,
.language-link .chevron-icon {
  display: none;
}

.language-switcher {
  position: relative;
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  display: grid;
  width: 190px;
  max-height: min(420px, calc(100vh - 96px));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: hsl(var(--background) / 0.98);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  box-shadow: 0 18px 52px rgb(0 0 0 / 0.16);
}

.language-menu[hidden] {
  display: none;
}

.language-menu a {
  padding: 10px 12px;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}

.language-menu a:hover,
.language-menu a[aria-current='page'] {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}

.language-link[aria-expanded='true'] .chevron-icon {
  transform: rotate(180deg);
}

.menu-toggle {
  display: inline-flex;
}

.menu-close-icon,
.menu-toggle.is-open .menu-open-icon {
  display: none;
}

.menu-toggle.is-open .menu-close-icon {
  display: block;
}

.mobile-menu {
  display: grid;
  max-height: calc(100vh - 72px - env(safe-area-inset-top));
  padding: 12px 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
}

.mobile-menu a {
  padding: 12px;
}

#download-content {
  padding-top: calc(72px + env(safe-area-inset-top));
}

.hero-section {
  background: hsl(var(--surface) / 0.35);
  border-bottom: 1px solid hsl(var(--border));
}

.hero-grid,
.section-grid,
.footer-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-right: 16px;
  padding-left: 16px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 56px;
}

.hero-copy {
  max-width: 576px;
}

.eyebrow {
  margin: 0;
  color: hsl(var(--accent));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-grid h2 {
  margin: 0;
  color: hsl(var(--foreground));
  text-wrap: balance;
}

.hero-copy h1 {
  max-width: 12ch;
  margin-top: 20px;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-description {
  max-width: 512px;
  margin: 24px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 16px;
  line-height: 32px;
  text-wrap: pretty;
}

.trust-list {
  display: grid;
  padding: 0;
  margin: 32px 0 0;
  gap: 12px;
  list-style: none;
}

.trust-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.trust-list .trust-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: hsl(var(--accent));
  background: hsl(var(--accent) / 0.12);
  border-radius: var(--radius-sm);
}

.trust-list .icon {
  width: 16px;
  height: 16px;
}

.download-panel {
  overflow: hidden;
  scroll-margin-top: 96px;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.download-primary-grid {
  display: grid;
}

.download-primary {
  padding: 20px;
}

.panel-heading-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-eyebrow {
  letter-spacing: 0.18em;
}

.download-primary h2 {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-icon {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--surface) / 0.6);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}

.panel-icon .icon {
  width: 20px;
  height: 20px;
}

.panel-description {
  max-width: 512px;
  margin: 16px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 28px;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  margin: 20px 0 0;
  gap: 8px 12px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.download-button {
  display: inline-flex;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  margin-top: 28px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: hsl(var(--accent-foreground));
  background: hsl(var(--accent));
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease;
}

.download-button:hover {
  background: hsl(var(--accent) / 0.9);
}

.download-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.qr-panel {
  display: none;
  padding: 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: hsl(var(--surface) / 0.45);
  border-left: 1px solid hsl(var(--border));
}

.qr-code {
  display: flex;
  width: 160px;
  height: 160px;
  padding: 12px;
  align-items: center;
  justify-content: center;
  color: #0b0f18;
  background: #fff;
  border: 1px solid hsl(var(--border));
}

.qr-code svg {
  display: block;
  width: 136px;
  height: 136px;
}

.qr-panel p {
  margin: 12px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.store-grid {
  display: grid;
  border-top: 1px solid hsl(var(--border));
}

.store-option {
  display: flex;
  min-height: 96px;
  padding: 20px;
  gap: 12px;
  align-items: flex-start;
}

.store-option + .store-option {
  border-top: 1px solid hsl(var(--border));
}

.store-option > .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: hsl(var(--muted-foreground));
}

.store-option > div {
  min-width: 0;
}

.store-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.store-title-row h3,
.safety-box h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.store-title-row span {
  padding: 2px 8px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-size: 10px;
}

.store-option p,
.safety-box p {
  margin: 6px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  line-height: 1.65;
}

.safety-box {
  display: flex;
  padding: 20px;
  gap: 12px;
  background: hsl(var(--surface) / 0.45);
  border-top: 1px solid hsl(var(--border));
}

.safety-box > .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: hsl(var(--accent));
}

.safety-box > div {
  min-width: 0;
}

.safety-box .checksum {
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
  opacity: 0.75;
}

.install-section {
  border-bottom: 1px solid hsl(var(--border));
}

.section-grid {
  display: grid;
  padding-top: 64px;
  padding-bottom: 64px;
  gap: 32px;
}

.section-grid h2 {
  max-width: 12ch;
  margin-top: 16px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  scroll-margin-top: 96px;
}

.section-description {
  max-width: 512px;
  margin: 20px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 1.75;
  text-wrap: pretty;
}

.install-list,
.highlight-list {
  padding: 0;
  margin: 0;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

.install-list {
  list-style: none;
}

.install-list li,
.highlight-item {
  display: grid;
  padding: 24px 0;
  gap: 16px;
}

.install-list li {
  grid-template-columns: 40px 1fr;
}

.install-list li + li,
.highlight-item + .highlight-item {
  border-top: 1px solid hsl(var(--border));
}

.step-number {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.install-list h3,
.highlight-item h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.install-list p,
.highlight-item p {
  max-width: 576px;
  margin: 8px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 1.75;
}

.highlight-item {
  grid-template-columns: 44px 1fr;
}

.highlight-icon {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: hsl(var(--surface));
  border-radius: var(--radius-md);
}

.highlight-icon .icon {
  width: 20px;
  height: 20px;
}

.site-footer {
  color: hsl(var(--primary));
  background: hsl(var(--background));
  border-top: 1px solid hsl(var(--border));
}

.footer-inner {
  padding-top: 32px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.footer-grid {
  display: grid;
  gap: 28px;
}

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

.footer-brand a {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 48px;
}

.footer-brand p {
  max-width: 384px;
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 1.6;
}

.footer-column h2,
.footer-contact h2 {
  margin: 0;
  color: hsl(var(--primary));
  font-size: 14px;
  font-weight: 600;
}

.footer-column nav,
.footer-contact {
  display: grid;
  gap: 12px;
}

.footer-column a {
  width: fit-content;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 500;
}

.footer-column a:hover,
.footer-bottom a:hover {
  color: hsl(var(--accent));
}

.footer-contact p {
  display: flex;
  min-width: 0;
  margin: 0;
  gap: 8px;
  align-items: center;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 500;
}

.footer-contact .icon {
  width: 16px;
  height: 16px;
  color: hsl(var(--accent));
}

.footer-contact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-bottom {
  display: flex;
  padding-top: 20px;
  margin-top: 28px;
  gap: 12px;
  flex-direction: column;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border));
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border-radius: var(--radius-md);
  box-shadow: 0 18px 52px rgb(0 0 0 / 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-size: 13px;
  line-height: 1.6;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: hsl(var(--destructive));
}

@media (min-width: 390px) {
  .brand-name {
    display: flex;
  }
}

@media (min-width: 640px) {
  .header-inner,
  .hero-grid,
  .section-grid,
  .footer-inner {
    padding-right: 28px;
    padding-left: 28px;
  }

  .header-download {
    width: auto;
    padding: 0 10px;
  }

  .header-download span,
  .language-link span,
  .language-link .chevron-icon {
    display: inline;
  }

  .language-link {
    width: auto;
    padding: 0 8px;
  }

  .hero-grid {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .hero-copy h1 {
    font-size: 48px;
  }

  .hero-description {
    font-size: 18px;
  }

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

  .download-primary,
  .qr-panel,
  .store-option,
  .safety-box {
    padding-right: 28px;
    padding-left: 28px;
  }

  .download-primary h2 {
    font-size: 30px;
  }

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

  .store-option + .store-option {
    border-top: 0;
    border-left: 1px solid hsl(var(--border));
  }

  .section-grid {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .section-grid h2 {
    font-size: 36px;
  }

  .install-list li,
  .highlight-item {
    padding-top: 28px;
    padding-bottom: 28px;
  }

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

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .download-primary-grid {
    grid-template-columns: minmax(0, 1fr) 216px;
  }

  .qr-panel {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .header-inner,
  .hero-grid,
  .section-grid,
  .footer-inner {
    padding-right: 32px;
    padding-left: 32px;
  }

  .header-inner {
    height: 68px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-name strong {
    font-size: 17px;
  }

  .brand-name small {
    font-size: 9px;
  }

  .desktop-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

  #download-content {
    padding-top: calc(68px + env(safe-area-inset-top));
  }

  .hero-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(480px, 1.18fr);
    gap: 64px;
    align-items: center;
    padding-top: 96px;
    padding-bottom: 96px;
  }

  .hero-copy h1 {
    font-size: 60px;
  }

  .trust-list {
    grid-template-columns: 1fr;
  }

  .download-primary {
    padding: 32px;
  }

  .section-grid {
    grid-template-columns: minmax(224px, 0.7fr) minmax(0, 1.3fr);
    gap: 64px;
  }

  .highlights-grid {
    grid-template-columns: minmax(256px, 0.82fr) minmax(0, 1.18fr);
  }

  .footer-inner {
    padding-top: 48px;
  }

  .footer-grid {
    grid-template-columns: 1.35fr 0.72fr 0.72fr 0.72fr 0.72fr 0.9fr;
    gap: 40px;
  }

  .footer-brand {
    grid-column: auto;
    gap: 20px;
  }

  .footer-bottom {
    padding-top: 24px;
    margin-top: 40px;
  }
}

@media (max-width: 389px) {
  .brand-name {
    display: none;
  }
}

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

  .brand-logo,
  .download-button,
  .toast {
    transition: none;
  }
}
