/* Logi website design system.
   Tokens mirror the app: mobile/lib/app/design/logi_colors.dart (dark + light),
   logi_tokens.dart (spacing, radii, tap target) and logi_glow.dart (orange glow). */

@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-ExtraBold.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-Black.woff") format("woff"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Noto Sans Arabic"; src: url("../fonts/NotoSansArabic-Regular.woff") format("woff"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Noto Sans Arabic"; src: url("../fonts/NotoSansArabic-Bold.woff") format("woff"); font-weight: 700 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  /* dark (LogiColors.dark) */
  --bg: #0a0705;
  --surface: #16100c;
  --surface-2: #1e1510;
  --line: #2e2018;
  --text: #fff4e8;
  --muted: #b8a595;
  --orange: #ff7e00;
  --orange-deep: #e05a00;
  --orange-text: #ff7e00;
  --spark: #ffb347;
  --blue: #6aa8ff;
  --teal: #4dd8c4;
  --amber: #ffc04d;
  --violet: #c4a7ff;
  --rose: #ff9ec4;
  --green: #67cd67;
  --mistake: #ffd25e;
  --review: #ff5a4f;
  --user-bubble: #1474db;
  --user-bubble-edge: #5aa5f5;
  --ink: #1a0e08;
  --well: #4a1c06;
  --tile: rgba(74, 28, 6, .35);
  --glass: rgba(53, 24, 4, .55);
  --glass-line: rgba(255, 126, 0, .28);
  --header-bg: rgba(10, 7, 5, .72);
  --card-edge: rgba(255, 126, 0, .45);
  --glow: rgba(255, 126, 0, .55);
  --glow-soft: rgba(255, 126, 0, .22);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --hero-wash: radial-gradient(60% 55% at 72% 38%, rgba(255, 126, 0, .30), transparent 70%),
               radial-gradient(40% 40% at 10% 10%, rgba(106, 168, 255, .10), transparent 70%);

  /* LogiTokens */
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s20: 20px; --s24: 24px; --s32: 32px; --s48: 48px;
  --r-control: 14px; --r-card: 20px; --r-overlay: 24px; --r-bubble: 18px;
  --tap: 48px;
  --content: 1180px;
  --reading: 760px;

  --font: "Nunito", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* light (LogiColors.light) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f0dcbc;
  --surface: #f8ebd7;
  --surface-2: #fbf4e7;
  --line: #d3bd9c;
  --text: #2b1d16;
  --muted: #6a5a4e;
  --orange-text: #9a4106;
  --blue: #1a55b8;
  --teal: #006b64;
  --amber: #8a5600;
  --violet: #6544b5;
  --rose: #a12f64;
  --green: #236b23;
  --review: #b3261e;
  --user-bubble: #0e7c88;
  --user-bubble-edge: #22c3d3;
  --tile: #fbf4e7;
  --glass: rgba(251, 244, 231, .7);
  --glass-line: rgba(154, 65, 6, .22);
  --header-bg: rgba(240, 220, 188, .78);
  --card-edge: rgba(255, 126, 0, .38);
  --glow: rgba(255, 126, 0, .38);
  --glow-soft: rgba(255, 126, 0, .16);
  --shadow: 0 24px 50px -28px rgba(74, 28, 6, .45);
  --hero-wash: radial-gradient(60% 55% at 72% 38%, rgba(255, 126, 0, .26), transparent 70%),
               radial-gradient(40% 40% at 10% 10%, rgba(255, 255, 255, .55), transparent 70%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f0dcbc; --surface: #f8ebd7; --surface-2: #fbf4e7; --line: #d3bd9c;
    --text: #2b1d16; --muted: #6a5a4e; --orange-text: #9a4106;
    --blue: #1a55b8; --teal: #006b64; --amber: #8a5600; --violet: #6544b5; --rose: #a12f64; --green: #236b23; --review: #b3261e;
    --user-bubble: #0e7c88; --user-bubble-edge: #22c3d3; --tile: #fbf4e7;
    --glass: rgba(251, 244, 231, .7); --glass-line: rgba(154, 65, 6, .22);
    --header-bg: rgba(240, 220, 188, .78); --card-edge: rgba(255, 126, 0, .38);
    --glow: rgba(255, 126, 0, .38); --glow-soft: rgba(255, 126, 0, .16);
    --shadow: 0 24px 50px -28px rgba(74, 28, 6, .45);
    --hero-wash: radial-gradient(60% 55% at 72% 38%, rgba(255, 126, 0, .26), transparent 70%),
                 radial-gradient(40% 40% at 10% 10%, rgba(255, 255, 255, .55), transparent 70%);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(ar) body, body:lang(ar) { font-family: "Noto Sans Arabic", var(--font); }
img { max-width: 100%; height: auto; display: block; }
.fade-bottom { -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
picture { display: contents; }
source { display: none; }
[hidden] { display: none !important; }
a { color: var(--orange-text); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 900; text-wrap: balance; overflow-wrap: break-word; }
:lang(ar) :is(h1, h2, h3, h4) { letter-spacing: 0; line-height: 1.35; }
p { margin: 0 0 1em; text-wrap: pretty; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 12px 18px; border-radius: var(--r-control); background: var(--orange); color: var(--ink); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 40px, var(--content)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .6); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s16); min-height: 68px; }
.brand { display: inline-flex; align-items: center; min-height: var(--tap); border-radius: 12px; }
.brand img { width: 92px; height: auto; transition: transform .4s var(--ease-spring); }
.brand:hover img { transform: rotate(-4deg); }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s4); }
.nav-links { display: flex; gap: var(--s4); list-style: none; margin: 0; padding: 0; }
.nav-links a, .nav-menu summary {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .98rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-menu summary:hover { background: var(--glow-soft); }
.nav-links a[aria-current="page"] { color: var(--orange-text); }
.nav-menu { position: relative; display: none; }
.nav-menu summary { list-style: none; gap: 8px; border: 1px solid var(--line); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] .nav-links {
  display: flex; flex-direction: column; position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 220px; padding: 8px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer;
  transition: background .2s, transform .3s var(--ease-spring);
}
.icon-btn:hover { background: var(--glow-soft); transform: rotate(-12deg); }
.icon-btn svg { width: 22px; height: 22px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; }
}
.lang-switch { display: inline-flex; gap: 4px; }
.lang-switch a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 700; border: 1px solid var(--line); }
.lang-switch a[aria-current="true"] { background: var(--orange); color: var(--ink); border-color: transparent; }
.lang-switch a[aria-current="true"]::before { content: "✓"; margin-inline-end: 4px; }
.lang-switch .code { display: none; }

@media (max-width: 900px) {
  .nav > .nav-links { display: none; }
  .nav-menu { display: block; }
}
@media (max-width: 560px) {
  .site-header .wrap { gap: 8px; width: min(100% - 24px, var(--content)); }
  .brand img { width: 76px; }
  .nav { gap: 2px; }
  .nav-menu summary { padding: 0; width: var(--tap); justify-content: center; }
  .nav-menu summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lang-switch a { padding: 0 10px; min-width: var(--tap); justify-content: center; }
  .lang-switch .full { display: none; }
  .lang-switch .code { display: inline; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: linear-gradient(180deg, #e46400, #b84400);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 999px; border: 0;
  background: var(--btn-bg); color: #fff; font: 800 1.1875rem/1 var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 179, 71, .45) inset, 0 10px 30px -8px var(--glow), 0 0 40px -6px var(--glow-soft);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 0 1px rgba(255, 179, 71, .6) inset, 0 16px 40px -8px var(--glow), 0 0 60px -6px var(--glow); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-ghost { --btn-bg: transparent; color: var(--text); box-shadow: 0 0 0 1.5px var(--line) inset; font-size: 1.0625rem; font-weight: 800; }
.btn-ghost:hover { box-shadow: 0 0 0 1.5px var(--orange) inset; }
.btn svg { width: 20px; height: 20px; flex: none; }

.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; min-width: 190px; padding: 8px 20px 8px 16px;
  border-radius: 16px; background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, .22);
  text-decoration: none; cursor: default; user-select: none;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .9);
}
.store-badge svg { width: 28px; height: 28px; flex: none; }
.store-badge span { display: grid; line-height: 1.15; }
.store-badge small { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #ffc98f; }
.store-badge strong { font-size: 1.15rem; font-weight: 800; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line); font-weight: 800; font-size: .9rem; color: var(--text);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.soon { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; color: var(--ink); background: var(--amber); vertical-align: middle; }
:root[data-theme="light"] .soon { color: #fff; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .soon { color: #fff; } }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding-block: clamp(72px, 10vw, 140px); }
.eyebrow { display: inline-block; margin-bottom: 14px; font-weight: 900; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-text); }
:lang(ar) .eyebrow { letter-spacing: 0; }
.section-head { max-width: 720px; margin: 0 auto clamp(40px, 6vw, 72px); text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.section-head p { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.glow-text {
  background: linear-gradient(180deg, #ffc23d 0%, #ff7e00 55%, #e05a00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px var(--glow-soft));
}
:root[data-theme="light"] .glow-text { background-image: linear-gradient(180deg, #d96a00, #9a4106); filter: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .glow-text { background-image: linear-gradient(180deg, #d96a00, #9a4106); filter: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(32px, 6vw, 80px) clamp(60px, 8vw, 110px); overflow: clip; }
.hero::before { content: ""; position: absolute; inset: -20% -10% 0; background: var(--hero-wash); pointer-events: none; z-index: -1; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(24px, 4vw, 56px); }
.hero h1 { font-size: clamp(2.15rem, 5vw, 4.4rem); margin: 22px 0 22px; line-height: 1.02; }
.hero .lead { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: var(--muted); max-width: 34ch; margin-bottom: 32px; }
.hero .lead strong { color: var(--text); }
.hero-actions { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 30px 0 0; padding: 0; list-style: none; color: var(--muted); font-weight: 700; font-size: .95rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { width: 18px; height: 18px; color: var(--green); }

.hero-stage { position: relative; aspect-ratio: 1 / 1.08; max-width: 600px; margin-inline: auto; width: 100%; }
.hero-halo {
  position: absolute; inset: 8% 6% 14%; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 126, 0, .55), rgba(255, 126, 0, .12) 55%, transparent 70%);
  filter: blur(8px);
  animation: halo 6s ease-in-out infinite;
}
.hero-ring { position: absolute; inset: 6% 4% 12%; border-radius: 50%; border: 2px dashed rgba(255, 126, 0, .35); animation: spin 60s linear infinite; }
.hero-ring.r2 { inset: 16% 14% 22%; border-style: solid; border-color: rgba(255, 179, 71, .18); animation-duration: 90s; animation-direction: reverse; }
.hero-floor { position: absolute; left: 22%; right: 22%; bottom: 3%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 126, 0, .55), transparent); filter: blur(6px); }
.hero-fox { position: absolute; inset: 0 8% 4%; display: grid; place-items: end center; will-change: transform; }
.hero-fox img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; animation: bob 5s ease-in-out infinite; }
.hello {
  position: absolute; z-index: 2; padding: 10px 16px; border-radius: 18px; font-weight: 800; font-size: clamp(.9rem, 1.4vw, 1.1rem);
  background: var(--surface); color: var(--text); border: 1px solid var(--card-edge);
  box-shadow: 0 0 24px -6px var(--glow), var(--shadow); white-space: nowrap; will-change: transform;
  animation: float 6s ease-in-out infinite;
}
.hello::after { content: ""; position: absolute; bottom: -7px; inset-inline-start: 22px; width: 14px; height: 14px; background: inherit; border: inherit; border-top: 0; border-inline-start: 0; transform: rotate(45deg); }
.hello.is-logi { background: linear-gradient(180deg, #d65a00, #a83e00); color: #fff; border-color: rgba(255, 179, 71, .5); }
.hello.h1 { top: 12%; left: 0; }
.hello.h2 { top: 4%; right: 4%; animation-delay: -1.5s; }
.hello.h3 { top: 40%; right: -3%; animation-delay: -3s; }
.hello.h3::after { left: auto; right: 22px; }
.hello.h4 { top: 54%; left: -5%; animation-delay: -4.2s; }
.hello.h5 { bottom: 16%; right: 2%; animation-delay: -2.2s; }
.sparkle { position: absolute; width: 18px; height: 18px; color: var(--spark); animation: twinkle 2.8s ease-in-out infinite; }
.sparkle.s1 { top: 26%; inset-inline-start: 18%; }
.sparkle.s2 { top: 18%; inset-inline-end: 24%; animation-delay: -1s; width: 12px; height: 12px; }
.sparkle.s3 { bottom: 30%; inset-inline-start: 10%; animation-delay: -2s; width: 14px; height: 14px; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes halo { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-actions { align-items: center; }
  .store-badges, .hero-facts { justify-content: center; }
  .hero-stage { max-width: 420px; order: -1; margin-top: 8px; }
  .hero h1 { margin-top: 6px; }
}
@media (max-width: 420px) {
  .hello { font-size: .82rem; padding: 7px 11px; }
  .hello.h4, .hello.h5 { display: none; }
}

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; padding: 18px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 50s linear infinite; }
.marquee span { font-weight: 900; font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: var(--muted); white-space: nowrap; }
.marquee span:nth-child(3n+1) { color: var(--orange-text); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ---------- Chat demo ---------- */
.demo-grid { display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: clamp(32px, 6vw, 80px); align-items: center; }
.demo-copy h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.demo-copy > p { color: var(--muted); font-size: 1.15rem; }
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.checks li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.checks .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--glass-line); }
.checks .ic img { width: 28px; height: 28px; }
.checks strong { display: block; font-size: 1.1rem; }
.checks span { color: var(--muted); }

.chat-card {
  position: relative; border-radius: 28px; background: var(--surface); border: 1px solid var(--card-edge);
  box-shadow: 0 0 0 6px rgba(255, 126, 0, .05), 0 0 60px -20px var(--glow), var(--shadow);
  padding: 18px 16px 16px; margin-top: 96px;
}
.chat-card .peek { position: absolute; z-index: -1; width: 182px; top: -122px; inset-inline-end: 26px; pointer-events: none; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 2px 4px 14px; border-bottom: 1px solid var(--line); }
.chat-top img { width: 40px; height: 40px; border-radius: 50%; background: var(--well); object-fit: cover; }
.chat-top b { display: block; line-height: 1.1; }
.chat-top small { color: var(--muted); font-weight: 700; }
.chat-top .live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-inline-end: 6px; }
.demo-tabs { display: flex; gap: 6px; margin: 14px 0 6px; flex-wrap: wrap; }
.demo-tabs button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font: 800 .92rem var(--font); cursor: pointer; position: relative;
}
.demo-tabs button::after { content: ""; position: absolute; inset: -4px 0; } /* 48px hit area */
.demo-tabs button[aria-selected="true"] { background: var(--orange); color: var(--ink); border-color: transparent; }
.demo-tabs button[aria-selected="true"]::before { content: "✓ "; }
.chat-log { display: flex; flex-direction: column; gap: 10px; min-height: 390px; padding: 12px 2px 4px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: var(--r-bubble); font-size: 1rem; line-height: 1.45; position: relative; }
.msg.logi { align-self: flex-start; color: #fff; background: linear-gradient(180deg, #c54a00, #a83e00); border-end-start-radius: 6px; box-shadow: 0 0 22px -8px var(--glow); }
.msg.logi .tr { display: block; margin-top: 4px; font-size: .86rem; opacity: .88; }
.msg.user { align-self: flex-end; color: #fff; background: var(--user-bubble); border: 1px solid var(--user-bubble-edge); border-end-end-radius: 6px; }
.msg .mistake { text-decoration: underline wavy var(--mistake); text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.fix {
  align-self: flex-end; max-width: 92%; display: grid; gap: 4px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px dashed var(--mistake); font-size: .95rem;
}
:root[data-theme="light"] .fix { border-color: #b07a00; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .fix { border-color: #b07a00; } }
.fix .label { font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fix .label svg { width: 14px; height: 14px; }
.fix .swap { font-weight: 800; }
.fix del { color: var(--muted); text-decoration-color: var(--review); text-decoration-thickness: 2px; }
.fix ins { text-decoration: none; color: var(--green); }
.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: var(--r-bubble); background: var(--surface-2); border: 1px solid var(--line); }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: dot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.pop { animation: pop .5s var(--ease-spring) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
.chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 700; }
.replay { min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 800 .9rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.replay svg { width: 16px; height: 16px; }
.replay:hover { border-color: var(--orange); }

@media (max-width: 900px) {
  .demo-grid { grid-template-columns: 1fr; }
  .chat-card { margin-top: 110px; }
}

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); counter-reset: step; position: relative; }
.step {
  position: relative; overflow: hidden; padding: 0 26px 30px; border-radius: var(--r-overlay); background: var(--surface);
  border: 1px solid var(--line); text-align: center; transition: transform .4s var(--ease-spring), border-color .3s, box-shadow .3s;
}
.step:hover { transform: translateY(-6px); border-color: var(--card-edge); box-shadow: 0 0 40px -16px var(--glow); }
.step .num {
  position: absolute; z-index: 1; top: 18px; inset-inline-start: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; color: var(--ink); background: linear-gradient(180deg, #ffb347, #ff7e00); box-shadow: 0 0 18px -2px var(--glow);
}
.step .art {
  display: flex; align-items: flex-end; justify-content: center; height: 178px; margin: 0 -26px 24px;
  background: radial-gradient(55% 85% at 50% 100%, rgba(255, 126, 0, .34), transparent 72%);
  border-bottom: 2px solid var(--card-edge);
}
.step .art img { width: auto; height: 140px; transition: transform .5s var(--ease-spring); }
.step:hover .art img { transform: translateY(-6px); }
.step h3 { font-size: 1.4rem; }
.step p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }

/* ---------- Features (bento) ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.card {
  position: relative; overflow: hidden; padding: 28px; border-radius: var(--r-overlay); background: var(--surface);
  border: 1px solid var(--line); transition: transform .35s var(--ease-out), border-color .3s, box-shadow .3s;
  --mx: 50%; --my: 0%;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx) var(--my), var(--glow-soft), transparent 60%);
}
.card:hover { border-color: var(--card-edge); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card h3 { font-size: 1.45rem; margin-top: 14px; }
.card p { color: var(--muted); margin: 0; }
.card .icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--tile); border: 1px solid var(--glass-line); }
.card .icon img { width: 34px; height: 34px; }
.c-convo { grid-column: span 4; grid-row: span 2; display: flex; flex-direction: column; }
.c-fix { grid-column: span 2; }
.c-words { grid-column: span 2; }
.c-voice { grid-column: span 3; }
.c-grammar { grid-column: span 3; }
.c-progress { grid-column: span 3; }
.c-memory { grid-column: span 3; }
.mini-chat { margin-top: auto; margin-inline-start: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 10px; width: min(100%, 470px); max-width: calc(100% - 200px); }
.mini-chat .msg { font-size: .98rem; max-width: 100%; }
.c-convo .point { position: absolute; width: 230px; inset-inline-start: 0; bottom: -1px; transform-origin: 50% 100%; transition: transform .5s var(--ease-spring); }
.c-convo:hover .point { transform: translateY(-4px) rotate(-2deg); }
.c-convo .head { max-width: 62ch; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.word-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line); }
.word-chip i { font-style: normal; font-size: .72rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; color: var(--ink); }
.word-chip .new { background: #6aa8ff; }
.word-chip .learning { background: #ffc04d; }
.word-chip .familiar { background: #4dd8c4; }
.word-chip .mastered { background: #67cd67; }
.card .wave-demo { margin: 18px 0 6px; color: var(--text); font-size: 1.15rem; font-weight: 700; }
.card .wave-fixed { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 800; color: var(--green); }
.wave-fixed svg { width: 18px; height: 18px; }
.wave-demo .mistake { text-decoration: underline wavy var(--mistake); text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
:root[data-theme="light"] .wave-demo .mistake { text-decoration-color: #b07a00; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .wave-demo .mistake { text-decoration-color: #b07a00; } }
.voice-wave { display: flex; align-items: center; gap: 5px; height: 48px; margin-top: 18px; }
.voice-wave i { width: 6px; border-radius: 6px; background: linear-gradient(180deg, #ffb347, #ff7e00); animation: eq 1.1s ease-in-out infinite; height: 30%; }
.voice-wave i:nth-child(2n) { animation-delay: -.3s; }
.voice-wave i:nth-child(3n) { animation-delay: -.6s; }
.voice-wave i:nth-child(5n) { animation-delay: -.8s; }
@keyframes eq { 0%, 100% { height: 22%; } 50% { height: 100%; } }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.badge-row img { width: 40px; height: 40px; object-fit: contain; padding: 6px; border-radius: 12px; background: var(--tile); border: 1px solid var(--glass-line); transition: transform .3s var(--ease-spring); }
.card:hover .badge-row img { transform: translateY(-3px); }
.card:hover .badge-row img:nth-child(2) { transition-delay: .05s; }
.card:hover .badge-row img:nth-child(3) { transition-delay: .1s; }
@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .c-convo { grid-column: span 2; grid-row: auto; }
  .c-fix, .c-words, .c-voice, .c-grammar, .c-progress, .c-memory { grid-column: span 1; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .c-convo, .c-fix, .c-words, .c-voice, .c-grammar, .c-progress, .c-memory { grid-column: auto; }
  .mini-chat { max-width: none; padding-bottom: 150px; }
  .c-convo .point { width: 170px; }
}

/* ---------- Languages ---------- */
.lang-wrap { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.lang-wrap h2, .meet h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.lang-wrap .lead-p { color: var(--muted); font-size: 1.15rem; }
.lang-wrap .fox { max-width: 304px; margin-inline: auto; }
.lang-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 42%), 1fr)); gap: 10px; }
.lang-grid li {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--ease-spring), border-color .2s;
}
.lang-grid li:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--card-edge); }
.lang-grid b { font-size: 1.15rem; }
.lang-grid span { color: var(--muted); font-size: .9rem; font-weight: 700; }
.lang-note { margin-top: 22px; color: var(--muted); }
@media (max-width: 820px) { .lang-wrap { grid-template-columns: 1fr; text-align: center; } .lang-wrap .fox { max-width: 240px; } .lang-grid { text-align: start; } }

/* ---------- Meet Logi ---------- */
.meet { overflow: clip; }
.meet-card {
  position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(20px, 4vw, 60px); align-items: center;
  padding: clamp(28px, 5vw, 64px); border-radius: 36px;
  background: radial-gradient(80% 90% at 20% 60%, rgba(255, 126, 0, .28), transparent 70%), var(--surface);
  border: 1px solid var(--card-edge); box-shadow: 0 0 80px -30px var(--glow);
}
.meet-fox { position: relative; max-width: 320px; margin-inline: auto; }
.meet-fox img { animation: bob 6s ease-in-out infinite; }
.meet-fox img { margin-inline: auto; }
.meet h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.traits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
.trait { padding: 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); }
.trait b { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.trait span { color: var(--muted); font-size: .98rem; }
.poses { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.poses button {
  width: 76px; height: 76px; padding: 6px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  transition: transform .3s var(--ease-spring), border-color .2s;
}
.poses button:hover { transform: translateY(-4px) rotate(-4deg); }
.poses button[aria-pressed="true"] { border: 2px solid var(--orange); box-shadow: 0 0 20px -6px var(--glow); }
.poses img { width: 100%; height: 100%; object-fit: contain; }
.pose-caption { margin-top: 10px; color: var(--muted); font-weight: 700; min-height: 1.6em; }
@media (max-width: 820px) { .meet-card { grid-template-columns: 1fr; text-align: center; } .traits { text-align: start; } .poses { justify-content: center; } .meet-fox { max-width: 260px; } }
@media (max-width: 480px) { .traits { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.faq-side { position: sticky; top: 110px; }
.faq-side img { width: 200px; margin-top: 18px; }
.faq-side h2 { font-size: clamp(2rem, 4vw, 3rem); }
.faq-side p { color: var(--muted); }
.faq { display: grid; gap: 12px; }
.faq details { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.faq details[open] { border-color: var(--card-edge); }
.faq summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 14px 20px; cursor: pointer; font-weight: 800; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--glow-soft); color: var(--orange-text); transition: transform .3s var(--ease-spring); }
.faq details[open] .pm { transform: rotate(45deg); }
.faq .answer { padding: 0 20px 18px; color: var(--muted); }
.faq .answer p:last-child { margin: 0; }
@media (max-width: 860px) { .faq-wrap { grid-template-columns: 1fr; } .faq-side { position: static; text-align: center; } .faq-side img { margin-inline: auto; width: 150px; } }

/* ---------- Final CTA ---------- */
.cta-card {
  position: relative; margin-top: clamp(220px, 26vw, 300px); padding: clamp(48px, 6vw, 72px) clamp(24px, 5vw, 64px);
  border-radius: 40px; text-align: center; overflow: visible;
  background: radial-gradient(70% 120% at 50% 0%, rgba(255, 126, 0, .45), transparent 70%), linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--card-edge); box-shadow: 0 0 100px -30px var(--glow);
}
.cta-card .hang { position: absolute; width: min(400px, 78%); bottom: calc(100% - 16px); left: 50%; transform: translateX(-50%); pointer-events: none; }
[dir="rtl"] .cta-card .hang { transform: translateX(50%); left: auto; right: 50%; }
.cta-card h2 { font-size: clamp(2.1rem, 5vw, 3.8rem); }
.cta-card p { color: var(--muted); font-size: 1.15rem; max-width: 46ch; margin-inline: auto; }
.cta-card .store-badges { justify-content: center; margin-top: 28px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: clamp(80px, 10vw, 120px); padding: 56px 0 40px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wpeek { position: absolute; width: 98px; top: -82px; inset-inline-end: clamp(20px, 8vw, 120px); pointer-events: none; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-grid img.mark { width: 110px; margin-bottom: 12px; }
.foot-grid p { color: var(--muted); max-width: 36ch; }
.foot-grid h2 { font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; }
.foot-grid ul a { display: inline-flex; align-items: center; min-height: 48px; color: var(--text); text-decoration: none; font-weight: 700; }
.foot-grid ul a:hover { color: var(--orange-text); text-decoration: underline; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Hero intro (CSS only, so the first screen never waits for JS) ---------- */
.intro { animation: intro .9s var(--ease-out) both; animation-delay: var(--d, 0s); }
.intro-scale { animation: intro-scale 1.1s var(--ease-spring) .1s both; }
@keyframes intro { from { opacity: 0; transform: translateY(24px); } }
@keyframes intro-scale { from { opacity: 0; transform: scale(.9); } }

/* ---------- Reveal on scroll (only with JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-scale { opacity: 0; transform: scale(.92); transition: opacity .8s var(--ease-out), transform .9s var(--ease-spring); transition-delay: var(--d, 0s); }
.js .reveal-scale.is-in { opacity: 1; transform: none; }

/* ---------- Page (support, legal, 404) ---------- */
.page-hero { padding-block: clamp(36px, 6vw, 72px) clamp(24px, 4vw, 40px); overflow: clip; }
.page-hero::before { content: ""; position: absolute; inset: -40% -10% 0; background: radial-gradient(50% 60% at 80% 30%, var(--glow-soft), transparent 70%); pointer-events: none; z-index: -1; }
.page-hero .wrap { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 10px; }
.page-hero p { color: var(--muted); font-size: 1.15rem; margin: 0; max-width: 56ch; }
.page-hero .fox { width: clamp(120px, 18vw, 220px); }
@media (max-width: 640px) { .page-hero .wrap { grid-template-columns: 1fr; } .page-hero .fox { order: -1; width: 140px; } }

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.help-grid .card h2 { font-size: 1.35rem; margin-top: 14px; }
.help-grid .card ol { color: var(--muted); padding-inline-start: 1.2em; margin: 12px 0 0; }
.help-grid .card .btn { margin-top: 18px; min-height: 48px; font-size: 1rem; padding: 0 20px; }
@media (max-width: 900px) { .help-grid { grid-template-columns: 1fr; } }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; border: 1.5px solid var(--amber); background: rgba(255, 192, 77, .10); }
.notice svg { width: 22px; height: 22px; flex: none; color: var(--amber); margin-top: 2px; }
.notice p { margin: 0; }
.notice strong { color: var(--text); }

/* Legal layout */
.legal { display: grid; grid-template-columns: 240px minmax(0, var(--reading)); gap: clamp(24px, 4vw, 56px); justify-content: center; padding-bottom: 40px; }
.toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.toc h2 { display: inline; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.toc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 6px; cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-weight: 900; color: var(--orange-text); transition: transform .3s; }
.toc details[open] summary::after { transform: rotate(45deg); }
@media (min-width: 961px) { .toc summary { pointer-events: none; } .toc summary::after { display: none; } }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.35; }
.toc a:hover, .toc a.is-active { background: var(--glow-soft); color: var(--orange-text); }
.prose { min-width: 0; padding: clamp(22px, 4vw, 44px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.prose :is(h1, h2, h3) { hyphens: auto; }
.prose h2 { font-size: 1.55rem; margin-top: 2em; padding-top: .4em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; }
.prose h4 { font-size: 1.05rem; margin-top: 1.4em; }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--orange-text); font-weight: 800; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.prose blockquote { margin: 1.2em 0; padding: 14px 18px; border-inline-start: 4px solid var(--orange); border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.2em; border-radius: 14px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: 10px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 800; }
.prose tr:last-child td { border-bottom: 0; }
.prose .draft { margin-bottom: 1.6em; }
.notice details { margin-top: 6px; }
.notice summary { cursor: pointer; font-weight: 800; color: var(--orange-text); min-height: 32px; display: inline-flex; align-items: center; }
.notice details > div { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.notice details p { margin: 0 0 .6em; }
.prose .todo { background: rgba(255, 192, 77, .18); border-radius: 6px; padding: 0 4px; outline: 1px dashed var(--amber); }
.legal-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.legal-meta .back { font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); gap: 6px; }
@media (max-width: 960px) { .legal { grid-template-columns: 1fr; } .toc { position: static; max-height: none; } }

.e404 { text-align: center; padding-block: clamp(48px, 10vw, 120px); }
.e404 img { width: min(280px, 80%); margin: 0 auto 10px; }
.e404 h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.e404 p { color: var(--muted); font-size: 1.15rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .reveal-scale { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; row-gap: 8px; }
  .marquee-track [aria-hidden="true"] { display: none; }
}

@media print {
  .site-header, .site-footer, .toc, .hero-stage { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { border: 0; padding: 0; }
}
