/* =========================================================================
   Loopmates — landing page styles
   A warm, tactile "toy diorama" identity carried over from the game.
   Palette values mirror the in-app LoopmatesTheme exactly.
   ========================================================================= */

:root {
  --ember: #f0594a;
  --ember-deep: #c73d33;
  --ember-shadow: #9c3333;
  --wisp: #2ba6a6;
  --wisp-deep: #177a80;
  --wisp-shadow: #176366;
  --ink: #1f3338;
  --ink-soft: #47635f;
  --cream: #fff5d6;
  --paper: #fffcf0;
  --butter: #fad675;
  --butter-deep: #c07f2b;
  --lavender: #7363ad;
  --lavender-deep: #4a3f6b;
  --moss: #85ad52;
  --moss-dark: #40663f;

  --shell-max: 1140px;
  --radius-lg: 34px;
  --radius-md: 22px;
  --radius-sm: 16px;

  --font-display: "Fredoka", "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --font-body: "Nunito", -apple-system, system-ui, sans-serif;

  --ease-toy: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* A soft, sunlit diorama backdrop with drifting spirals. */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 15% 0%, #fef0c9 0%, transparent 55%),
    radial-gradient(120% 90% at 90% 10%, #d6efe6 0%, transparent 50%),
    linear-gradient(170deg, #fff3cf 0%, #e9f3df 55%, #dcefe8 100%);
  pointer-events: none;
}
.world-bg::before,
.world-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(31, 51, 56, 0.05);
  border-right-color: transparent;
  border-bottom-color: transparent;
  pointer-events: none;
}
.world-bg::before { width: clamp(320px, 50vw, 620px); height: clamp(320px, 50vw, 620px); top: -160px; right: -140px; transform: rotate(20deg); }
.world-bg::after { width: clamp(260px, 40vw, 460px); height: clamp(260px, 40vw, 460px); bottom: -120px; left: -120px; transform: rotate(-30deg); }

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------------------------------------------------- Typography */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
p {
  overflow-wrap: break-word;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 249, 224, 0.85);
  border-bottom: 2px solid rgba(31, 51, 56, 0.06);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.nav .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand .brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(31, 51, 56, 0.15);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.78;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { opacity: 1; }
.nav-links .nav-cta { opacity: 1; }

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}
.language-switcher select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid rgba(31, 51, 56, 0.16);
  border-radius: 12px;
  padding: 6px 26px 6px 10px;
  color: var(--ink);
  background: rgba(255, 252, 240, 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2347635f' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.language-switcher select:focus-visible {
  border-color: var(--wisp-deep);
  box-shadow: 0 0 0 2px rgba(43, 166, 166, 0.2);
}

/* ------------------------------------------------------- Toy button */
.toy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  padding: 15px 26px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--ember) 0%, var(--ember-deep) 100%);
  box-shadow:
    0 6px 0 var(--ember-shadow),
    0 14px 22px rgba(156, 51, 51, 0.32);
  cursor: pointer;
  transition: transform 0.12s var(--ease-toy), box-shadow 0.12s;
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  text-align: center;
}
.toy-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ember-shadow), 0 6px 12px rgba(156, 51, 51, 0.3);
}
.toy-btn.teal {
  background: linear-gradient(180deg, var(--wisp) 0%, var(--wisp-deep) 100%);
  box-shadow: 0 6px 0 var(--wisp-shadow), 0 14px 22px rgba(23, 99, 102, 0.3);
}
.toy-btn.teal:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--wisp-shadow), 0 6px 12px rgba(23, 99, 102, 0.3);
}
.toy-btn.ghost {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(31, 51, 56, 0.14), 0 12px 20px rgba(31, 51, 56, 0.1);
  border-top: 2px solid #fff;
}
.toy-btn.ghost:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(31, 51, 56, 0.14);
}
.toy-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ------------------------------------------------------------- Hero */
.hero {
  padding: clamp(36px, 6vw, 70px) 0 clamp(44px, 8vw, 90px);
}
.hero .shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: 14px; }
.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 4.3rem);
  margin-bottom: 20px;
}
.hero h1 .ember-word { color: var(--ember-deep); }
.hero h1 .wisp-word { color: var(--wisp-deep); }
.hero-lede {
  font-size: clamp(1.08rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 32ch;
  margin-bottom: 28px;
  font-weight: 600;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.hero-note {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.hero-note .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* --------------------------------------------------------------- Diorama */
.diorama {
  position: relative;
  background: linear-gradient(165deg, #16414a 0%, #0f3038 100%);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 34px) clamp(18px, 3.5vw, 30px) clamp(28px, 5vw, 40px);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    0 30px 60px rgba(15, 48, 56, 0.35);
  border: 3px solid var(--paper);
  overflow: hidden;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.diorama::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(250, 214, 117, 0.28);
  border-radius: 26px;
  pointer-events: none;
}
.diorama-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: clamp(210px, 38vw, 300px);
  width: 100%;
}
.diorama .mate {
  width: clamp(68px, 16vw, 116px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 14px rgba(0,0,0,0.35));
}
.diorama .mate.ember { animation: bob 3.4s ease-in-out infinite; }
.diorama .mate.wisp { animation: bob 3.4s ease-in-out infinite 0.7s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Chunky block row (the "world" that turns). */
.block-row {
  display: flex;
  gap: clamp(4px, 1.2vw, 8px);
  align-items: flex-end;
  position: relative;
  flex-shrink: 0;
}
.block {
  width: clamp(34px, 8vw, 52px);
  height: clamp(34px, 8vw, 52px);
  border-radius: clamp(9px, 2.2vw, 14px);
  background: linear-gradient(160deg, #96c15a, #78a343);
  box-shadow: 0 clamp(3px, 0.9vw, 5px) 0 var(--moss-dark), inset 0 0 0 2px rgba(255,255,255,0.14);
  position: relative;
}
.block::before {
  content: "";
  position: absolute;
  inset: 26% 26%;
  border: 2.5px solid rgba(31, 51, 56, 0.16);
  border-radius: 50%;
  border-right-color: transparent;
  transform: rotate(20deg);
}
.rotate-chip {
  position: absolute;
  left: 50%;
  bottom: clamp(-14px, -3vw, -18px);
  transform: translateX(-50%);
  width: clamp(38px, 9vw, 54px);
  height: clamp(38px, 9vw, 54px);
  background: var(--cream);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
  border: 2px solid #fff;
  z-index: 2;
}
.rotate-chip svg {
  width: clamp(20px, 5vw, 30px);
  height: clamp(20px, 5vw, 30px);
  color: var(--ember-deep);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- Sections */
section { padding: clamp(48px, 7vw, 80px) 0; }
.section-head { text-align: center; max-width: 44ch; margin: 0 auto clamp(32px, 5vw, 52px); }
.section-head h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.15rem); font-weight: 600; }

/* Toy card shared look. */
.card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 30px);
  border: 2px solid #fff;
  box-shadow: 0 18px 34px rgba(31, 51, 56, 0.1);
}

/* How it plays — three beats */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { text-align: center; }
.step .tile {
  width: clamp(68px, 10vw, 84px);
  height: clamp(68px, 10vw, 84px);
  margin: 0 auto 18px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  position: relative;
}
.step .tile.a { background: linear-gradient(160deg, var(--ember), var(--ember-deep)); box-shadow: 0 7px 0 var(--ember-shadow); }
.step .tile.b { background: linear-gradient(160deg, var(--butter), var(--butter-deep)); box-shadow: 0 7px 0 #96631f; }
.step .tile.c { background: linear-gradient(160deg, var(--wisp), var(--wisp-deep)); box-shadow: 0 7px 0 var(--wisp-shadow); }
.step .tile svg { width: clamp(32px, 5vw, 40px); height: clamp(32px, 5vw, 40px); color: #fff; }
.step .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
}
.step h3 { font-size: clamp(1.2rem, 2.5vw, 1.4rem); margin: 6px 0 10px; }
.step p { color: var(--ink-soft); font-weight: 600; font-size: 0.96rem; }

/* Features grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { display: flex; flex-direction: column; gap: 12px; }
.feature .pip {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(31,51,56,0.06);
  flex-shrink: 0;
}
.feature .pip svg { width: 26px; height: 26px; }
.feature h3 { font-size: 1.25rem; }
.feature p { color: var(--ink-soft); font-weight: 600; font-size: 0.98rem; }

/* Trust strip */
.trust { padding: clamp(48px, 6vw, 72px) 0; }
.trust .card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: center;
  background: linear-gradient(165deg, #1c454d, #113038);
  border: 3px solid var(--paper);
}
.trust .promise h3 { color: var(--butter); font-size: 1.3rem; margin-bottom: 6px; }
.trust .promise p { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.95rem; }
.trust .promise svg { width: 34px; height: 34px; color: var(--butter); margin-bottom: 12px; }

/* --------------------------------------------------------------- FAQ */
.faq { padding: clamp(50px, 7vw, 86px) 0 30px; }
.faq-list { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; }
.faq-list details { padding: clamp(16px, 3vw, 22px) clamp(18px, 3.5vw, 26px); background: rgba(255, 252, 240, 0.88); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.18rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--wisp-deep);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 700;
  margin-left: 12px;
  flex-shrink: 0;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 70ch; margin-top: 12px; color: var(--ink-soft); font-size: 0.96rem; line-height: 1.55; }

/* Final CTA */
.final-cta { text-align: center; }
.final-cta .card {
  background: linear-gradient(160deg, #fff, var(--cream));
  padding: clamp(38px, 6vw, 60px) clamp(20px, 4vw, 40px);
  position: relative;
  overflow: hidden;
}
.final-cta .mates-huddle { display: flex; justify-content: center; margin-bottom: 20px; }
.final-cta .mates-huddle svg { width: clamp(68px, 14vw, 90px); height: auto; }
.final-cta h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); margin-bottom: 12px; }
.final-cta p { color: var(--ink-soft); font-size: clamp(1.05rem, 2.2vw, 1.18rem); font-weight: 600; margin-bottom: 26px; }
.final-cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Footer */
footer {
  padding: clamp(40px, 6vw, 56px) 0 40px;
  border-top: 2px solid rgba(31,51,56,0.08);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; align-items: flex-start; }
.footer-brand { max-width: 34ch; }
.footer-brand p { color: var(--ink-soft); font-weight: 600; margin-top: 12px; font-size: 0.95rem; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--ink); text-decoration: none; font-weight: 700; opacity: 0.8; margin-bottom: 9px; font-size: 0.95rem; }
.footer-col a:hover { opacity: 1; color: var(--ember-deep); }
.footer-legal { margin-top: 40px; text-align: center; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }

/* ------------------------------------------------- Article (privacy) */
.article { padding: clamp(36px, 6vw, 60px) 0 clamp(50px, 8vw, 90px); }
.article .shell { max-width: 760px; }
.article .card { padding: clamp(24px, 5vw, 46px) clamp(20px, 5vw, 48px); }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.article .updated { color: var(--ink-soft); font-weight: 700; margin-bottom: 28px; font-size: 0.92rem; }
.article h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin: 30px 0 12px; color: var(--ink); }
.article p, .article li { color: var(--ink-soft); font-weight: 500; margin-bottom: 12px; font-size: 0.98rem; }
.article strong { color: var(--ink); }
.article ul { padding-left: 22px; margin-bottom: 12px; }
.article li { margin-bottom: 8px; }
.article a { color: var(--wisp-deep); font-weight: 700; }
.article .callout {
  background: var(--cream);
  border-left: 5px solid var(--moss);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

/* Staggered entrance */
.reveal { opacity: 0; transform: translateY(20px); animation: rise 0.7s var(--ease-toy) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; } .d4 { animation-delay: 0.35s; }

/* ------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .hero .shell { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { text-align: center; max-width: 600px; margin: 0 auto; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-note { justify-content: center; }
  .steps { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .trust .card { grid-template-columns: 1fr; gap: 28px; }
  .nav-links a:not(.nav-cta):not(.nav-home) { display: none; }
  .language-switcher span { display: none; }
  .language-switcher select {
    padding: 6px 24px 6px 8px;
    font-size: 0.82rem;
    border-radius: 10px;
  }
}

@media (max-width: 600px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .shell {
    padding: 0 16px;
  }
  .nav .shell {
    height: 62px;
  }
  .brand {
    font-size: 1.15rem;
    gap: 7px;
  }
  .brand .brand-badge {
    width: 30px;
    height: 30px;
  }
  .nav-links {
    gap: 8px;
  }
  .nav-links .nav-cta,
  .nav-links .nav-home {
    padding: 7px 13px !important;
    font-size: 0.84rem !important;
    border-radius: 14px;
    gap: 6px;
    box-shadow: 0 4px 0 var(--wisp-shadow), 0 8px 14px rgba(23, 99, 102, 0.22);
  }
  .nav-links .nav-cta svg,
  .nav-links .nav-home svg {
    width: 16px;
    height: 16px;
  }
  .language-switcher select {
    padding: 6px 20px 6px 8px;
    font-size: 0.8rem;
    border-radius: 10px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 330px;
    margin: 0 auto;
    gap: 12px;
  }
  .hero-actions .toy-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }
  .hero-note {
    font-size: 0.84rem;
    margin-top: 18px;
    gap: 6px;
    justify-content: center;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .features {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .feature {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .trust .card {
    padding: 28px 18px;
    gap: 24px;
  }

  .final-cta-actions {
    flex-direction: column;
    width: 100%;
    max-width: 330px;
    margin: 20px auto 0;
    gap: 12px;
  }
  .final-cta-actions .toy-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .footer-grid {
    flex-direction: column;
    gap: 28px;
  }
  .footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
  }
  .footer-col h4 {
    margin-bottom: 10px;
    font-size: 0.8rem;
  }
  .footer-col a {
    font-size: 0.92rem;
    margin-bottom: 7px;
  }
  .footer-legal {
    margin-top: 28px;
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 1.05rem;
  }
  .nav-links .nav-cta,
  .nav-links .nav-home {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }
  .language-switcher select {
    padding: 5px 18px 5px 6px;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
