/* tribepact.app — the site's look.
   Mobile first. Fonts are the site's own (no Google Fonts). Everything that
   starts hidden to be animated lives in the prefers-reduced-motion:
   no-preference block and only under .js: without JavaScript or with reduced
   motion, every element simply shows. */

@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/assets/fonts/fredoka-600.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('/assets/fonts/fredoka-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url('/assets/fonts/nunito-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('/assets/fonts/nunito-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('/assets/fonts/nunito-800.woff2') format('woff2'); }

:root {
  --sky: #7FD3FF;
  --sky-light: #DDF5FF;
  --grape: #9C8CFF;
  --lilac: #F1ECFF;
  --mint: #C8F5E8;
  --night: #2A1B5C;
  --ink-soft: #5B4F86;
  --green: #22C55E;
  --teal: #14B8A6;
  --sun: #FFC94D;
  --coral: #FF7A6B;
  --paper: #FFFDF7;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(42, 27, 92, .14);
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --text: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:lang(zh) { --display: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; --text: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; }
/* Fredoka has no Cyrillic, nor Romanian ă, ș, ț: those titles use Nunito throughout. */
:lang(ru), :lang(ro) { --display: 'Nunito', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--text); font-size: 17px; line-height: 1.6; color: var(--night); background: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; overflow-wrap: anywhere; hyphens: auto; }
h1 { font-size: clamp(2.1rem, 7vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 4.6vw, 2.8rem); font-weight: 700; text-align: center; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--night); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

/* Buttons */
.btn-download {
  display: inline-flex; align-items: center; gap: .55em; justify-content: center;
  padding: .85em 1.5em; border-radius: 999px; text-decoration: none; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; line-height: 1.2; color: #fff;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 10px 24px rgba(20, 184, 166, .35), inset 0 -3px 0 rgba(0, 0, 0, .12);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-download:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 30px rgba(20, 184, 166, .45), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.btn-download:active { transform: translateY(1px); }
.btn-icon { font-size: 1.1em; }
.cta-row { display: flex; justify-content: center; margin-top: 28px; }
.hero .cta-row { justify-content: flex-start; }
.more { font-weight: 800; color: var(--teal); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(42, 27, 92, .08); }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-decoration: none; }
.brand img { border-radius: 12px; }
.nav-desktop { display: none; margin-left: auto; gap: 4px; }
.nav a { text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 12px; }
.nav a:hover { background: var(--lilac); }
.nav-desktop a { white-space: nowrap; font-size: 1rem; padding: 8px 9px; }
.menu { margin-left: auto; position: relative; }
.menu > summary, .lang > summary { list-style: none; cursor: pointer; font-weight: 800; padding: 8px 12px; border-radius: 12px; white-space: nowrap; }
.menu > summary::-webkit-details-marker, .lang > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .lang > summary:hover { background: var(--lilac); }
.menu .nav { position: absolute; right: 0; top: 46px; display: flex; flex-direction: column; min-width: 220px; padding: 8px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.lang { position: relative; }
.lang ul { position: absolute; right: 0; top: 46px; min-width: 170px; padding: 8px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.lang a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.lang a:hover, .lang a[aria-current] { background: var(--lilac); }
.top .btn-download { display: none; padding: .55em 1.1em; font-size: .95rem; box-shadow: none; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 40px 0 70px; background: linear-gradient(180deg, var(--sky-light) 0%, var(--sky) 62%, #A9C8FF 100%); }
.sky { position: absolute; inset: 0; pointer-events: none; }
.cloud { position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 60px; opacity: .85; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 26px; top: -38px; }
.cloud::after { width: 64px; height: 64px; right: 28px; top: -26px; }
.c1 { top: 70px; left: -40px; }
.c2 { top: 190px; right: -60px; transform: scale(.8); }
.c3 { bottom: 60px; left: 30%; transform: scale(.6); opacity: .6; }
.rainbow { position: absolute; width: 720px; height: 720px; right: -260px; top: 110px; border-radius: 50%;
  background: radial-gradient(circle, transparent 54%, #FF8FA3 54%, #FF8FA3 58%, #FFC94D 58%, #FFC94D 62%, #7EE0A0 62%, #7EE0A0 66%, #7FD3FF 66%, #7FD3FF 70%, #B49CFF 70%, #B49CFF 74%, transparent 74%); opacity: .55; }
.hero-grid { position: relative; display: grid; gap: 34px; align-items: center; }
.kicker { display: inline-block; background: rgba(255, 255, 255, .8); color: var(--ink-soft); font-weight: 800; font-size: .92rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.brandword { display: block; font-size: .5em; letter-spacing: .02em; background: linear-gradient(90deg, #6B4DFF, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 36em; }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.trust li { background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .92rem; }
.trust li::before { content: '✓ '; color: var(--green); }
.hero-art { position: relative; width: min(100%, 360px); margin: 0 auto; padding: 30px 40px; }
.phone { position: relative; border-radius: 42px; padding: 12px; background: #1F1640; box-shadow: 0 30px 60px rgba(31, 22, 64, .35); }
.screens { position: relative; aspect-ratio: 9 / 16; border-radius: 32px; overflow: hidden; background: #fff; }
.screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen + .screen { opacity: 0; }
.float { position: absolute; width: 96px; filter: drop-shadow(0 10px 14px rgba(31, 22, 64, .25)); }
.f1 { left: -12px; top: 8%; }
.f2 { right: -16px; top: 30%; width: 84px; }
.f3 { left: -4px; bottom: 14%; width: 70px; }
.f4 { right: -6px; bottom: 2%; width: 92px; }

/* Sections */
.section { padding: 76px 0; }
.section:nth-of-type(even) { background: var(--lilac); }
.intro { text-align: center; max-width: 44em; margin: 0 auto 30px; color: var(--ink-soft); font-size: 1.1rem; }
.cards { display: grid; gap: 18px; margin-top: 26px; }
.card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: transform .2s ease; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); }
.emoji { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--sky-light); font-size: 1.7rem; margin-bottom: 12px; }

/* Steps */
.step-list { display: grid; gap: 22px; margin-top: 30px; counter-reset: step; }
.step { position: relative; background: #fff; border-radius: var(--radius); padding: 26px 22px 22px; box-shadow: var(--shadow); }
.num { position: absolute; top: -16px; left: 22px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--night); color: #fff; font-family: var(--display); font-weight: 700; }
.demo { margin-top: 14px; border-radius: 18px; padding: 16px; background: var(--paper); border: 2px dashed rgba(42, 27, 92, .15); min-height: 150px; position: relative; overflow: hidden; }
.pact-title { font-family: var(--display); font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--mint); border-radius: 999px; padding: 4px 10px; font-size: .88rem; font-weight: 700; }
.reward { margin: 10px 0 0; font-weight: 800; color: var(--ink-soft); }
.signing { display: grid; place-items: center; }
.sign { width: 100%; max-width: 280px; color: #3B2A8C; }
.seal { position: absolute; right: 10px; bottom: 6px; width: 92px; }
.stamp { display: inline-block; margin: 8px 0 0; padding: 4px 12px; border: 3px solid var(--coral); border-radius: 10px; color: var(--coral); font-family: var(--display); font-weight: 700; transform: rotate(-6deg); background: rgba(255, 255, 255, .8); }
.signing .stamp { position: absolute; left: 12px; bottom: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; }
.box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 3px solid var(--green); display: grid; place-items: center; background: var(--green); }
.box::after { content: '✓'; color: #fff; font-weight: 900; font-size: 16px; line-height: 1; }
.party { display: grid; place-items: center; text-align: center; }
.party img { width: 110px; }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; }

/* Companions */
.companions { overflow: hidden; }
.ribbon { margin: 10px -16px 34px; overflow: hidden; }
.ribbon ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 6px 16px; }
.ribbon li { width: 110px; text-align: center; font-weight: 800; font-size: .9rem; }
.ribbon img { width: 92px; margin: 0 auto 4px; }
.ribbon li:nth-child(n+19) { display: none; }
.evolve { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; max-width: 760px; margin: 0 auto; }
.stage { margin: 0; text-align: center; font-weight: 800; font-size: .85rem; transition: transform .35s ease, filter .35s ease, opacity .35s ease; }
.stage img { margin: 0 auto 6px; }
.stage[data-stage="0"] img { width: 56%; }
.stage[data-stage="1"] img { width: 68%; }
.stage[data-stage="2"] img { width: 80%; }
.stage[data-stage="3"] img { width: 92%; }
.stage[data-stage="4"] img { width: 100%; }

/* Safety */
.safe-grid { display: grid; gap: 28px; align-items: center; }
.safe-grid h2 { text-align: left; }
.owl { width: 160px; }
.safe-list li { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 8px 20px rgba(42, 27, 92, .08); font-weight: 700; }
.safe-list .emoji { margin: 0; flex: none; width: 46px; height: 46px; font-size: 1.4rem; }

/* Price */
.plans { display: grid; gap: 18px; max-width: 860px; margin: 26px auto 0; }
.plan { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border: 3px solid transparent; }
.plan.plus { border-color: var(--grape); background: linear-gradient(160deg, #fff 60%, var(--lilac)); }
.note { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-top: 16px; }

/* FAQ */
.qa-list { max-width: 820px; margin: 26px auto 0; }
.qa { background: #fff; border-radius: 18px; margin-bottom: 12px; box-shadow: 0 8px 20px rgba(42, 27, 92, .08); }
.qa summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 800; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--teal); transition: transform .2s ease; }
.qa[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.qa p { padding: 0 20px 18px; margin: 0; color: var(--ink-soft); }
.faq p:last-child { text-align: center; margin-top: 18px; }

/* Final */
.final { text-align: center; background: linear-gradient(180deg, var(--lilac), var(--sky-light)) !important; }
.tribe { width: min(300px, 70%); margin: 0 auto 10px; }
.final .lead { margin: 0 auto; }

/* Sticky download (phones) */
.sticky-cta { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; display: flex; justify-content: center; transition: transform .3s ease, opacity .3s ease; }
.sticky-cta .btn-download { width: 100%; max-width: 420px; }

/* Footer */
.foot { background: var(--night); color: #EDE8FF; padding: 54px 0 90px; }
.foot .wrap { display: grid; gap: 28px; }
.foot h2 { font-size: 1.05rem; text-align: left; margin-bottom: 10px; color: #fff; }
.foot a { color: #EDE8FF; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot li { margin-bottom: 6px; }
.foot .slogan { font-family: var(--display); font-size: 1.2rem; color: #fff; margin: 12px 0 4px; }
.foot .foot-bottom { display: block; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9rem; }

/* Documents: legal pages, FAQ page, guides, 404 */
.doc { padding: 46px 0 70px; }
.doc .wrap { max-width: 820px; }
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.doc h2 { text-align: left; font-size: 1.5rem; margin-top: 1.6em; }
.doc h3 { margin-top: 1.2em; }
.doc ul, .doc ol { padding-left: 1.3em; margin-bottom: 1em; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc li { margin-bottom: .4em; }
.doc .meta, .crumbs { color: var(--ink-soft); font-size: .92rem; }
.crumbs a { color: var(--teal); }
.doc .summary { background: var(--lilac); border-radius: 18px; padding: 18px 22px; margin: 18px 0 26px; }
.doc .note { background: #FFF6D8; border-radius: 14px; padding: 12px 16px; text-align: left; }
.scroll { overflow-x: auto; margin-bottom: 1.2em; }
.doc table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.doc th, .doc td { border: 1px solid rgba(42, 27, 92, .15); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--lilac); }
.doc .button, .join .btn-download { margin-top: 6px; }
a.button, .doc a.button { display: inline-block; font-weight: 800; padding: 10px 20px; border-radius: 999px; background: var(--night); color: #fff; text-decoration: none; overflow-wrap: anywhere; }
a.button:hover { filter: brightness(1.2); }
.doc .kid { background: #FFF6D9; border-radius: 22px; padding: 6px 20px 12px; margin: 20px 0; }
.doc .kid h2 { margin-top: .9em; }
.doc .summary h2 { margin-top: .6em; }
.join .wrap { max-width: 600px; text-align: center; }
.join .tribe-art { width: min(240px, 70%); margin: 0 auto 6px; }
.article-cta { margin-top: 40px; padding: 28px; border-radius: var(--radius); background: linear-gradient(160deg, var(--sky-light), var(--lilac)); text-align: center; }
.article-cta h2 { text-align: center; margin-top: 0; }
.guide-list { display: grid; gap: 16px; margin-top: 24px; }
.guide-list a { display: block; text-decoration: none; }
.guide-list p { color: var(--ink-soft); margin: 0; }
.lost { text-align: center; }
.lost img { width: 180px; margin: 0 auto 10px; }

/* Invitation page */
.join .code { font-family: var(--display); font-size: clamp(1.6rem, 7vw, 2.4rem); letter-spacing: .06em; background: #fff; border-radius: 16px; padding: 14px; margin: 14px 0; text-align: center; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.join button { font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--night); color: #fff; cursor: pointer; }

/* Wider screens */
@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.three { grid-template-columns: repeat(3, 1fr); }
  .step-list { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr 1fr; }
  .safe-grid { grid-template-columns: 1fr 1.4fr; }
  .owl { width: 220px; }
  .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; }
  .sticky-cta { display: none; }
  .foot { padding-bottom: 54px; }
  .guide-list { grid-template-columns: repeat(3, 1fr); }
  /* No sticky bar from here: the header keeps a Download button in view instead. */
  .top .btn-download { display: inline-flex; }
}
@media (min-width: 1040px) {
  body { font-size: 18px; }
  .hero { padding: 70px 0 110px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .hero-art { width: 400px; }
  .float { width: 120px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .step-list { grid-template-columns: repeat(4, 1fr); }
}

/* Animations: only with JavaScript and when motion is welcome. */
/* The full menu needs up to ~1100 px on one line (French, Russian): below that, ☰. */
@media (min-width: 1200px) {
  .nav-desktop { display: flex; }
  .menu { display: none; }
  .lang { margin-left: 4px; }
}
/* The companions slide in one endless line only when things may move; with
   reduced motion (and on phones) all 18 wrap into rows instead. */
@media (prefers-reduced-motion: no-preference) and (min-width: 760px) {
  .ribbon ul { flex-wrap: nowrap; justify-content: flex-start; width: max-content; }
  .ribbon li:nth-child(n+19) { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
  .cloud { animation: drift 38s linear infinite alternate; }
  .c2 { animation-duration: 46s; }
  .float { animation: bob 5s ease-in-out infinite; }
  .f2 { animation-delay: -1.5s; }
  .f3 { animation-delay: -3s; }
  .f4 { animation-delay: -2.2s; }
  .screen { transition: opacity .8s ease; }
  .js .screen { opacity: 0; }
  .js .screen.is-on { opacity: 1; }
  .js .sign path { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
  .js .signing.is-on .sign path { transition: stroke-dashoffset 1.8s ease-in-out; stroke-dashoffset: 0; }
  .js .signing .seal, .js .signing .stamp, .js .party .stamp { opacity: 0; transform: scale(.4) rotate(-12deg); }
  .js .signing.is-done .seal, .js .signing.is-done .stamp, .js .party.is-on .stamp { opacity: 1; transform: rotate(-6deg); transition: opacity .35s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
  .js .checklist .box { background: transparent; transition: background .25s ease; }
  .js .checklist .box::after { opacity: 0; transition: opacity .2s ease; }
  .js .checklist li.done .box { background: var(--green); }
  .js .checklist li.done .box::after { opacity: 1; }
  .party.is-on img { animation: hop .8s ease 2; }
  .confetti { animation: fall 1.6s ease-in forwards; }
  .js .stage { opacity: .45; filter: grayscale(.6); }
  .js .stage.is-on { opacity: 1; filter: none; transform: translateY(-8px) scale(1.06); }
  .ribbon ul { animation: slide 48s linear infinite; }
  .js .sticky-cta { transform: translateY(140%); opacity: 0; }
  .js .past-hero .sticky-cta { transform: none; opacity: 1; }
  .btn-download { animation: glow 3.2s ease-in-out infinite; }
}
@keyframes drift { to { transform: translateX(80px); } }
@keyframes bob { 50% { transform: translateY(-14px) rotate(3deg); } }
@keyframes hop { 50% { transform: translateY(-16px); } }
@keyframes fall { to { transform: translateY(240px) rotate(540deg); opacity: 0; } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes glow { 50% { box-shadow: 0 14px 34px rgba(34, 197, 94, .55), inset 0 -3px 0 rgba(0, 0, 0, .12); } }

@media (max-width: 759px) {
  .ribbon ul { animation: none; }
}
@media (max-width: 459px) {
  .top .brand span { display: none; }
  .top .wrap { gap: 4px; }
}

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