/* ============================================================================
   AI Usage Bar, landing page styles
   Palette: copied verbatim from tools/product/setup_gui.py (THEME dict, lines ~86-120).
   No external fonts. No analytics. Single stylesheet, no preprocessor.

   Brand palette (locked):
     bg              #0E0F13
     card            #181A21
     card-border     #23262F
     input           #12141A
     text            #E6E7EC
     text-muted      #8E93A6
     text-value      #FFFFFF
     accent          #6D6BF2
     accent-hover    #5E5CE0
     ok              #4ADE80
     warn            #FBBF24
     err             #F87171
   Typography: system stack (Segoe UI / SF Pro Display / Inter / system-ui)
     editorial, no serifs, no display fonts.
   Layout: editorial dark. One accent color. Generous spacing.
   ========================================================================== */


/* ------------------------------------------------------------ *\
   Tokens
\* ------------------------------------------------------------ */
:root {
  --bg: #0E0F13;
  --card: #181A21;
  --card-border: #23262F;
  --input-bg: #12141A;
  --input-brd: #2A2E3A;
  --hover: #1E2129;

  --text: #E6E7EC;
  --text-muted: #8E93A6;
  --text-value: #FFFFFF;

  --accent: #6D6BF2;
  --accent-hover: #5E5CE0;
  --accent-text: #FFFFFF;

  --ok: #4ADE80;
  --warn: #FBBF24;
  --err: #F87171;

  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-pill: 999px;

  --gutter: clamp(20px, 4vw, 40px);
  --container: 1180px;

  --pad-section-y: clamp(64px, 10vw, 128px);

  --font-sans: "Segoe UI", "SF Pro Display", "Inter", system-ui,
               -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               Arial, "Noto Sans Thai", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas,
               "SFMono-Regular", monospace;
}


/* ------------------------------------------------------------ *\
   Reset (small, intentional)
\* ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 8% -10%, rgba(109, 107, 242, 0.06), transparent 65%),
    radial-gradient(900px 500px at 92% 110%, rgba(109, 107, 242, 0.05), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Honour reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* ------------------------------------------------------------ *\
   Helpers
\* ------------------------------------------------------------ */
.muted { color: var(--text-muted); }
.copy-col { max-width: 60ch; }


/* ------------------------------------------------------------ *\
   Nav
\* ------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14, 15, 19, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(35, 38, 47, 0.6);
}
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
  min-height: 64px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand-glyph { width: 22px; height: 22px; color: var(--accent); }
.brand-glyph rect[fill="#4ADE80"] { fill: var(--ok); }
.nav-links {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: color .18s ease, background-color .18s ease;
}
.nav-link:hover { color: var(--text-value); background: var(--hover); }
.nav-link-accent { color: var(--accent); }
.nav-link-accent:hover { background: rgba(109, 107, 242, 0.12); color: var(--accent-hover); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: 8px;
  transition: border-color .18s ease, color .18s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--text); }
.lang-toggle .lang-sep { color: var(--card-border); font-weight: 400; }
.lang-toggle .lang-opt { padding: 0 2px; }
.lang-toggle[data-lang-active="th"] .lang-opt[data-lang="th"],
.lang-toggle[data-lang-active="en"] .lang-opt[data-lang="en"] {
  color: var(--text-value);
}
.lang-toggle[data-lang-active="th"] .lang-opt[data-lang="en"],
.lang-toggle[data-lang-active="en"] .lang-opt[data-lang="th"] {
  color: var(--text-muted);
  opacity: 0.6;
}


/* ------------------------------------------------------------ *\
   Hero
\* ------------------------------------------------------------ */
.hero {
  padding: clamp(72px, 12vw, 140px) var(--gutter) clamp(72px, 10vw, 120px);
  border-bottom: 1px solid var(--card-border);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 64px);
  max-width: var(--container);
  margin: 0 auto;
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.hero-copy { max-width: 36rem; }
.hero-title {
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text-value);
}
.hero-title-accent {
  background: linear-gradient(96deg, var(--accent), #8E8BFF 65%, #B4B2FF);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  /* No neon outer glow. Restrained gradient inside text only. */
}
.hero-sub {
  margin-top: 24px;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--text);
  max-width: 32rem;
}
.hero-meta {
  margin-top: 28px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-cta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 32px;
}


/* Buttons (system: 1 family, 2 sizes, 2 styles) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); /* inner highlight, no outer glow */
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary.btn-disabled,
.btn-primary[aria-disabled="true"] {
  background: #2A2E3A;
  color: var(--text-muted);
  border-color: var(--card-border);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--card-border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text-value);
  background: rgba(109, 107, 242, 0.06);
}

.btn-block {
  display: flex;
  width: 100%;
}


/* ------------------------------------------------------------------
   Hero mock (taskbar placeholder, honest, not a fake screenshot)
   Real "fake preview" tells: div rectangles pretending to be UI is the
   #1 LLM-design Tell. This is a clearly-labeled placeholder, sized for
   a real screenshot drop-in.
   ------------------------------------------------------------------ */
.hero-mock {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mock-frame {
  background: linear-gradient(180deg, #15171D 0%, #0F1015 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.mock-titlebar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #161821;
  border-bottom: 1px solid var(--card-border);
  font-size: 11.5px;
  color: var(--text-muted);
}
.mock-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.mock-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}
.mock-taskbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #1A1C24 0%, #14161C 100%);
}
.mock-start {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  border-radius: 6px;
  color: white;
  font-size: 16px;
}
.mock-icon {
  width: 22px; height: 22px;
  background: var(--card-border);
  border-radius: 5px;
  opacity: 0.7;
}
.mock-bar-wrap {
  display: flex; gap: 6px; flex-wrap: nowrap;
  margin-left: auto; overflow: hidden;
}
.mock-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
}
.mock-pill-label { color: var(--text-muted); }
.mock-pill-pct { color: var(--text-value); font-weight: 600; }
.mock-pill-bar {
  width: 36px; height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.mock-pill-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.mock-tray {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--card-border);
  font-size: 11.5px;
  color: var(--text-muted);
}
.mock-tray-icon { font-size: 12px; }
.mock-tray-clock { font-family: var(--font-mono); }
.mock-caption {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* Mobile: keep the taskbar mock inside its frame — no sideways page scroll */
@media (max-width: 560px) {
  .mock-taskbar { gap: 6px; padding: 9px 10px; }
  .mock-icon { display: none; }               /* drop filler app icons */
  .mock-bar-wrap { gap: 5px; }
  .mock-pill:nth-of-type(n+4) { display: none; }   /* show first 3 providers */
  .mock-pill-bar { display: none; }           /* compact text pills */
  .mock-pill { padding: 4px 8px; font-size: 10.5px; }
  .mock-tray { margin-left: 6px; padding-left: 8px; }
  .mock-caption { text-align: left; }
}


/* ------------------------------------------------------------ *\
   Sections (shared)
\* ------------------------------------------------------------ */
.section {
  padding: var(--pad-section-y) var(--gutter);
  border-bottom: 1px solid var(--card-border);
}
.section:last-of-type { border-bottom: none; }
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
}
.section-title {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
  color: var(--text-value);
  max-width: 22ch;
}
.lead {
  margin-top: 20px;
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--text);
  max-width: 56ch;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}
@media (min-width: 880px) {
  .two-col {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
  .two-col .copy-col { padding-right: 12px; }
}


/* ------------------------------------------------------------ *\
   §2 provider list
\* ------------------------------------------------------------ */
.provider-list {
  display: flex; flex-direction: column;
  gap: 1px;
  background: var(--card-border);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.provider-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--card);
}
.provider-row small { font-weight: 400; opacity: 0.7; }
.provider-name {
  font-weight: 600;
  color: var(--text-value);
  font-size: 15px;
  letter-spacing: -0.005em;
}
.provider-pill {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.provider-pill-ok {
  background: rgba(74, 222, 128, 0.10);
  color: var(--ok);
  border: 1px solid rgba(74, 222, 128, 0.30);
}
.provider-pill-cdp {
  background: rgba(109, 107, 242, 0.10);
  color: #B4B2FF;
  border: 1px solid rgba(109, 107, 242, 0.30);
  font-family: var(--font-mono);
}


/* ------------------------------------------------------------ *\
   §3 Features (2x2 bento with real visual variation)
   Each cell has its own anchor: numeric display / line-art / mono console /
   soft-emphasis number. 4 cells, NOT 3 equal.
\* ------------------------------------------------------------ */
.feature-grid {
  margin-top: 48px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(0, auto);
  }
  .feature:first-child { grid-column: 1 / 2; }
  .feature-accent    { grid-column: 2 / 3; grid-row: 1 / 3; }
  .feature:nth-child(3) { grid-column: 1 / 2; }
  .feature:nth-child(4) { grid-column: 2 / 3; }
}
@media (min-width: 980px) {
  .feature-grid { grid-template-columns: repeat(6, 1fr); }
  .feature:first-child { grid-column: 1 / 4; }
  .feature-accent    { grid-column: 4 / 7; grid-row: 1 / 3; }
  .feature:nth-child(3) { grid-column: 1 / 4; }
  .feature:nth-child(4) { grid-column: 4 / 7; }
}

.feature {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.feature:hover { border-color: rgba(109, 107, 242, 0.45); }
.feature-accent {
  background:
    radial-gradient(140% 100% at 100% 0%, rgba(109, 107, 242, 0.18), transparent 60%),
    linear-gradient(180deg, #1F1E36 0%, #181A21 100%);
  color: #C6C5FF;
}
.feature-num {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  margin-top: 4px;
}
.feature-num-soft { color: var(--text-value); }
.feature-h {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-value);
}
.feature-p {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 36ch;
}
.feature-accent .feature-h { color: #ECEBFF; }
.feature-accent .feature-p { color: #C6C5FF; }
.feature-art {
  width: 100%;
  max-width: 220px;
  height: auto;
  color: var(--accent);
  margin-bottom: auto;
}
.feature-art-mono { color: var(--text-muted); }


/* ------------------------------------------------------------ *\
   §4 Install steps (numbered editorial list)
\* ------------------------------------------------------------ */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 24px 24px;
  border-bottom: 1px solid var(--card-border);
}
.step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  padding-top: 4px;
}
.step-h {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-value);
  letter-spacing: -0.005em;
}
.step-p {
  font-size: 14.5px;
  line-height: 1.55;
  margin-top: 6px;
}
.step-p code.ic {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--input-bg);
  border: 1px solid var(--input-brd);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}


/* ------------------------------------------------------------ *\
   §5 Download (one focused card, no marketing flourish)
\* ------------------------------------------------------------ */
.section-download { padding-block: clamp(80px, 12vw, 140px); }
.dl-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}
.dl-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dl-sep { color: var(--card-border); }
.dl-title {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--text-value);
  margin-top: 4px;
}
.dl-sub {
  font-size: 14.5px;
}
.dl-cta {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dl-note { font-size: 12.5px; letter-spacing: 0.04em; }
.dl-foot { font-size: 13px; margin-top: 8px; }


/* ------------------------------------------------------------ *\
   §6 Donate
\* ------------------------------------------------------------ */
.donate-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.qr-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--input-bg);
  border: 1px dashed var(--input-brd);
  border-radius: 10px;
}
.qr-mock {
  width: 132px;
  height: 132px;
  background: var(--text);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-real {
  display: block;
  width: 132px;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
.qr-grid {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
}
.qr-grid > span {
  background: var(--bg);
  border-radius: 2px;
}
.qr-grid > span:nth-child(odd)  { opacity: 0.85; }
.qr-grid > span:nth-child(even) { opacity: 0.25; }
.qr-label { font-size: 12.5px; text-align: center; }


/* ------------------------------------------------------------ *\
   Footer
\* ------------------------------------------------------------ */
.footer {
  padding: 56px var(--gutter) 48px;
  border-top: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(35, 38, 47, 0.0) 0%, rgba(0,0,0,0.4) 100%);
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .footer-disclaimer { grid-column: 1 / -1; }
  .footer-credit { grid-column: 1 / -1; }
}
.footer-brand {
  display: flex; flex-direction: column;
  gap: 6px;
}
.footer-mark {
  font-weight: 600;
  color: var(--text-value);
  letter-spacing: -0.01em;
}
.footer-links {
  display: flex; gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-link {
  font-size: 14px;
  color: var(--text);
  transition: color .18s ease;
}
.footer-link:hover { color: var(--accent); }
.footer-disclaimer {
  font-size: 12.5px;
  line-height: 1.65;
  max-width: 80ch;
  border-top: 1px solid var(--card-border);
  padding-top: 18px;
}
.footer-credit {
  font-size: 12px;
  letter-spacing: 0.04em;
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center;
}
.footer-by {
  color: var(--text);
  font-weight: 600;
}


/* ------------------------------------------------------------ *\
   Mobile fine-tuning
\* ------------------------------------------------------------ */
@media (max-width: 600px) {
  .nav-inner { gap: 12px; padding: 12px 16px; }
  .brand-text { display: none; }            /* Tighten nav on small screens */
  .nav-link { padding: 6px 9px; font-size: 13px; }
  .lang-toggle { padding: 4px 9px; }
  .mock-pill { font-size: 10.5px; padding: 3px 8px; }
  .mock-pill-bar { width: 28px; }
  .feature { padding: 22px; }
  .feature-num { font-size: 44px; }
  .step { padding: 18px 18px; }
}

@media (max-width: 420px) {
  .hero-cta .btn { width: 100%; }
}


/* ------------------------------------------------------------ *\
   Respect reduced-motion explicitly for any transitions
\* ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .feature, .btn, .nav-link, .lang-toggle { transition: none !important; }
}
