/* ============================================================================
   Ludyem, the shared design system
   One stylesheet, reused by every app page under ludyem.dev.
   Per-app theming: override --accent1 / --accent2 / --grad-a / --grad-b in a
   small inline <style>:root{}</style> AFTER linking this file. Nothing else
   needs to change between apps.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces (shared across the whole constellation) */
  --bg:       #07070f;
  --bg2:      #0b0b16;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --faint:    #475569;
  --card:     rgba(255,255,255,0.04);
  --border:   rgba(255,255,255,0.08);
  --radius:   16px;

  /* Accents. DEFAULT is the Ludyem brand (indigo to violet).
     App pages override these four to re-skin every component at once. */
  --accent1:  #6d6cff;
  --accent2:  #b06cff;
  --grad-a:   #9aa6ff;   /* gradient text start */
  --grad-b:   #d29bff;   /* gradient text end   */
  --accent-soft: rgba(109,108,255,0.14);
  --accent-line: rgba(109,108,255,0.30);
}

html { scroll-behavior: auto; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; }

/* ── Gradient orbs ── */
.orb { display: none; }
.orb-1 { width: 700px; height: 700px; background: var(--accent1); top: -250px; left: -150px; }
.orb-2 { width: 550px; height: 550px; background: var(--accent2); top: 400px; right: -180px; }
.orb-3 { width: 450px; height: 450px; background: var(--grad-b);  bottom: 0; left: 25%; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
section {
  padding: 100px 0;
}
.text-center { text-align: center; }
.text-center .section-sub { margin: 0 auto; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100; padding: 16px 0;
  background: rgba(7,7,15,0.92);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo img, .logo .logo-mark { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff; font-weight: 800; font-size: 17px;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.btn-nav {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff; border: none; border-radius: 50px; padding: 9px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: opacity .2s;
}
.btn-nav:hover { opacity: .85; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.back-link:hover { color: var(--text); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ── Hero ── */
.hero { padding: 140px 0 100px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 50px; padding: 6px 16px; font-size: 13px;
  color: var(--grad-a); margin-bottom: 32px; font-weight: 500;
}
.hero-badge-dot { width: 6px; height: 6px; background: var(--grad-a); border-radius: 50%; }
h1 { font-size: clamp(44px, 7vw, 82px); font-weight: 800; line-height: 1.06; letter-spacing: -2.5px; margin-bottom: 24px; }
.grad { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: clamp(17px, 2.5vw, 21px); color: var(--muted); max-width: 600px; margin: 0 auto 44px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-art { margin: 56px auto 0; max-width: 240px; display: block; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff; text-decoration: none; border-radius: 50px; padding: 16px 32px;
  font-size: 16px; font-weight: 700;
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.btn-secondary:hover { color: var(--text); }

/* ── Stats bar ── */
.stats-bar { display: flex; align-items: stretch; flex-wrap: wrap; margin-top: 80px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-item { flex: 1; min-width: 160px; padding: 28px 20px; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 34px; font-weight: 800; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) { .stat-item { border-right: none; border-bottom: 1px solid var(--border); } .stat-item:last-child { border-bottom: none; } }

/* ── Section headings ── */
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent1); margin-bottom: 12px; }
.section-title { font-size: clamp(30px, 4vw, 50px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 16px; }
.section-sub { font-size: 18px; color: var(--muted); max-width: 560px; line-height: 1.65; }

/* ── Feature grid ── */
.alt { background: var(--bg2); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; margin-top: 64px; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: border-color .3s, transform .3s; }
.feature-card:hover { border-color: var(--accent-line); transform: translateY(-4px); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 20px; background: var(--accent-soft); }
.feature-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.feature-card p  { font-size: 15px; color: var(--muted); line-height: 1.65; }

/* ── App cards (landing grid + family hub) ── */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; margin-top: 56px; }
.app-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 30px; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--text); transition: border-color .3s, transform .3s;
  scroll-margin-top: 90px;
}
.app-card:hover { border-color: var(--app, var(--accent1)); transform: translateY(-4px); }
.app-card .app-icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden; background: color-mix(in srgb, var(--app, var(--accent1)) 18%, transparent);
}
.app-card .app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-card h3 { font-size: 20px; font-weight: 700; }
.app-card .app-blurb { font-size: 15px; color: var(--muted); line-height: 1.6; flex: 1; }
.app-card .app-foot { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--app, var(--accent1)); }
.app-card .badge-soon { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); background: var(--border); border-radius: 50px; padding: 4px 10px; }
.app-card.is-soon { cursor: default; }
.app-card.is-soon:hover { transform: none; border-color: var(--border); }

/* App Store download button (Apple-style) */
.appstore-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #000; text-decoration: none; border-radius: 12px;
  padding: 11px 18px; font-weight: 600; font-size: 15px; transition: transform .2s, opacity .2s;
}
.appstore-btn:hover { transform: translateY(-2px); }
.appstore-btn.is-disabled { background: var(--card); color: var(--muted); border: 1px solid var(--border); pointer-events: none; }
.appstore-btn small { display: block; font-size: 10px; font-weight: 500; opacity: .7; line-height: 1; }
.appstore-btn .as-lines { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.appstore-btn .as-big { font-size: 16px; font-weight: 700; }
.dl-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── CTA ── */
.cta { text-align: center; }
.cta-card { background: linear-gradient(160deg, var(--accent-soft), rgba(255,255,255,.02)); border: 1px solid var(--accent-line); border-radius: 32px; padding: 88px 40px; }
.cta-card h2 { font-size: clamp(32px, 5vw, 58px); font-weight: 800; letter-spacing: -1.5px; margin-bottom: 16px; }
.cta-card p { font-size: 18px; color: var(--muted); margin-bottom: 44px; }
.cta-note { font-size: 13px; color: var(--faint); margin-top: 22px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 44px 0; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-logo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--muted); text-decoration: none; }
.footer-logo .logo-mark { width: 22px; height: 22px; border-radius: 5px; font-size: 12px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--faint); text-decoration: none; font-size: 14px; transition: color .2s; }
.footer-links a:hover { color: var(--muted); }
.footer-copy { font-size: 13px; color: var(--faint); }

/* ============================================================================
   Legal / support / doc pages (privacy, terms, support), narrow column
   ========================================================================== */
.doc-main { max-width: 800px; margin: 0 auto; padding: 80px 24px 120px; position: relative; z-index: 1; }
.doc-main .nav-inner { max-width: 800px; }
.page-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent2); margin-bottom: 12px; }
.doc-main h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 12px; }
.subtitle { font-size: 18px; color: var(--muted); margin-bottom: 56px; line-height: 1.6; }
.doc-body h2 { font-size: 22px; font-weight: 700; margin: 44px 0 14px; letter-spacing: -.5px; }
.doc-body h3 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; }
.doc-body p, .doc-body li { font-size: 15px; color: var(--muted); line-height: 1.75; }
.doc-body p { margin-bottom: 14px; }
.doc-body ul { margin: 0 0 14px 22px; }
.doc-body li { margin-bottom: 8px; }
.doc-body strong { color: var(--text); }
.doc-body a { color: var(--accent2); text-decoration: none; }
.doc-body a:hover { text-decoration: underline; }
.doc-body .updated { font-size: 13px; color: var(--faint); margin-bottom: 40px; }

/* Contact card (support) */
.contact-card { background: linear-gradient(135deg, var(--accent-soft), rgba(255,255,255,.02)); border: 1px solid var(--accent-line); border-radius: 20px; padding: 36px; margin-bottom: 60px; display: flex; gap: 24px; align-items: flex-start; }
.contact-icon { font-size: 36px; flex-shrink: 0; }
.contact-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.contact-card p { font-size: 15px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.btn-contact { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent1), var(--accent2)); color: #fff; text-decoration: none; border-radius: 50px; padding: 12px 24px; font-size: 14px; font-weight: 700; transition: opacity .2s; }
.btn-contact:hover { opacity: .85; }

/* FAQ accordion */
.faq-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent2); margin-bottom: 24px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color .2s; }
details[open] { border-color: var(--accent-line); }
summary { padding: 22px 24px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
.summary-icon { font-size: 20px; color: var(--muted); flex-shrink: 0; transition: transform .2s; }
details[open] .summary-icon { transform: rotate(45deg); color: var(--accent2); }
.faq-body { padding: 0 24px 22px; font-size: 15px; color: var(--muted); line-height: 1.7; }
.faq-body p { margin-bottom: 10px; }
.faq-body p:last-child { margin-bottom: 0; }
.faq-body a { color: var(--accent2); text-decoration: none; }
.faq-body a:hover { text-decoration: underline; }

.doc-foot { border-top: 1px solid var(--border); padding: 40px 24px; text-align: center; }
.doc-foot p { font-size: 13px; color: var(--faint); margin: 0; }
.doc-foot a { color: var(--faint); margin: 0 12px; text-decoration: none; }
.doc-foot a:hover { color: var(--muted); }

@media (max-width: 700px) {
  .orb { display: none; }
  section { padding: 56px 0; }
  .hero { padding: 80px 0 52px; }
  .cta-card { padding: 56px 24px; }
  .doc-main { padding: 48px 24px 72px; }
}

/* ============================================================================
   Blog / articles. Reuses .doc-main + .doc-body; adds post chrome, an
   honest comparison table, callouts, an author box and the index cards.
   Additive only (new class names), so it never touches another app's pages.
   ========================================================================== */
.post-main { max-width: 760px; }
.post-main .doc-body h2 { font-size: 26px; margin-top: 52px; }

/* Byline row under the title */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--faint); margin-bottom: 8px; }
.post-meta strong { color: var(--muted); font-weight: 600; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* Front-loaded answer: the first paragraph, a touch larger and lighter */
.post-lead { font-size: 19px; color: var(--text); line-height: 1.7; margin: 32px 0 18px; }
.post-lead strong { color: var(--grad-a); }

/* Callout box: disclosure, verdict, aside */
.callout { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 16px; padding: 20px 24px; margin: 30px 0; font-size: 15px; color: var(--muted); line-height: 1.7; }
.callout strong { color: var(--text); }
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin: 0; }
.callout.is-note { background: var(--card); border-color: var(--border); }

/* Honest comparison table (scrolls sideways on phones) */
.cmp-wrap { overflow-x: auto; margin: 24px 0 6px; border: 1px solid var(--border); border-radius: 14px; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 660px; }
.cmp th, .cmp td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; color: var(--muted); }
.cmp thead th { color: var(--text); font-weight: 700; font-size: 13px; letter-spacing: .3px; background: var(--card); }
.cmp tbody tr:last-child td { border-bottom: none; }
.cmp td:first-child, .cmp th:first-child { color: var(--text); font-weight: 600; }
.cmp .yes { color: var(--grad-a); font-weight: 600; }
.cmp .no { color: var(--faint); }
.cmp tr.is-ours td { background: color-mix(in srgb, var(--accent1) 9%, transparent); }
.cmp-note { font-size: 13px; color: var(--faint); margin: 0 0 26px; }

/* Author / E-E-A-T box */
.author-box { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; margin-top: 52px; }
.author-box img { width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; background: var(--accent-soft); padding: 6px; }
.author-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.author-box p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* Compact end-of-post CTA */
.post-cta { text-align: center; background: linear-gradient(160deg, var(--accent-soft), rgba(255,255,255,.02)); border: 1px solid var(--accent-line); border-radius: 24px; padding: 44px 32px; margin-top: 40px; }
.post-cta h2 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 12px; border: 0; padding: 0; }
.post-cta p { font-size: 16px; color: var(--muted); line-height: 1.65; margin: 0 auto 24px; max-width: 470px; }
/* The CTA button is an <a> inside .doc-body, whose link colour (var(--accent2))
   is more specific than .btn-primary and was tinting the button text gold on the
   gradient. Force the button's own white text and drop the doc-body underline. */
.doc-body a.btn-primary { color: #fff !important; }
.doc-body a.btn-primary:hover { text-decoration: none; }

/* Blog index list */
.post-list { display: flex; flex-direction: column; gap: 16px; margin-top: 48px; }
.post-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 28px; text-decoration: none; color: var(--text); transition: border-color .3s, transform .3s; }
.post-card:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.post-card .pc-meta { font-size: 13px; color: var(--faint); margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 10px; line-height: 1.28; }
.post-card p { font-size: 15px; color: var(--muted); line-height: 1.65; margin: 0; }
.post-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent2) 30%, transparent); border-radius: 50px; padding: 2px 10px; }

@media (max-width: 600px) {
  .author-box { flex-direction: column; align-items: flex-start; gap: 12px; }
  .post-main .doc-body h2 { font-size: 22px; margin-top: 40px; }
}

/* ── Launch-state toggle (pre-launch beta to live App Store). See /assets/launch.js.
   The <html> element carries .is-prelaunch or .is-live; one branch is always hidden. ── */
html.is-prelaunch .js-live { display: none !important; }
html.is-live .js-prelaunch { display: none !important; }

/* ── Blog visuals: pros/cons cards, in-post screenshots, pullquotes, stat rows ── */
.verdict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
@media (max-width: 620px) { .verdict-grid { grid-template-columns: 1fr; } }
.verdict-col { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; }
.verdict-col h4 { font-size: 14px; font-weight: 700; letter-spacing: .3px; margin: 0 0 14px; }
.verdict-col.pro h4 { color: var(--grad-a); }
.verdict-col.con h4 { color: var(--accent2); }
.verdict-col ul { list-style: none; margin: 0; padding: 0; }
.verdict-col li { font-size: 14px; color: var(--muted); line-height: 1.55; padding-left: 26px; position: relative; margin-bottom: 11px; }
.verdict-col li:last-child { margin-bottom: 0; }
.verdict-col.pro li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--grad-a); font-weight: 800; }
.verdict-col.con li::before { content: "\2715"; position: absolute; left: 1px; top: 0; color: var(--accent2); font-weight: 700; }

.post-shot { margin: 30px auto; max-width: 250px; }
.post-shot .frame { border-radius: 26px; padding: 6px; background: linear-gradient(165deg, #1a1f24, #0a0d10); border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 22px 44px -20px rgba(0,0,0,0.82); }
.post-shot img { display: block; width: 100%; height: auto; border-radius: 21px; }
.post-shot figcaption { margin-top: 12px; font-size: 13px; color: var(--faint); line-height: 1.5; text-align: center; }
@media (min-width: 720px) { .post-shot.float { float: right; margin: 4px 0 18px 30px; max-width: 205px; } }

.pullquote { font-size: 22px; font-weight: 700; line-height: 1.42; color: var(--text); letter-spacing: -.3px; border-left: 3px solid var(--accent1); padding: 2px 0 2px 22px; margin: 32px 0; }
@media (max-width: 600px) { .pullquote { font-size: 19px; } }

.post-main .doc-body h2 { clear: both; }
.doc-body .stats-bar { margin: 26px 0; }
