:root {
  /* Keepsafe brand purple (logo + CTA label) */
  --purple: #5e4394;
  --purple-muted: #9a8fc4;
  --magenta: #c11e63;
  --magenta-deep: #a81855;
  --cyan: #3ecfe0;
  --white: #ffffff;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.12);
  --font: "Montserrat", system-ui, sans-serif;
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--white);
  background: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 20px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.logo {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--purple);
  text-transform: lowercase;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 8px;
}

.menu-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--purple);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top));
  right: 16px;
  left: 16px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 101;
}

.site-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav__link {
  padding: 12px 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--purple-muted);
  border-radius: 8px;
}

.site-nav__link--active {
  color: var(--purple);
  font-weight: 700;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99;
}

.nav-backdrop[hidden] {
  display: none;
}

/* Section pagination (mobile: horizontal bottom) */
.section-dots {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-dots__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: 2px solid transparent;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.section-dots__dot--active {
  background: transparent;
  border-color: var(--white);
  transform: scale(1.15);
}

.slide--brand ~ .section-dots .section-dots__dot--active,
body[data-active-slide="0"] .section-dots__dot[data-target="hero-brand"] {
  border-color: var(--purple);
  background: var(--purple);
}

body[data-active-slide="1"] .section-dots__dot[data-target="hero-vault"] {
  border-color: var(--white);
  background: transparent;
}

body[data-active-slide="0"] .section-dots__dot[data-target="hero-brand"] {
  border-color: var(--purple);
  background: var(--purple);
}

body[data-active-slide="0"] .section-dots__dot[data-target="hero-vault"] {
  background: rgba(255, 255, 255, 0.5);
  border-color: transparent;
}

body[data-active-slide="1"] .section-dots__dot[data-target="hero-vault"] {
  border-color: var(--white);
  background: transparent;
}

body[data-active-slide="1"] .section-dots__dot[data-target="hero-brand"] {
  background: rgba(255, 255, 255, 0.45);
  border-color: transparent;
}

/* Full-screen slides */
.snap-main {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

.slide {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
}

.slide__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.slide__bg--brand {
  background-color: #6db33f;
  background-image: url("https://images.unsplash.com/photo-1558618666-fcd25c85cd64?auto=format&fit=crop&w=1200&q=80");
  background-size: cover;
  background-position: center;
}

.slide__bg--brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(45, 120, 50, 0.75) 0%,
    rgba(35, 100, 45, 0.85) 45%,
    rgba(20, 60, 30, 0.9) 100%
  );
}

.slide__bg--vault {
  background: linear-gradient(160deg, var(--magenta) 0%, var(--magenta-deep) 100%);
}

.slide__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + var(--safe-top) + 16px) 20px calc(24px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.slide__inner--vault {
  padding-bottom: calc(48px + var(--safe-bottom));
}

/* Brand hero — mobile stack */
.brand-hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.brand-hero__copy {
  text-align: center;
}

.brand-hero__title {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 9vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.brand-hero__subtitle {
  margin: 0 auto 28px;
  max-width: 320px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.95;
}

.brand-hero__visual {
  display: flex;
  justify-content: center;
  margin: 0 -8px;
}

.brand-hero__portrait {
  width: min(100%, 340px);
  height: auto;
  max-height: 42vh;
  object-fit: cover;
  object-position: top center;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Store buttons */
.store-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--white);
  color: var(--purple);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.store-btn:active {
  transform: scale(0.98);
}

.store-btn__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--purple);
}

/* Vault section */
.vault-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.vault-hero__brand {
  text-align: center;
  width: 100%;
}

.app-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-shrink: 0;
}

.app-icon__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vault-hero__title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
}

.vault-hero__subtitle {
  margin: 0 0 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.95;
}

.learn-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.learn-more:hover {
  opacity: 1;
}

/* Phone mockup */
.phone-mockup {
  width: 100%;
  max-width: min(100%, 292px);
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
}

.phone-mockup__frame {
  position: relative;
  background: #f5f5f5;
  border-radius: 32px;
  padding: 8px 12px 12px;
  border: 3px solid var(--white);
  color: #333;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px 8px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #111;
}

.phone-status__time {
  font-weight: 700;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px 4px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.app-header__icon {
  font-size: 1rem;
  color: #666;
}

.app-header__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #222;
}

.app-header__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.875rem;
}

.app-header__cloud {
  color: var(--cyan);
  font-weight: 700;
}

.app-tabs {
  display: flex;
  gap: 24px;
  padding: 12px 8px 0;
  border-bottom: 1px solid #e8e8e8;
}

.app-tabs__tab {
  padding: 0 0 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.app-tabs__tab--active {
  color: #333;
  border-bottom-color: var(--cyan);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 2px 48px;
  flex: 1;
}

.album-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.album-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 3px;
  background: #e8e8e8;
}

.album-card__thumb {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.album-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  color: #444;
}

.album-card__meta > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-card__menu {
  flex-shrink: 0;
  color: #aaa;
  letter-spacing: 1px;
}

.app-fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(62, 207, 224, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.scroll-hint {
  position: absolute;
  bottom: calc(12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.7;
}

.scroll-hint__mouse {
  display: block;
  width: 22px;
  height: 34px;
  border: 2px solid var(--white);
  border-radius: 11px;
  position: relative;
}

.scroll-hint__mouse::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: var(--white);
  border-radius: 2px;
  animation: scroll-wheel 1.5s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%,
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 0.3;
    transform: translateX(-50%) translateY(6px);
  }
}

/* Header theme on vault slide */
body[data-active-slide="1"] .site-header {
  background: linear-gradient(180deg, rgba(193, 30, 99, 0.4) 0%, rgba(193, 30, 99, 0) 100%);
}

body[data-active-slide="1"] .logo {
  color: var(--white);
}

body[data-active-slide="1"] .menu-toggle__bar {
  background: var(--white);
}

/* Wider phones / small tablets — still mobile-first */
@media (min-width: 400px) {
  .store-buttons {
    max-width: 100%;
  }

  .brand-hero__portrait {
    max-height: 46vh;
  }
}

@media (min-width: 768px) {
  .snap-main {
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  body {
    display: flex;
    justify-content: center;
    background: #111;
  }

  .site-header {
    max-width: 430px;
    left: 50%;
    transform: translateX(-50%);
  }

  .section-dots {
    right: calc(50% - 215px + 8px);
  }
}
