/* Toxi Devil — shared styles (tokens, header, footer, buttons, motifs, legal pages).
   Design language: brand/DESIGN.md — glossy, rounded, chunky, purple. */

:root {
  /* Brand ("devil skin") */
  --devil-hi: #E254FC;
  --devil: #B42EEF;
  --devil-deep: #7A18B8;
  --devil-ink: #4A0E78;

  /* Text & surfaces */
  --ink: #2A0B45;
  --body: #5B4475;
  --muted: #76628F;
  --line: #EEE2FA;
  --line-strong: #DFCBF3;
  --bg: #FDFAFF;
  --bg-tint: #F6EEFF;
  --glow: #F0DDFF;

  /* Signals */
  --gold: #FFC83D;  --gold-edge: #D9A21C;
  --good: #3DDC97;  --good-edge: #1FAE72;
  --flag: #FF4D6D;  --flag-edge: #D62E4F;

  --grad: linear-gradient(135deg, #E254FC 0%, #B42EEF 55%, #8A1FD0 100%);
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .1) 30%, rgba(255, 255, 255, 0) 46%);
  --glow-shadow: 0 10px 24px rgba(146, 38, 214, .22);
  --card-glow: 0 22px 40px -26px rgba(146, 38, 214, .28);

  --font-display: 'Fredoka', 'Rubik', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;

  --r-card: 24px;
  --r-tile: 18px;
  --r-tile-sm: 14px;
  --r-pill: 999px;
  --lip: 5px;

  --maxw: 1100px;
  --gutter: 16px;
  --header-h: 68px;

  color-scheme: light;
}
@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.i18n-pending body { visibility: hidden; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background:
    radial-gradient(900px 520px at 50% -160px, var(--glow) 0%, rgba(240, 221, 255, 0) 72%),
    radial-gradient(520px 420px at 0% 120px, rgba(240, 221, 255, .7) 0%, rgba(240, 221, 255, 0) 70%),
    radial-gradient(560px 460px at 100% 360px, rgba(240, 221, 255, .6) 0%, rgba(240, 221, 255, 0) 70%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--glow); color: var(--devil-ink); }
:focus-visible { outline: 3px solid var(--devil); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -52px; z-index: 100;
  background: var(--devil-ink); color: #fff; padding: 10px 16px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 10px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.emoji { font-family: var(--font-emoji); line-height: 1; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* Chat-type pastels (fill / edge), harmonized toward purple */
.t-romantic { --fill: #FF8AD0; --edge: #E055AE; }
.t-situ     { --fill: #CDB0FF; --edge: #9E74F0; }
.t-ex       { --fill: #FF6F8C; --edge: #D93A5A; }
.t-friend   { --fill: #86E6BC; --edge: #45BF8A; }
.t-group    { --fill: #FFD65E; --edge: #E0AE24; }
.t-family   { --fill: #FFB48E; --edge: #E8875E; }
.t-work     { --fill: #A6B7FF; --edge: #6E86E8; }
.t-other    { --fill: #E2B6FF; --edge: #B06EF0; }
.t-tint     { --fill: var(--bg-tint); --edge: var(--line-strong); }
.t-white    { --fill: #FFFFFF; --edge: var(--line-strong); }
/* Score signals */
.s-good { --fill: var(--good); --edge: var(--good-edge); }
.s-mid  { --fill: var(--gold); --edge: var(--gold-edge); }
.s-flag { --fill: var(--flag); --edge: var(--flag-edge); }

/* ---------- Tactile surfaces (2px border + bottom lip) ---------- */
.card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 var(--lip) 0 var(--line-strong), var(--card-glow);
}
.tile {
  background: var(--fill);
  border: 2px solid var(--edge);
  border-radius: var(--r-tile);
  box-shadow: 0 var(--lip) 0 var(--edge);
}
.tile.grad {
  border-color: transparent;
  background: var(--gloss) border-box, var(--grad) border-box;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .3), 0 var(--lip) 0 var(--devil-deep), var(--glow-shadow);
  color: #fff;
}

/* Directional arrow that mirrors in RTL */
.arr { display: inline-block; transition: transform .18s ease; }
[dir="rtl"] .arr { transform: scaleX(-1); }
a:hover > .arr, button:hover > .arr { transform: translateX(3px); }
[dir="rtl"] a:hover > .arr, [dir="rtl"] button:hover > .arr { transform: scaleX(-1) translateX(3px); }

/* ---------- Buttons ---------- */
/* Primary: glossy devil-gradient pill, deep-violet lip, purple glow. Pressed sinks into the lip. */
.cta {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 60px; min-width: 220px; padding: 0 34px;
  margin-bottom: var(--lip);
  border: 0; border-radius: var(--r-pill);
  background: var(--gloss), var(--grad);
  color: #fff; font: 600 20px/1 var(--font-display); letter-spacing: .1px;
  text-shadow: 0 1px 1px rgba(74, 14, 120, .35);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .35),
    0 var(--lip) 0 var(--devil-deep),
    0 14px 30px rgba(146, 38, 214, .34);
  transition: transform .09s ease, box-shadow .09s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.cta:hover { filter: brightness(1.05) saturate(1.06); }
.cta:active {
  transform: translateY(4px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .35), 0 1px 0 var(--devil-deep), 0 6px 14px rgba(146, 38, 214, .26);
}
.cta:focus-visible { outline-offset: 5px; border-radius: var(--r-pill); }
.cta[disabled] { opacity: .55; cursor: default; filter: none; }
.cta.block { display: flex; width: 100%; }

/* Small gradient pill (header "Get the app") */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; margin-bottom: 3px;
  border: 0; border-radius: var(--r-pill);
  background: var(--gloss), var(--grad);
  color: #fff; font: 600 15px/1 var(--font-display); letter-spacing: .1px;
  text-shadow: 0 1px 1px rgba(74, 14, 120, .3);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 3px 0 var(--devil-deep),
    0 8px 18px rgba(146, 38, 214, .28);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.pill:hover { filter: brightness(1.05) saturate(1.06); }
.pill:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 var(--devil-deep), 0 4px 10px rgba(146, 38, 214, .22);
}
.pill:focus-visible { border-radius: var(--r-pill); }

/* Secondary: white pill, lilac lip */
.btn-2, .store {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; margin-bottom: 4px;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-pill);
  box-shadow: 0 4px 0 var(--line-strong);
  color: var(--devil-ink); font: 500 15px/1 var(--font-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, border-color .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-2:hover, .store:hover { border-color: var(--line-strong); color: var(--devil-deep); }
.btn-2:active, .store:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-strong); }
.btn-2:focus-visible, .store:focus-visible { border-radius: var(--r-pill); }
.store svg { width: 18px; height: 18px; flex: none; }
.store-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* Text links */
.text-link {
  color: var(--devil-deep); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
  transition: text-decoration-color .15s ease, color .15s ease;
}
.text-link:hover { color: var(--devil); text-decoration-color: currentColor; }

/* ---------- Motifs ---------- */
/* Horns: peek above the top edge of the featured card. The card sits on top, hiding the horn bases. */
.horned { position: relative; isolation: isolate; }
.horned > .card, .horned > .tile { position: relative; z-index: 1; }
.horns {
  position: absolute; z-index: 0; left: 50%; top: 0;
  width: 132px; height: 40px;
  transform: translate(-50%, -29px);
  filter: drop-shadow(0 4px 6px rgba(146, 38, 214, .22));
  pointer-events: none;
}
.js .horns { transition: transform .75s cubic-bezier(.34, 1.8, .5, 1) .2s; }
.js .horned:not(.in) > .horns { transform: translate(-50%, 6px); transition: none; }

/* Tail divider: thin curvy line ending in Toxi's spade-shaped tail tip (no hearts) */
.tail {
  display: block; width: 100%; max-width: 240px; height: auto; aspect-ratio: 10 / 1;
  overflow: visible;
}
[dir="rtl"] .tail { transform: scaleX(-1); }
[dir="rtl"] [dir="ltr"] .tail { transform: none; }
.tail-divider { display: flex; justify-content: center; padding: 8px var(--gutter); }
.tail-divider .tail { max-width: 200px; }

/* Sparkles ✦ */
.spark { position: absolute; width: 18px; height: 18px; pointer-events: none; overflow: visible; }
.js .spark { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(.55) rotate(25deg); opacity: .55; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 250, 255, .86);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  font: 700 23px/1 var(--font-display); letter-spacing: -.3px;
}
.mascot {
  flex: none; width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  filter: drop-shadow(0 4px 6px rgba(146, 38, 214, .28));
}
.mascot img { width: 100%; height: 100%; object-fit: contain; }
.mascot.sm { width: 34px; height: 34px; }
.brand:hover .mascot img { animation: wiggle .5s ease; }
@keyframes wiggle { 30% { transform: rotate(-8deg); } 65% { transform: rotate(6deg); } }
.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-tint); border: 2px solid var(--line); border-radius: var(--r-pill);
}
.lang-toggle button {
  min-width: 40px; height: 30px; padding: 0 10px;
  border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--devil-ink); font: 600 13px/1 var(--font-body); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.lang-toggle button:not(.is-active):hover { background: #fff; }
.lang-toggle button.is-active {
  background: var(--gloss), var(--grad); color: #fff;
  box-shadow: 0 2px 0 var(--devil-deep);
}

@media (max-width: 380px) {
  .header-actions { gap: 8px; }
  .pill { padding: 0 14px; font-size: 14px; }
}
@media (max-width: 340px) {
  .brand-name { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-tint); border-top: 1px solid var(--line); padding: 56px 0 44px; color: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.footer-brand .brand { font: 600 16px/1.2 var(--font-display); letter-spacing: 0; gap: 10px; }
.footer-brand small { display: block; color: var(--body); font: 400 13px/1.3 var(--font-body); margin-top: 3px; }
.footer-brand .lang-toggle { background: #fff; }
.footer-col h2 { font: 600 15px/1.2 var(--font-display); color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.footer-col a {
  display: block; width: fit-content; padding: 5px 0;
  color: var(--body); font-size: 14.5px; line-height: 1.4; text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .15s ease;
}
.footer-col a:hover, .footer-col a[aria-current="page"] { color: var(--devil-deep); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}

/* ---------- Headings shared ---------- */
.h2 {
  font: 600 44px/1.12 var(--font-display);
  letter-spacing: -.6px; color: var(--ink);
  text-wrap: balance;
}
.lede { font-size: 18px; line-height: 1.6; color: var(--body); text-wrap: pretty; }
[dir="rtl"] .h2, [dir="rtl"] h1 { letter-spacing: 0; }
@media (max-width: 640px) {
  .h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.4px; }
  .lede { font-size: 17px; }
}

/* ---------- Document pages (privacy / terms / contact) ---------- */
.doc { max-width: 740px; margin: 0 auto; padding: 36px var(--gutter) 96px; }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--devil-deep); font: 500 15px/1.3 var(--font-body); text-decoration: none;
}
.back:hover { color: var(--devil); }
.back .arr { transform: scaleX(-1); }
[dir="rtl"] .back .arr { transform: none; }
.back:hover .arr { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .back:hover .arr { transform: translateX(3px); }
.doc-stores { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-stores .store { height: 38px; padding: 0 14px; font-size: 13.5px; margin-bottom: 4px; }
.doc-stores .store svg { width: 15px; height: 15px; }
.lang-note {
  display: none; margin-bottom: 22px; padding: 12px 18px;
  background: var(--bg-tint); border: 2px solid var(--line); border-radius: var(--r-tile);
  font-size: 15px; color: var(--devil-ink);
}
[lang="he"] .lang-note { display: block; }

.doc h1 {
  font: 700 50px/1.06 var(--font-display);
  letter-spacing: -.8px; color: var(--ink);
  margin-bottom: 12px; text-wrap: balance;
}
.doc .updated {
  display: inline-block; margin-bottom: 18px; padding: 6px 14px;
  background: var(--bg-tint); border-radius: var(--r-pill);
  color: var(--devil-ink); font-size: 14px; line-height: 1.3;
}
.doc .doc-tail { margin: 0 0 28px; max-width: 180px; }
.doc h2 { font: 600 23px/1.3 var(--font-display); letter-spacing: -.2px; color: var(--ink); margin: 44px 0 12px; }
.doc p, .doc li { font-size: 17px; line-height: 1.7; color: var(--body); }
.doc p { margin-bottom: 14px; }
.doc ul { padding-inline-start: 22px; margin-bottom: 18px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--devil); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a {
  color: var(--devil-deep); text-decoration: underline;
  text-decoration-color: var(--line-strong); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.doc a:hover { color: var(--devil); text-decoration-color: currentColor; }
.doc a.store, .doc a.back, .doc a.btn-2 { text-decoration: none; }
.note {
  margin: 24px 0; padding: 18px 20px;
  background: var(--bg-tint); border: 2px solid var(--line); border-radius: 20px;
  box-shadow: 0 4px 0 var(--line-strong);
}
.note p { margin: 0; color: var(--devil-ink); }
@media (max-width: 640px) {
  .doc h1 { font-size: 38px; letter-spacing: -.4px; }
  .doc h2 { font-size: 21px; }
  .doc p, .doc li { font-size: 16.5px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .spark, .brand:hover .mascot img { animation: none !important; }
  .js .horns { transition: none; }
  .js .horned:not(.in) > .horns { transform: translate(-50%, -29px); }
}
