:root {
  color-scheme: light;
  --bg: #fff8f4;
  --bg-muted: #f6ece8;
  --surface: rgba(255, 255, 255, 0.92);
  --ink: #24181b;
  --ink-soft: #5c4b50;
  --line: rgba(36, 24, 27, 0.08);
  --accent: #9e4a56;
  --accent-deep: #74313a;
  --accent-soft: #f7dde2;
  --gold: #d97706;
  --shadow: 0 28px 70px rgba(116, 49, 58, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: inherit; }

.ambient {
  position: fixed;
  inset: auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  top: -80px;
  left: -60px;
  background: rgba(217, 119, 6, 0.18);
}

.ambient-b {
  right: -80px;
  bottom: 10%;
  background: rgba(158, 74, 86, 0.16);
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--gold));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-text strong { font-size: 1.05rem; }
.logo-text small,
.kicker,
.link-label,
.store-kicker {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a,
.footer-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
}

.nav a:hover,
.footer-nav a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
  padding: 36px 0 72px;
}

.hero h1,
.section-head h2,
.split h2,
.download-panel h2,
.invite-panel h2,
.page-shell h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  max-width: 11ch;
}

.kicker { margin: 0 0 12px; }

.intro,
.section-lead,
.card p,
.link-box p,
.invite-panel p,
.page-shell p {
  color: var(--ink-soft);
}

.intro {
  max-width: 52ch;
  margin: 18px 0 28px;
  font-size: 1.08rem;
}

.hero-actions,
.store-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn,
.store-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
}

.btn-primary,
.store-btn:not(.store-btn-disabled) {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
}

.hero-visual { display: flex; justify-content: center; }

.device {
  width: min(100%, 320px);
  padding: 14px;
  border-radius: 34px;
  background: linear-gradient(160deg, #2d2224, #171112);
  box-shadow: 0 30px 80px rgba(23, 17, 18, 0.28);
}

.device-bar {
  width: 34%;
  height: 8px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.device-body {
  display: grid;
  gap: 12px;
  padding: 18px 14px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff7f4 0%, #ffffff 100%);
}

.memory {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
}

.memory-accent {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(158, 74, 86, 0.14));
}

.memory h2,
.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.memory p,
.card p {
  margin: 0;
  font-size: 0.92rem;
}

.tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-soft {
  background: #f3ece8;
  color: var(--ink-soft);
}

.section { padding: 12px 0 72px; }

.section-muted {
  background: linear-gradient(180deg, transparent, var(--bg-muted) 16%, var(--bg-muted) 84%, transparent);
}

.section-head,
.split,
.download-panel,
.invite-panel,
.page-shell {
  max-width: 980px;
}

.section-head h2,
.split h2,
.download-panel h2 {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  margin-bottom: 12px;
}

.section-lead {
  max-width: 62ch;
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.card {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-num {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.link-examples {
  display: grid;
  gap: 16px;
}

.link-box {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.link-box code {
  display: block;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px dashed rgba(158, 74, 86, 0.24);
  font-size: 0.82rem;
  word-break: break-all;
}

.download-panel,
.invite-panel {
  padding: 34px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.download-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.store-btn {
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.store-btn strong { font-size: 1.05rem; }

.store-btn-disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.invite-banner { padding-top: 0; }

.invite-panel {
  text-align: center;
  background: linear-gradient(135deg, rgba(158, 74, 86, 0.1), rgba(217, 119, 6, 0.08));
}

.invite-panel p {
  max-width: 56ch;
  margin: 12px auto 0;
}

.footer {
  padding: 0 0 40px;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}

.footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.page-shell {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.page-shell main,
.page-shell .legal-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.page-shell h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 8px;
}

.page-shell h2 {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.page-shell a { color: var(--accent-deep); }

.page-shell ul { padding-left: 1.2rem; }

.page-shell .back {
  display: inline-flex;
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}

.fallback-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.fallback-card {
  width: min(100%, 420px);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.fallback-card h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.fallback-card p {
  margin: 0 0 20px;
  color: var(--ink-soft);
}

.fallback-card button,
.fallback-card .btn {
  width: 100%;
  border: 0;
  cursor: pointer;
}

@media (max-width: 960px) {
  .hero,
  .cards,
  .split,
  .download-panel {
    grid-template-columns: 1fr;
  }

  .hero-visual { order: -1; }
  .hero h1 { max-width: none; }
  .nav { display: none; }
}

@media (max-width: 640px) {
  .topbar,
  main,
  .footer,
  .page-shell {
    width: min(100% - 28px, 1120px);
  }

  .download-panel,
  .invite-panel,
  .page-shell .legal-card {
    padding: 24px 20px;
  }
}
