/* ============================================================================
   טופי · Tofy — the glass design system for tofyapp.com.
   One stylesheet for every page: the app's own backdrop (violet → indigo →
   blue with pink/teal orbs), glass panes and white pill buttons with indigo
   ink. Kept deliberately single-look — the site should feel like the app, on
   any device and in any theme.

   Contrast note (IS 5568 / WCAG AA): the backdrop is deliberately deeper than
   the app's own gradient and the panes are tinted DOWN rather than up. White
   glass over a bright gradient left body text at ~2.4:1; with these tokens the
   worst real combination on the site (faint text straight on the backdrop) is
   4.8:1, and everything else clears 5:1. Please keep it that way — lightening
   the gradient or flipping --pane back to a white tint breaks the whole site
   at once.
   ========================================================================== */

:root{
  /* backdrop stops */
  --bg-1:#4E3BA3; --bg-2:#3C3D84; --bg-3:#28599A;
  --violet:#7A5CFF; --indigo:#5E60CE; --blue:#3E8BF0;
  --pink:#FF6B9D;  --teal:#48BFE3;
  --gold:#FFD23F;  --mint:#8CFFC4; --ink:#4B3FBF;
  /* --gold is the decorative gold (rims, focus, big numerals). Small gold
     TEXT uses --gold-text, which is light enough to clear 4.5:1. */
  --gold-text:#FFE9A8;
  --pane:rgba(27,15,74,.20);
  --pane-hi:rgba(27,15,74,.28);
  --pane-pill:rgba(27,15,74,.18);
  --edge:rgba(255,255,255,.30);
  --text:#fff;
  --muted:rgba(255,255,255,.92);
  --faint:rgba(255,255,255,.84);
  --r-lg:28px; --r-md:22px; --r-sm:16px;
  --wrap:1120px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:"Heebo",-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  color:var(--text); background:var(--bg-2); line-height:1.65;
  overflow-x:hidden; font-size:16px; font-weight:500;
  text-rendering:optimizeLegibility;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
[hidden]{display:none!important}
::selection{background:rgba(255,210,63,.35)}

/* Focus: one loud, consistent ring on everything focusable. :focus-visible
   keeps it off mouse clicks; the fallback keeps it for browsers without it. */
:focus{outline:3px solid var(--gold); outline-offset:3px; border-radius:8px}
:focus:not(:focus-visible){outline:none}
:focus-visible{outline:3px solid var(--gold); outline-offset:3px; border-radius:8px}

/* ---------- screen-reader-only text ---------------------------------------- */
.visually-hidden{
  position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
}

/* ---------- skip link ------------------------------------------------------
   First thing in the tab order on every page; invisible until focused. */
.skip-link{
  position:absolute;inset-block-start:-120px;inset-inline-start:12px;z-index:200;
  background:linear-gradient(180deg,#fff,#EDEAFF);color:var(--ink);
  font-weight:800;font-size:15.5px;padding:12px 22px;
  border-radius:0 0 var(--r-sm) var(--r-sm);
  box-shadow:0 12px 28px rgba(10,5,40,.45);
}
/* Hide it up the BLOCK axis, never the inline one: an inline offset flips
   with direction, so -9999px lands off the right edge of an RTL page and the
   link never comes back into view. */
.skip-link:focus{inset-block-start:0}

/* ---------- the backdrop: gradient + two soft orbs ------------------------- */
.backdrop{position:fixed; inset:0; z-index:-2;
  background:linear-gradient(165deg,var(--bg-1) 0%, var(--bg-2) 46%, var(--bg-3) 100%);}
.backdrop::before,.backdrop::after{content:"";position:absolute;border-radius:50%;filter:blur(90px)}
.backdrop::before{width:52vmax;height:52vmax;top:-14vmax;inset-inline-start:-12vmax;
  background:radial-gradient(circle,rgba(255,107,157,.20),transparent 68%)}
.backdrop::after{width:56vmax;height:56vmax;bottom:-18vmax;inset-inline-end:-14vmax;
  background:radial-gradient(circle,rgba(72,191,227,.16),transparent 68%)}
.sparks{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none}
.spark{position:absolute;opacity:.7;animation:tw 3.4s ease-in-out infinite}
@keyframes tw{0%,100%{opacity:.2;transform:scale(.65)}50%{opacity:.9;transform:scale(1.08)}}
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-14px)}}

/* One switch stops every animation on the page (see .motion-btn). */
.motion-paused *,.motion-paused *::before,.motion-paused *::after{
  animation-play-state:paused!important;
}
.motion-paused .sparks{display:none}

/* Someone who asked for less motion gets none of it — and, importantly, still
   gets the content: .reveal is only ever hidden while JS is running. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
  html{scroll-behavior:auto}
  .sparks{display:none}
  .js .reveal{opacity:1!important;transform:none!important}
}

.wrap{max-width:var(--wrap);margin:0 auto;padding:0 22px}

/* ---------- glass primitives ---------------------------------------------- */
.pane{
  background:var(--pane);
  border:1px solid var(--edge);
  border-radius:var(--r-md);
  backdrop-filter:blur(16px) saturate(140%);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
  box-shadow:0 18px 44px rgba(23,12,68,.22), inset 0 1px 0 rgba(255,255,255,.24);
}
.inset{background:rgba(27,15,74,.16);border:1px solid rgba(255,255,255,.22);border-radius:var(--r-sm)}

/* ---------- buttons -------------------------------------------------------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;
  font-weight:800;font-size:17px;border:0;cursor:pointer;font-family:inherit;
  border-radius:999px;padding:14px 28px;
  background:linear-gradient(180deg,#fff,#EDEAFF);color:var(--ink);
  box-shadow:0 12px 30px rgba(23,12,68,.28);
  transition:transform .16s ease, box-shadow .16s ease}
.btn:hover{transform:translateY(-2px);box-shadow:0 18px 38px rgba(23,12,68,.36)}
.btn:active{transform:translateY(0)}
.btn.ghost{background:rgba(27,15,74,.28);color:#fff;border:1px solid var(--edge);box-shadow:none}
.btn.ghost:hover{background:rgba(27,15,74,.42)}
.btn:disabled{opacity:.75;cursor:default;transform:none}

/* App Store badge */
.appstore{display:inline-flex;align-items:center;gap:12px;background:#0B0B10;color:#fff;
  border:1px solid rgba(255,255,255,.22);border-radius:16px;padding:11px 22px;
  box-shadow:0 14px 32px rgba(0,0,0,.34);transition:transform .16s, box-shadow .16s}
.appstore:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(0,0,0,.44)}
.appstore svg{width:29px;height:29px;flex:0 0 auto}
.appstore .tx{display:flex;flex-direction:column;line-height:1.1;text-align:start}
.appstore .tx small{font-size:12px;font-weight:600;opacity:.9}
.appstore .tx b{font-size:22px;font-weight:800;letter-spacing:.2px}

/* ---------- pause-the-motion control --------------------------------------- */
.motion-btn{display:inline-flex;align-items:center;gap:7px;font-family:inherit;
  font-weight:700;font-size:13.5px;line-height:1;color:var(--muted);cursor:pointer;
  background:rgba(12,6,40,.34);border:1px solid var(--edge);border-radius:999px;
  padding:9px 15px;min-height:34px;transition:background .16s ease,color .16s ease}
.motion-btn:hover{color:#fff;background:rgba(12,6,40,.5)}
.motion-icon{font-size:12px;line-height:1}

/* ---------- header --------------------------------------------------------- */
.site-head{position:sticky;top:0;z-index:60;
  background:rgba(28,18,78,.52);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(255,255,255,.16)}
.site-head .wrap{display:flex;align-items:center;justify-content:flex-start;gap:14px;height:66px}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;font-size:25px;letter-spacing:.5px;
  margin-inline-end:auto;flex:0 0 auto}
.brand img{height:36px;width:auto}
.brand span{background:linear-gradient(180deg,#FFE9A8,var(--gold));-webkit-background-clip:text;background-clip:text;color:transparent}
.brand .visually-hidden{color:inherit}
.site-nav{display:flex;align-items:center;gap:20px}
.site-nav a{font-weight:700;font-size:15.5px;color:var(--muted)}
.site-nav a:hover{color:#fff}
.site-nav .btn{font-size:15px;padding:11px 22px;color:var(--ink)}
.menu-btn{display:none;background:rgba(27,15,74,.34);border:1px solid var(--edge);
  color:#fff;border-radius:12px;width:44px;height:40px;font-size:19px;cursor:pointer;
  font-family:inherit;flex:0 0 auto}

/* ---------- language switcher ---------------------------------------------
   A two-option segmented pill that sits at the end edge of the header and
   stays there on mobile, where the ☰ menu is closed. The current language is
   the filled half and carries aria-current="true"; the other half is a plain
   link to the same page in the other language. The language NAME is always
   shown next to the flag — flag emoji fall back to two letters ("IL", "US")
   on Windows, so the name is what actually carries the meaning. */
.lang-switch{position:relative;flex:0 0 auto}
/* The button itself: one small pill showing the language you are in. Three
   languages side by side ate the header, so the other two live in a menu. */
.lang-switch>summary{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;
  list-style:none;cursor:pointer;user-select:none;
  font-weight:800;font-size:13.5px;line-height:1;color:#fff;
  padding:9px 12px;min-height:34px;border-radius:999px;
  background:rgba(12,6,40,.34);border:1px solid var(--edge);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  transition:background .16s ease}
.lang-switch>summary::-webkit-details-marker{display:none}
.lang-switch>summary::marker{content:""}
.lang-switch>summary:hover{background:rgba(255,255,255,.16)}
.lang-switch>summary:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.lang-switch .chev{width:11px;height:11px;opacity:.75;transition:transform .18s ease}
.lang-switch[open] .chev{transform:rotate(180deg)}
/* The menu. Anchored to the button's edge on both sides, so it never hangs off
   the screen in either direction. */
.lang-switch .lang-menu{position:absolute;top:calc(100% + 8px);inset-inline-end:0;z-index:60;
  min-width:172px;display:flex;flex-direction:column;gap:2px;padding:6px;
  border-radius:16px;background:rgba(30,18,86,.97);border:1px solid var(--edge);
  box-shadow:0 18px 44px rgba(6,2,28,.5);
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
/* One side for the whole menu: the PAGE decides where the flag and the name sit,
   not each language's own direction. On a Hebrew or Arabic page every row reads
   from the right; on a Russian or English page, from the left. Without this each
   row followed its own dir and the menu came out ragged (Rani). `direction` is
   set explicitly so it wins over any dir="" left on the link itself. */
.lang-switch .lang-menu a{display:flex;align-items:center;gap:9px;white-space:nowrap;
  direction:inherit;
  font-weight:800;font-size:14px;line-height:1;color:var(--muted);
  padding:10px 12px;border-radius:11px;
  transition:background .16s ease,color .16s ease}
.lang-switch .lang-menu a:hover{color:#fff;background:rgba(255,255,255,.14)}
.lang-switch .lang-menu a[aria-current="true"]{color:var(--ink);
  background:linear-gradient(180deg,#fff,#EDEAFF)}
.lang-switch .flag{font-size:16px;line-height:1}

@media(max-width:860px){
  .menu-btn{display:block}
  .site-head .wrap{gap:10px}
  .site-nav{position:absolute;top:66px;inset-inline:0;flex-direction:column;align-items:stretch;gap:0;
    background:rgba(30,18,86,.97);backdrop-filter:blur(20px);border-bottom:1px solid var(--edge);
    padding:8px 18px 18px;display:none}
  .site-nav.open{display:flex}
  .site-nav a{padding:13px 4px;border-bottom:1px solid rgba(255,255,255,.14);font-size:17px}
  .site-nav .btn{margin-top:14px;border-bottom:0}
}
@media(max-width:460px){
  .wrap{padding:0 16px}
  .brand{font-size:21px;gap:8px}
  .brand img{height:30px}
  .lang-switch>summary{font-size:12.5px;padding:8px 10px;gap:5px}
}
@media(max-width:374px){
  /* Last resort on very narrow phones: the button keeps the flag, drops the name. */
  .lang-switch>summary .cur{display:none}
}

/* ---------- sections ------------------------------------------------------- */
section{padding:74px 0;scroll-margin-top:84px}
.eyebrow{text-align:center;font-weight:800;font-size:14.5px;letter-spacing:1px;color:var(--gold-text);margin-bottom:10px}
h1,h2,h3{line-height:1.15;text-wrap:balance}
h2.title{text-align:center;font-size:clamp(28px,4.6vw,44px);font-weight:900;margin-bottom:12px}
.lead{text-align:center;max-width:660px;margin:0 auto 44px;color:var(--muted);font-size:18px}

/* Hidden only while JS is actually running, so a failed or blocked script can
   never leave the page blank. */
.js .reveal{opacity:0;transform:translateY(24px);transition:opacity .7s ease, transform .7s ease}
.js .reveal.in{opacity:1;transform:none}

/* ---------- forms ---------------------------------------------------------- */
.ef .field{display:flex;flex-direction:column;gap:6px;text-align:start}
.ef label{font-size:14px;font-weight:700;color:var(--muted)}
.ef label .opt{font-weight:600;color:var(--faint)}
.ef input:focus-visible,.ef select:focus-visible,.ef button:focus-visible{
  outline:3px solid var(--gold);outline-offset:2px}
.ef input[aria-invalid="true"]{border-color:#FFA8B8;box-shadow:0 0 0 1px #FFA8B8}
/* Errors are never colour alone: an icon and words carry the message. */
.ef-error{display:flex;align-items:flex-start;gap:7px;text-align:start;
  font-size:14px;font-weight:700;color:#FFD9DE}
.ef-error:empty{display:none}

/* ---------- footer --------------------------------------------------------- */
.site-foot{padding:56px 0 46px;text-align:center;color:var(--faint);font-size:14.5px;
  border-top:1px solid rgba(255,255,255,.14);margin-top:20px}
.site-foot .links{display:flex;flex-wrap:wrap;gap:8px 22px;justify-content:center;margin:14px 0 18px}
.site-foot .links a{font-weight:700;color:var(--muted)}
.site-foot .links a:hover{color:#fff}
/* Was inline opacity:.75, which pushed the copyright line under 4.5:1. */
.site-foot .copyright{color:var(--faint)}

/* ---------- document pages (privacy / terms / support / age / a11y) -------- */
.doc{max-width:860px;margin:0 auto;padding:36px 30px}
.doc h1{font-size:clamp(26px,4.4vw,38px);font-weight:900;margin-bottom:6px}
.doc h2{font-size:20px;font-weight:800;margin:30px 0 8px;color:#fff}
.doc h3{font-size:17px;font-weight:800;margin:20px 0 6px;color:#fff}
.doc p,.doc li{color:var(--muted);font-size:16.5px}
.doc p{margin-bottom:12px}
.doc ul{margin:0 0 14px;padding-inline-start:22px}
.doc li{margin-bottom:8px}
.doc b{color:#fff;font-weight:800}
.doc a{color:var(--gold-text);font-weight:700;text-decoration:underline}
.doc .stamp{color:var(--faint);font-size:14.5px;margin-bottom:22px}
.doc hr{border:0;border-top:1px solid rgba(255,255,255,.20);margin:34px 0}
.doc .en{direction:ltr;text-align:left;margin-top:34px}
.doc-head{text-align:center;padding:44px 0 8px}
.doc-head .brand{justify-content:center;font-size:30px}
/* A boxed "who to contact" block on the accessibility statement. */
.doc .contact-card{padding:20px 24px;margin:18px 0 6px}
.doc .contact-card p{margin-bottom:6px}
.doc .contact-card p:last-child{margin-bottom:0}

/* ---------- a centred one-card page (friend / join / game) ----------------- */
.mini{min-height:100dvh;display:grid;place-items:center;padding:28px 20px}
.mini .card{max-width:460px;width:100%;text-align:center;padding:38px 28px}
.mini h1{font-size:40px;font-weight:900;margin:6px 0 8px;
  background:linear-gradient(180deg,#FFE9A8,var(--gold));-webkit-background-clip:text;background-clip:text;color:transparent}
.mini p{color:var(--muted);font-size:17px;margin-bottom:12px}
.mini .code{font-size:38px;font-weight:900;letter-spacing:10px;padding:14px 18px;margin:14px 0;
  display:inline-block;background:rgba(27,15,74,.28);border:1px solid var(--edge);border-radius:18px}
.mini .lion{width:118px;margin:0 auto;animation:floaty 4.5s ease-in-out infinite}

/* ---------- Windows high contrast / forced colours -------------------------
   Gradient-clipped text turns invisible when colours are forced, so those
   headings fall back to plain system text. */
@media (forced-colors:active){
  .brand span,.mini h1,.hero h1{
    background:none;-webkit-background-clip:border-box;background-clip:border-box;
    color:CanvasText;forced-color-adjust:none}
  .lang-switch .lang-menu a[aria-current="true"]{border:2px solid CanvasText}
  .lang-switch>summary{border:2px solid CanvasText}
  .skip-link{border:2px solid CanvasText}
}


/* 🇷🇺 Russian pages: Heebo has no Cyrillic, so body text would silently fall
   back to a system face and the page would read in two typefaces. Rubik — the
   display face everywhere else on the site — does have Cyrillic. */
html[lang="ru"] body,
html[lang="ru"] button,
html[lang="ru"] input,
html[lang="ru"] textarea,
html[lang="ru"] select{
  font-family:"Rubik","Heebo",-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}

/* 🇸🇦 Arabic pages: neither Heebo nor Rubik carries an Arabic glyph, so the page
   would be set in whatever fallback the device happens to have. Cairo does, and
   its Latin matches — so a line that mixes "Tofy" with Arabic stays one face. */
html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select{
  font-family:"Cairo","Heebo",-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}

