:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5e6b65;
  --paper: #f7f8f6;
  --surface: #ffffff;
  --line: #d9dedb;
  --accent: #e4b63d;
  --accent-ink: #3a2c06;
  --teal: #137a72;
  --danger-surface: #fff7dd;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  line-height: 1.6;
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 246, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand img {
  border-radius: 7px;
}

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

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(720px, calc(100vh - 64px));
  place-items: center;
  overflow: hidden;
  padding: 72px 24px 100px;
  background: #17211d;
  color: white;
  text-align: center;
}

.hero::before {
  position: absolute;
  width: min(66vw, 720px);
  aspect-ratio: 1;
  border-radius: 18%;
  background: url("/backpacker-ledger/assets/app-icon.png") center / contain no-repeat;
  content: "";
  opacity: 0.13;
  transform: rotate(-8deg);
}

.hero-content {
  position: relative;
  max-width: 780px;
}

.hero h1 {
  margin: 0;
  font-size: 6rem;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 0.96;
}

.hero p {
  max-width: 680px;
  margin: 28px auto 0;
  color: #dce5e0;
  font-size: 1.25rem;
}

.hero-actions,
.store-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 760;
  text-decoration: none;
}

.button.secondary {
  border-color: #78847e;
  background: transparent;
  color: white;
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1120px;
  gap: 42px;
  margin: 0 auto;
  padding: 70px 24px 82px;
}

.feature-band h2 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.feature-band p {
  margin: 0;
  color: var(--muted);
}

.legal-shell,
.invite-shell {
  width: min(100% - 32px, 840px);
  margin: 0 auto;
  padding: 42px 0 76px;
}

.legal-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

select {
  min-height: 42px;
  padding: 7px 34px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.legal-document,
.invite-panel {
  padding: clamp(24px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.legal-document h1,
.invite-panel h1 {
  margin: 0;
  font-size: 3.2rem;
  letter-spacing: 0;
  line-height: 1.08;
}

.updated {
  margin: 10px 0 28px;
  color: var(--muted);
}

.legal-notice {
  margin-bottom: 34px;
  padding: 16px 18px;
  border-inline-start: 4px solid var(--accent);
  background: var(--danger-surface);
  color: #493a11;
}

.legal-document section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.legal-document h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.legal-document p {
  margin: 0;
}

.invite-panel {
  text-align: center;
}

.invite-code {
  display: none;
  margin: 28px auto 0;
  padding: 14px;
  border: 1px dashed var(--teal);
  border-radius: 6px;
  background: #eef8f6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.invite-data-note {
  margin: 30px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
}

footer {
  display: flex;
  max-width: 1120px;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto;
  padding: 28px 24px 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

[dir="rtl"] .legal-toolbar {
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  nav {
    gap: 14px;
  }

  .hero {
    min-height: 610px;
    padding-top: 60px;
  }

  .hero h1 {
    font-size: 3.25rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .legal-document h1,
  .invite-panel h1 {
    font-size: 2.1rem;
  }

  .feature-band {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .legal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  footer {
    flex-direction: column;
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #edf3ef;
    --muted: #abb8b1;
    --paper: #111714;
    --surface: #18201c;
    --line: #354039;
    --danger-surface: #362f19;
  }

  .site-header {
    background: rgba(17, 23, 20, 0.96);
  }

  .legal-notice {
    color: #f1dda0;
  }

  .invite-code {
    background: #172c28;
  }
}
