/* Base */
html,
body {
  height: 100%;
}

:root {
  --brand-bg: #f9f9f9;
  --brand-surface: #e9eaea;
  --brand-text: #1a1a1c;
  --brand-muted: #575757;
  --brand-accent: #1a1a1c;
  --brand-border: rgba(87, 87, 87, 0.26);
  --switch-light-edge: rgba(255, 255, 255, 0.92);
  --switch-dark-edge: rgba(26, 26, 28, 0.22);
  --feature-phone-width: 300px;
  --promo-phone-width: 280px;
  --promo-logo-width: 140px;
  --promo-gap: 1rem;
  --content-max-width: 1200px;
  --feature-block-gap: 2rem;
  --type-h1: clamp(2rem, 5vw, 4rem);
  --type-h2: clamp(1.75rem, 3.2vw, 2.8rem);
  --type-h3: clamp(1.5rem, 2.4vw, 2.2rem);
  --type-h4: 1.25rem;
  --type-h5: 1.1rem;
  --type-h6: 1rem;
  --type-body: 1rem;
  --type-body-line: 1.5;
  --type-display-line: 1.02;
  --type-heading-line: 1.1;
  --type-h1-line: 1.16;
  --type-h2-line: 1.14;
  --type-subheading-line: 1.45;
  --button-bg: #ffffff;
}

body {
  background-color: var(--brand-bg);
  color: var(--brand-text);
  font-family: "Noto Sans", sans-serif;
  font-size: var(--type-body);
  line-height: var(--type-body-line);
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Raleway", "Noto Sans", sans-serif;
}

h1 {
  font-size: var(--type-h1);
  line-height: var(--type-h1-line);
}

h2 {
  font-size: var(--type-h2);
  line-height: var(--type-h2-line);
}

h3 {
  font-size: var(--type-h3);
  line-height: var(--type-heading-line);
}

h4 {
  font-size: var(--type-h4);
  line-height: 1.2;
}

h5 {
  font-size: var(--type-h5);
  line-height: 1.25;
}

h6 {
  font-size: var(--type-h6);
  line-height: 1.3;
}

img[data-theme-image] {
  opacity: 0;
}

:root[data-theme-images-ready="true"] img[data-theme-image] {
  opacity: 1;
  transition: opacity 120ms ease;
}

/* Layout */
.page-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-shell {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.content-wrap {
  width: min(100% - 2.5rem, var(--content-max-width));
  margin-inline: auto;
}

@media (min-width: 900px) {
  .content-wrap {
    width: min(100% - 4rem, var(--content-max-width));
  }
}

html.dark,
body.dark,
:root[data-theme="dark"] {
  --brand-bg: #1b2023;
  --brand-surface: #21272a;
  --brand-text: #f9f9f9;
  --brand-muted: #c1c1c1;
  --brand-accent: #f9f9f9;
  --brand-border: rgba(193, 193, 193, 0.28);
  --switch-light-edge: rgba(249, 249, 249, 0.22);
  --switch-dark-edge: rgba(0, 0, 0, 0.45);
  --button-bg: var(--brand-surface);
}

/* Background */
#page-glow {
  background: radial-gradient(circle at 20% 10%, rgba(26, 26, 28, 0.08), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(87, 87, 87, 0.1), transparent 38%);
}

html.dark #page-glow,
body.dark #page-glow,
:root[data-theme="dark"] #page-glow {
  background: radial-gradient(circle at 20% 10%, rgba(249, 249, 249, 0.08), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(193, 193, 193, 0.08), transparent 38%);
}

/* Header */
.app-topbar {
  position: relative;
  z-index: 40;
  box-shadow: none;
  transition: box-shadow 180ms ease;
}

.brand-link {
  color: var(--brand-text);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  color: var(--brand-text);
  background: var(--brand-bg);
  backdrop-filter: blur(8px);
  box-shadow: inset 1px 0 0 var(--switch-light-edge), inset 0 -1px 0 var(--switch-light-edge),
    inset -1px 0 0 var(--switch-dark-edge), inset 0 1px 0 var(--switch-dark-edge);
  transition: opacity 180ms ease;
}

.dark .icon-button {
  background-color: rgba(33, 39, 42, 0.32);
}

.icon-button:hover {
  opacity: 0.9;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding-inline: 0.7rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: opacity 180ms ease;
}

.menu-link:hover {
  opacity: 0.8;
}

.app-topbar.is-scrolled .menu-link {
  background: var(--brand-surface);
  border-color: transparent;
  backdrop-filter: blur(4px);
}

.menu-link-mobile {
  display: block;
  height: auto;
  padding-block: 0.25rem;
}

/* Shared Buttons */
.app-store-button,
.app-promo-button,
.email-reveal-button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background-color: var(--button-bg);
  background-image: none;
  color: var(--brand-text);
  font-family: "Noto Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 180ms ease;
}

.app-store-button:hover,
.app-promo-button:hover,
.email-reveal-button:hover {
  opacity: 0.82;
}

.app-store-button:disabled {
  cursor: default;
}

.app-topbar.is-scrolled {
  box-shadow: 0 6px 16px rgba(26, 26, 28, 0.08);
}

.dark .app-topbar.is-scrolled {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

@media (min-width: 640px) {
  .app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  .site-shell {
    padding-top: 78px;
  }
}

/* Mobile Menu */
.mobile-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 1.25rem;
  z-index: 60;
}

.mobile-menu-panel {
  position: relative;
  width: max-content;
  min-width: 13.5rem;
  max-width: calc(100vw - 2.5rem);
  overflow: hidden;
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(26, 26, 28, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform, opacity;
}

.mobile-menu.is-open .mobile-menu-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-nav {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
}

.mobile-menu-link {
  width: 100%;
  min-height: 2.6rem;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  color: var(--brand-text);
  border: 1px solid transparent;
}

.mobile-menu-bottom {
  padding: 0.75rem;
  border-top: 1px solid var(--brand-border);
}

.mobile-menu-theme-row {
  width: 100%;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.mobile-menu-theme-toggle {
  width: 88px;
  flex-shrink: 0;
}

/* Footer */
.app-footer {
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
  background: rgba(26, 26, 28, 0.08);
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

.dark .app-footer {
  background: rgba(0, 0, 0, 0.26);
}

.app-footer-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.5rem;
}

.app-footer-link {
  color: var(--brand-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.app-footer-link:hover {
  color: var(--brand-text);
}

.app-footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 640px) {
  .app-footer-inner {
    grid-template-columns: 1fr;
  }

  .app-footer-links {
    justify-content: flex-start;
  }
}
/* Icons */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined", sans-serif;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 22px;
  line-height: 1;
}

.theme-icon-sun,
.theme-icon-moon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 19px;
  color: currentColor;
  transition: opacity 180ms ease;
}

.theme-icon-sun {
  opacity: 1;
}

.theme-icon-moon {
  opacity: 0.55;
}

.dark .theme-icon-sun {
  opacity: 0.55;
}

.dark .theme-icon-moon {
  opacity: 1;
}

/* Theme Toggle */
.theme-switch {
  position: relative;
  box-shadow: inset 1px 0 0 var(--switch-light-edge), inset 0 -1px 0 var(--switch-light-edge),
    inset -1px 0 0 var(--switch-dark-edge), inset 0 1px 0 var(--switch-dark-edge);
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 88px;
  height: 40px;
  padding: 0.25rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--brand-text);
  background: var(--brand-bg);
  backdrop-filter: blur(8px);
}

.dark .theme-switch {
  background-color: rgba(33, 39, 42, 0.32);
}

.theme-switch-thumb {
  transition: transform 220ms ease;
  background: #f9f9f9;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.85),
    inset -1px 0 0 rgba(26, 26, 28, 0.2), inset 0 1px 0 rgba(26, 26, 28, 0.2);
}

.theme-toggle-thumb {
  left: 0.5rem;
  top: 0.25rem;
  width: 2rem;
  height: 2rem;
}

.dark .theme-switch-thumb {
  transform: translateX(40px);
  background: var(--brand-surface);
  box-shadow: inset 1px 0 0 rgba(249, 249, 249, 0.22),
    inset 0 -1px 0 rgba(249, 249, 249, 0.22), inset -1px 0 0 rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme-images-ready="true"] img[data-theme-image] {
    transition: none;
  }

  .mobile-menu-panel,
  .theme-switch-thumb {
    transition: none;
  }
}
