/* Home page for new visitors and search engines (index.html #landing).
   js/boot.js puts "landing-mode" or "app-mode" on <html> before the page is
   drawn: in landing mode only this page shows, in app mode only the app. */
.landing { display: none; }
html.landing-mode .landing { display: block; }
html.landing-mode .topbar,
html.landing-mode #view,
html.landing-mode .tabbar { display: none !important; }
html.redirecting body { visibility: hidden; }

.landing { color: var(--ink); font-size: 17px; line-height: 1.55; padding-bottom: env(safe-area-inset-bottom, 0); }
.landing a { color: var(--accent); }
.ld-top { max-width: 1040px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ld-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink) !important; text-decoration: none; }
.ld-nav { display: flex; gap: 6px; align-items: center; }
.ld-nav a { padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .92rem; text-decoration: none; }
.ld-nav a:last-child { box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); }
.ld-logo img { border-radius: 9px; }
.ld-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

.ld-hero { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; padding: 34px 0 10px; }
.ld-hero::before { content: ''; position: absolute; z-index: -1; inset: -40px -10vw auto auto; width: 70vw; max-width: 760px; height: 520px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, #9a5cf0 22%, transparent), transparent), radial-gradient(closest-side at 30% 60%, color-mix(in srgb, #22b38f 20%, transparent), transparent), radial-gradient(closest-side at 70% 30%, color-mix(in srgb, #4677e6 24%, transparent), transparent); filter: blur(10px); pointer-events: none; }
.ld-badge { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.ld-hero h1 { margin: 0 0 16px; font-size: clamp(2.1rem, 5.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.035em; }
.ld-lead { margin: 0 0 24px; font-size: 1.15rem; line-height: 1.6; color: var(--muted); max-width: 34em; }
.ld-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ld-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 800; font-size: 1.05rem; text-decoration: none; background: var(--ink); color: var(--bg) !important; transition: transform .12s, box-shadow .12s; }
.ld-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .14); }
.ld-btn.light { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--line); }
.ld-btn:active { transform: scale(.98); }
.ld-note { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }

/* The three sample cards next to the headline */
.ld-stack { position: relative; height: 380px; }
.ld-sample { position: absolute; width: min(270px, 78%); padding: 16px 18px 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 18px 40px rgba(20, 24, 40, .14), 0 0 0 1px var(--line); display: grid; gap: 6px; }
.ld-sample-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ld-sample-head img { border-radius: 7px; }
.ld-sample strong { font-size: 1.9rem; line-height: 1.15; letter-spacing: -.01em; }
.ld-sample > span:last-child { color: var(--muted); font-size: .95rem; }
.ld-s1 { top: 0; left: 4%; transform: rotate(-4deg); }
.ld-s2 { top: 120px; right: 0; transform: rotate(3deg); }
.ld-s3 { top: 236px; left: 12%; transform: rotate(-2deg); }
.ld-mini { display: grid; grid-template-columns: repeat(3, 34px); gap: 0; width: max-content; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.ld-mini i { display: grid; place-items: center; width: 34px; height: 34px; font-style: normal; font-weight: 800; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ld-mini i:nth-child(3n) { border-right: 0; }
.ld-mini i:nth-child(n + 7) { border-bottom: 0; }

/* Three areas */
.ld-sub { margin: -6px 0 18px; color: var(--muted); }
.ld-areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ld-area { padding: 22px; border-radius: 24px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.ld-area img { border-radius: 14px; margin-bottom: 14px; }
.ld-area h3 { margin: 0 0 6px; font-size: 1.2rem; }
.ld-area p { margin: 0 0 14px; color: var(--muted); font-size: .97rem; }
.ld-area .ld-area-links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; font-size: .95rem; }
.ld-area-links a { text-decoration: none; }
.ld-area-links a::after { content: ' →'; }
.ld-a-lang { background: linear-gradient(180deg, color-mix(in srgb, #4677e6 9%, var(--surface)), var(--surface) 55%); }
.ld-a-math { background: linear-gradient(180deg, color-mix(in srgb, #22b38f 9%, var(--surface)), var(--surface) 55%); }
.ld-a-games { background: linear-gradient(180deg, color-mix(in srgb, #9a5cf0 9%, var(--surface)), var(--surface) 55%); }
.ld-a-lang .ld-area-links a { color: #2f5bd8; }
.ld-a-math .ld-area-links a { color: #0f8a68; }
.ld-a-games .ld-area-links a { color: #8d3fb0; }

/* What you get: plain text in two columns, no tiles */
.ld-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; }
.ld-points h3 { margin: 0 0 4px; font-size: 1.08rem; }
.ld-points p { margin: 0; color: var(--muted); }

.ld-sec { margin: 64px 0 0; }
.ld-sec > h2, .ld-cta h2 { margin: 0 0 14px; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.12; letter-spacing: -.025em; }
.ld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ld-card { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; color: var(--ink) !important; text-decoration: none; }
a.ld-card { transition: transform .12s; }
a.ld-card:hover { transform: translateY(-2px); }
.ld-card h3 { margin: 6px 0 4px; font-size: 1.08rem; }
a.ld-card h3 { color: var(--accent); }
.ld-card p { margin: 0; font-size: .95rem; color: var(--muted); }
.ld-ico { font-size: 1.7rem; line-height: 1; }

.ld-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ld-steps li { counter-increment: s; position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 16px 60px; }
.ld-steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--on-grad); background: var(--grad-brand); }
.ld-steps strong { display: block; }
.ld-steps span { color: var(--muted); font-size: .95rem; }

.ld-links { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.ld-links a { display: block; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; text-decoration: none; }

.ld-faq details { border-bottom: 1px solid var(--line); padding: 16px 2px; }
.ld-faq summary { font-weight: 700; cursor: pointer; }
.ld-faq p { margin: 8px 0 0; color: var(--muted); }

.ld-cta { margin: 56px 0 0; padding: 34px 22px; border-radius: 28px; text-align: center; background: linear-gradient(115deg, #4677e6, #22b38f 55%, #9a5cf0); color: #fff; }
.ld-cta h2 { color: #fff; margin-bottom: 18px !important; }
.ld-cta .ld-btn { background: #fff; color: #1b1d24 !important; }
.ld-cta p { margin: 0 0 16px; }
.ld-foot { max-width: 1040px; margin: 0 auto; padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 32px); border-top: 1px solid var(--line); font-size: .9rem; }
.ld-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; }
.ld-foot a { color: var(--muted) !important; }
.ld-noscript { max-width: 640px; margin: 24px auto; padding: 0 16px; }

@media (max-width: 820px) {
  .ld-hero { grid-template-columns: 1fr; gap: 10px; }
  .ld-stack { height: 380px; max-width: 420px; width: 100%; margin: 0 auto 8px; }
  .ld-areas { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .landing { font-size: 16px; }
  .ld-hero { padding-top: 14px; }
  .ld-points { grid-template-columns: 1fr; gap: 16px; }
  .ld-sample strong { font-size: 1.6rem; }
  .ld-s2 { top: 110px; }
  .ld-s3 { top: 214px; }
  .ld-actions .ld-btn { flex: 1 1 100%; }
  .ld-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; }
  .ld-card .ld-ico { grid-row: span 2; margin-top: 4px; }
  .ld-card h3 { margin-top: 0; }
  .ld-card > :not(.ld-ico) { grid-column: 2; }
}
.ld-hero h1, .ld-sec > h2, .ld-cta h2 { text-wrap: balance; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ld-a-lang .ld-area-links a { color: #8fb0ff; }
  :root:not([data-theme="light"]) .ld-a-math .ld-area-links a { color: #5fd4b0; }
  :root:not([data-theme="light"]) .ld-a-games .ld-area-links a { color: #d39cf0; }
}
:root[data-theme="dark"] .ld-a-lang .ld-area-links a { color: #8fb0ff; }
:root[data-theme="dark"] .ld-a-math .ld-area-links a { color: #5fd4b0; }
:root[data-theme="dark"] .ld-a-games .ld-area-links a { color: #d39cf0; }
