/* =========================
   THEME TOKENS (CSS vars)
========================= */
:root{
  --bg1: #ff5a2e;
  --bg2: #ffb24a;
  --ink: #111827;
  --ink2: rgba(17,24,39,.75);
  --panel: rgba(255,255,255,.86);
  --panel2: rgba(255,255,255,.72);
  --stroke: rgba(17,24,39,.12);

  --primary: #111827;
  --accent: #ff7a00;

  --shadow: 0 18px 45px rgba(0,0,0,.18);
  --shadow2: 0 12px 30px rgba(0,0,0,.14);

  --radius: 22px;
  --radius2: 16px;
}

body.theme-dark{
  --bg1: #0b1020;
  --bg2: #1b2a6b;
  --ink: #e5e7eb;
  --ink2: rgba(229,231,235,.78);
  --panel: rgba(17,24,39,.70);
  --panel2: rgba(17,24,39,.55);
  --stroke: rgba(255,255,255,.12);

  --primary: #e5e7eb;
  --accent: #6ee7ff;

  --shadow: 0 18px 45px rgba(0,0,0,.35);
  --shadow2: 0 12px 30px rgba(0,0,0,.28);
}

/* =========================
   RESET
========================= */
*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-x:hidden;
  transition: color .45s ease, background .45s ease;
}
a{ color:inherit; text-decoration:none; }
button{ font:inherit; cursor:pointer; border:none; background:none; }
:focus-visible{ outline: 3px solid rgba(255,255,255,.55); outline-offset: 3px; }

/* =========================
   TOPBAR
========================= */
.topbar{
  position: fixed;
  inset: 14px 14px auto 14px;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 220px;
}

.avatar{
  width: 38px; height:38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #1f2937, #0ea5e9);
  box-shadow: 0 10px 18px rgba(0,0,0,.15);
}

.who-name{ font-weight: 800; font-size: 14px; line-height:1.1; }
.who-sub{ font-size: 12px; color: var(--ink2); margin-top:2px; }

.topbar-right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease, background .25s ease;
}
.pill:hover{ transform: translateY(-1px); box-shadow: 0 14px 26px rgba(0,0,0,.12); }

.pill-solid{
  background: linear-gradient(135deg, rgba(255,122,0,.95), rgba(255,210,75,.95));
  border: 1px solid rgba(255,255,255,.3);
  color: #111827;
  font-weight: 800;
}
body.theme-dark .pill-solid{
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(167,139,250,.95));
  color: #0b1020;
}

.pill-ghost{
  font-weight: 700;
}

.pill-icon{
  overflow:hidden;
  position:relative;
}
.toggle-icon{
  width: 18px; height:18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,.2));
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.08);
  position:relative;
}
body.theme-dark .toggle-icon{
  background: radial-gradient(circle at 30% 30%, #a5f3fc, rgba(255,255,255,.12));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.14);
}

/* animated “wipe” on click */
.pill-icon.is-flipping::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-120%);
  animation: wipe .55s ease forwards;
}
@keyframes wipe{
  to { transform: translateX(120%); }
}

.lang{ display:flex; gap: 8px; }

/* =========================
   HERO (Platformer vibe)
========================= */
.hero{
  min-height: 100vh;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 120px 16px 70px;
}

.bg{
  position:absolute;
  inset:0;
  overflow:hidden;
  z-index:0;
}

.sky{
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  transition: filter .5s ease;
}

/* clouds layer (pure CSS shapes) */
.clouds{
  position:absolute;
  inset:0;
  opacity: .85;
  background:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.95) 0 18px, transparent 19px),
    radial-gradient(circle at 17% 20%, rgba(255,255,255,.95) 0 26px, transparent 27px),
    radial-gradient(circle at 24% 22%, rgba(255,255,255,.95) 0 20px, transparent 21px),

    radial-gradient(circle at 58% 18%, rgba(255,255,255,.90) 0 16px, transparent 17px),
    radial-gradient(circle at 63% 16%, rgba(255,255,255,.90) 0 24px, transparent 25px),
    radial-gradient(circle at 70% 18%, rgba(255,255,255,.90) 0 18px, transparent 19px),

    radial-gradient(circle at 82% 30%, rgba(255,255,255,.85) 0 14px, transparent 15px),
    radial-gradient(circle at 86% 28%, rgba(255,255,255,.85) 0 22px, transparent 23px),
    radial-gradient(circle at 92% 30%, rgba(255,255,255,.85) 0 16px, transparent 17px);
  filter: blur(.2px);
  animation: drift 34s linear infinite;
}
.clouds2{
  opacity:.55;
  transform: translateX(-35%);
  animation-duration: 52s;
  animation-direction: reverse;
}
@keyframes drift{
  from{ transform: translateX(-20%); }
  to{ transform: translateX(20%); }
}

/* coins (float + spin) */
.coins{ position:absolute; inset:0; pointer-events:none; }
.coin{
  position:absolute;
  width: 22px; height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.8), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #ffd84d, #ff7a00);
  box-shadow: 0 14px 24px rgba(0,0,0,.22);
  transform-origin:center;
  animation: coinFloat 2.8s ease-in-out infinite;
}
.coin::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.14);
}
@keyframes coinFloat{
  0%,100%{ transform: translateY(0) rotateY(0deg) scale(1); }
  50%{ transform: translateY(-14px) rotateY(180deg) scale(1.05); }
}
.c1{ left:12%; top:30%; animation-delay:.0s; }
.c2{ left:26%; top:54%; animation-delay:.4s; }
.c3{ left:58%; top:26%; animation-delay:.2s; }
.c4{ left:74%; top:48%; animation-delay:.6s; }
.c5{ left:86%; top:34%; animation-delay:.3s; }

/* hills parallax */
.hills{
  position:absolute;
  left:-10%;
  right:-10%;
  bottom: 110px;
  height: 240px;
  background:
    radial-gradient(circle at 18% 120%, rgba(0,0,0,.18) 0 140px, transparent 141px),
    radial-gradient(circle at 38% 120%, rgba(0,0,0,.16) 0 170px, transparent 171px),
    radial-gradient(circle at 64% 120%, rgba(0,0,0,.14) 0 150px, transparent 151px),
    radial-gradient(circle at 84% 120%, rgba(0,0,0,.13) 0 130px, transparent 131px);
  filter: blur(.2px);
  opacity: .22;
  animation: hillsMove 18s linear infinite;
}
.hills2{
  bottom: 95px;
  opacity: .16;
  animation-duration: 28s;
  animation-direction: reverse;
}
@keyframes hillsMove{
  from{ transform: translateX(-2%); }
  to{ transform: translateX(2%); }
}

/* ground with “tiles” */
.ground{
  position:absolute;
  left:0; right:0; bottom:0;
  height: 120px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0)),
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,.18) 0 18px,
      rgba(0,0,0,.10) 18px 36px
    );
  opacity: .22;
  animation: groundMove 6.5s linear infinite;
}
@keyframes groundMove{
  from{ background-position: 0 0, 0 0; }
  to{ background-position: 0 0, 360px 0; }
}

/* =========================
   CONTENT
========================= */
.hero-inner{
  position:relative;
  z-index: 2;
  width: min(1100px, 100%);
  display:flex;
  flex-direction:column;
  gap: 18px;
  padding: 22px;
}

.brand{
  display:flex;
  gap: 14px;
  align-items:flex-start;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transform: translateY(8px);
  opacity: 0;
  animation: popIn .9s ease forwards;
}
@keyframes popIn{
  to{ transform: translateY(0); opacity: 1; }
}

.logo-mark{
  width: 54px; height:54px;
  border-radius: 18px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.35));
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 16px 28px rgba(0,0,0,.14);
  font-size: 26px;
  animation: logoBounce 1.8s ease-in-out infinite;
}
@keyframes logoBounce{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}

.title{
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, rgba(255,122,0,1), rgba(255,214,102,1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.18));
  animation: titlePulse 2.4s ease-in-out infinite;
}
body.theme-dark .title{
  background: linear-gradient(90deg, rgba(110,231,255,1), rgba(167,139,250,1));
  -webkit-background-clip:text;
  color: transparent;
}
@keyframes titlePulse{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}
.subtitle{
  margin-top: 8px;
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--ink2);
  max-width: 62ch;
}

/* CTA buttons */
.cta-row{
  display:flex;
  gap: 14px;
  flex-wrap:wrap;
  align-items:center;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .01em;
  border: 1px solid var(--stroke);
  background: var(--panel);
  box-shadow: var(--shadow2);
  transition: transform .2s ease, box-shadow .2s ease;
  position:relative;
  overflow:hidden;
}
.btn:hover{
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 38px rgba(0,0,0,.18);
}
.btn:active{ transform: translateY(0) scale(.99); }

.btn-primary{
  background: linear-gradient(135deg, rgba(255,122,0,.96), rgba(255,214,102,.92));
  color: #111827;
  border: 1px solid rgba(255,255,255,.35);
}
body.theme-dark .btn-primary{
  background: linear-gradient(135deg, rgba(110,231,255,.96), rgba(167,139,250,.92));
  color: #0b1020;
}

.btn-secondary{
  background: var(--panel);
}

.btn::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-120%);
  transition: transform .0s;
  opacity: .65;
}
.btn:hover::after{
  animation: btnShine .7s ease forwards;
}
@keyframes btnShine{
  to{ transform: translateX(120%); }
}

.btn-icon{
  width: 34px; height:34px;
  border-radius: 12px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.55);
}

/* cards */
.mini-cards{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
  transform: translateY(10px);
  opacity: 0;
  animation: popIn .9s ease forwards;
  animation-delay: .12s;
  transition: transform .22s ease, box-shadow .22s ease;
  position:relative;
  overflow:hidden;
}
.card:nth-child(2){ animation-delay: .20s; }
.card:nth-child(3){ animation-delay: .28s; }

.card:hover{
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(0,0,0,.18);
}
.card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.55), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(255,255,255,.35), transparent 45%);
  opacity:.65;
  pointer-events:none;
}

.card-emoji{
  width: 44px; height:44px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.35));
  border: 1px solid rgba(255,255,255,.35);
  margin-bottom: 10px;
  font-size: 20px;
  animation: floaty 2.1s ease-in-out infinite;
}
.card:nth-child(2) .card-emoji{ animation-delay:.2s; }
.card:nth-child(3) .card-emoji{ animation-delay:.4s; }
@keyframes floaty{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}

.card h3{ font-size: 16px; font-weight: 900; }
.card p{
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.5;
}

/* hint */
.hint{
  margin-top: 6px;
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,.92);
  text-shadow: 0 10px 18px rgba(0,0,0,.22);
  font-weight: 700;
}
.spark{
  display:inline-block;
  animation: sparkle 1.2s ease-in-out infinite;
}
@keyframes sparkle{
  0%,100%{ transform: rotate(0deg) scale(1); }
  50%{ transform: rotate(12deg) scale(1.12); }
}

/* language switch animation helper */
.fade-swap{
  animation: fadeSwap .28s ease both;
}
@keyframes fadeSwap{
  from{ opacity:0; transform: translateY(4px); }
  to{ opacity:1; transform: translateY(0); }
}

/* =========================
   RTL polish
========================= */
html[dir="rtl"] .topbar{ direction: rtl; }
html[dir="rtl"] .topbar-left{ flex-direction: row-reverse; }
html[dir="rtl"] .cta-row{ justify-content:flex-start; }
html[dir="rtl"] .brand{ text-align:right; }
html[dir="rtl"] .hint{ direction: rtl; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 980px){
  .mini-cards{ grid-template-columns: 1fr; }
}

@media (max-width: 740px){
  .topbar{
    inset: 10px 10px auto 10px;
    border-radius: 22px;
    padding: 10px 10px;
  }
  .topbar-left{ min-width: unset; }
  .who-sub{ display:none; }
  .pill{ padding: 9px 12px; }
  .brand{ flex-direction: column; align-items: flex-start; }
  html[dir="rtl"] .brand{ align-items: flex-end; }
  .logo-mark{ width: 50px; height:50px; }
}
@media (max-width: 480px){
  .hero{
    padding: 100px 12px 60px;
  }
  .title{ font-size: clamp(26px, 6vw, 42px); }
  .subtitle{ font-size: clamp(13px, 2.2vw, 16px); }
  .cta-row{ flex-direction: column; align-items: stretch; }
  .btn{ justify-content: center; }
}

body.theme-dark .topbar {
  background: rgba(0,0,0,.55);
}
body.theme-light .topbar {
  background: rgba(255,255,255,.86);
}
body.theme-dark .btn-secondary{
  background: var(--panel2);
}
.pill-danger {
  background: #ff4d4f;
  color: #fff;
}
.pill-danger:hover {
  background: #ff7875;
}
