/* ── Tokens ── */
:root {
  --cream:      #f5f0e8;
  --sand:       #e8dcc8;
  --stone:      #c9b99a;
  --terra:      #c07a5a;
  --terra-soft: #d4957a;
  --sage:       #8a9e85;
  --bark:       #5c4a35;
  --ink:        #2e2318;
  --mist:       #f9f6f1;
  --shadow:     rgba(92, 74, 53, 0.10);
  --shadow-md:  rgba(92, 74, 53, 0.16);

  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  'Helvetica Neue', Helvetica, Arial, sans-serif;

  --radius-lg: 24px;
  --radius-xl: 36px;
  --ease:      cubic-bezier(0.34, 1.20, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Screens ── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 24px) 24px env(safe-area-inset-bottom, 24px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.screen.exit {
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Home Screen ── */
.home-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: 48px 0 32px;
}

.brand { text-align: center; }
.brand-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 12px;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 13vw, 72px);
  font-weight: normal;
  line-height: 1.05;
  color: var(--bark);
  margin-bottom: 16px;
}
.brand-sub {
  font-size: 15px;
  color: var(--stone);
  letter-spacing: 0.02em;
}

.align-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.btn-align {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: var(--terra);
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 8px 32px var(--shadow-md), 0 2px 8px var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-align:hover { background: var(--terra-soft); transform: scale(1.04); }
.btn-align:active { transform: scale(0.96); box-shadow: 0 4px 16px var(--shadow); }

.btn-icon { font-size: 32px; line-height: 1; }
.btn-label {
  font-family: var(--font-serif);
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0.01em;
}
.btn-hint {
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.04em;
}

.home-footer {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ── Result Screen ── */
.result-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 48px 0 40px;
}

.result-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 20px;
}

.element-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  background: var(--sage);
  border-radius: 100px;
  padding: 5px 16px;
  margin-bottom: 20px;
  transition: opacity 0.3s ease;
}
.element-badge.hidden { display: none; }

/* Element color variants */
.element-badge.fire  { background: #c07a5a; }
.element-badge.water { background: #7a9eb0; }
.element-badge.earth { background: #8a9e85; }
.element-badge.air   { background: #a8a090; }

.result-type {
  font-family: var(--font-serif);
  font-size: clamp(26px, 7vw, 36px);
  font-weight: normal;
  color: var(--bark);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 16px;
  padding: 0 8px;
}

.result-message {
  font-size: 16px;
  line-height: 1.7;
  color: var(--bark);
  text-align: center;
  opacity: 0.75;
  padding: 0 8px;
  margin-bottom: 32px;
}

.result-divider {
  width: 40px;
  height: 1px;
  background: var(--sand);
  margin-bottom: 32px;
}

.result-block {
  width: 100%;
  background: var(--mist);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px var(--shadow);
}
.result-block-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
}
.result-block-text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
  color: var(--bark);
}

.btn-again {
  margin-top: 32px;
  background: transparent;
  border: 1.5px solid var(--stone);
  color: var(--bark);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 13px 36px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 40px;
}
.btn-again:hover { background: var(--sand); border-color: var(--terra); }
.btn-again:active { transform: scale(0.97); }

.pairing-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}
.pairing-images {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.pairing-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow-md);
  opacity: 0.92;
}

.result-footer {
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--stone);
  text-align: center;
  font-style: italic;
}
.result-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pairing-painting-text {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--stone);
  font-style: italic;
  text-align: center;
}
.pairing-browse {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.pairing-browse:hover { border-bottom-color: var(--stone); }
.pairing-product-text {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--terra);
  text-decoration: none;
  text-align: center;
  font-style: italic;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.pairing-product-text:hover { border-bottom-color: var(--terra); }
.result-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.result-footer a:hover {
  border-bottom-color: var(--stone);
}

/* ── Entry animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-inner > * {
  animation: fadeUp 0.5s ease both;
}
.result-inner > *:nth-child(1) { animation-delay: 0.05s; }
.result-inner > *:nth-child(2) { animation-delay: 0.12s; }
.result-inner > *:nth-child(3) { animation-delay: 0.18s; }
.result-inner > *:nth-child(4) { animation-delay: 0.24s; }
.result-inner > *:nth-child(5) { animation-delay: 0.30s; }
.result-inner > *:nth-child(6) { animation-delay: 0.36s; }
.result-inner > *:nth-child(7) { animation-delay: 0.42s; }
.result-inner > *:nth-child(8) { animation-delay: 0.48s; }
.result-inner > *:nth-child(9) { animation-delay: 0.54s; }

/* ── Logo ── */
.brand-logo {
  width: 240px;
  max-width: 70vw;
  height: auto;
  margin-bottom: 8px;
  opacity: 0.88;
}
.brand-logos {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.brand-logo-dual {
  height: 56px;
  width: auto;
  max-width: 42vw;
  opacity: 0.88;
}
.brand-logo-dual:first-child {
  justify-self: end;
}
.brand-logo-dual:last-child {
  justify-self: start;
  height: 112px;
}
.brand-x {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--stone);
  opacity: 0.6;
  line-height: 1;
  text-align: center;
}
.brand-eyebrow.hidden { display: none; }

/* ── Home bottom row ── */
.home-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.install-trigger {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--stone);
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}
.install-trigger:hover { color: var(--terra); }

/* ── iOS Install Banner ── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border-top: 1px solid var(--sand);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 24px var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}
.install-banner.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.install-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--sand);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 12px;
  color: var(--bark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--bark);
  margin-bottom: 14px;
  padding-right: 32px;
}
.install-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  counter-reset: steps;
}
.install-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.install-steps li::before {
  content: counter(steps);
  min-width: 22px;
  height: 22px;
  background: var(--terra);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  flex-shrink: 0;
}
.install-icon {
  display: inline-block;
  background: #007aff;
  color: white;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
  vertical-align: middle;
  margin: 0 2px;
}

.share-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--gold);
}
.share-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0.7;
  margin: 0;
}
.share-qr {
  width: 120px;
  height: 120px;
  border-radius: 8px;
}

.brand-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-bottom: 8px;
}
.brand-links a {
  font-size: 16px;
  letter-spacing: 0.10em;
  color: var(--stone);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.brand-links a:hover { opacity: 1; }
.brand-links-dot {
  font-size: 16px;
  color: var(--stone);
  opacity: 0.4;
}

/* ── Home CTA link buttons ── */
.home-cta-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
}
.home-cta-btn {
  display: block;
  text-align: center;
  padding: 16px 24px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.home-cta-btn:active { transform: scale(0.97); }
.home-cta-btn--gallery {
  background: var(--bark);
  color: var(--cream);
  box-shadow: 0 4px 18px var(--shadow-md);
}
.home-cta-btn--gallery:hover { opacity: 0.88; }
.home-cta-btn--namaste {
  background: var(--terra);
  color: var(--cream);
  box-shadow: 0 4px 18px var(--shadow-md);
}
.home-cta-btn--namaste:hover { opacity: 0.88; }

/* ── Desktop centering ── */
@media (min-width: 600px) {
  .home-inner, .result-inner { padding-top: 64px; padding-bottom: 48px; }
  .install-banner { max-width: 480px; left: 50%; right: auto; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
  .install-banner.hidden { transform: translateX(-50%) translateY(100%); }
}
