/* Lihai La — 2026 redesign.
   One accent, a real type scale, and restraint. Light and dark both first-class. */

:root {
  --bg:            #fbfbfa;
  --bg-raised:     #ffffff;
  --bg-sunken:     #f3f3f1;
  --text:          #16161a;
  --text-muted:    #5c5c66;
  --text-faint:    #8a8a94;
  --border:        #e4e4e0;
  --border-strong: #d2d2cc;
  --accent:        #2f5d50;
  --accent-text:   #ffffff;
  --accent-soft:   #e8f0ed;

  --radius:   14px;
  --radius-s: 9px;
  --maxw:     1080px;
  --gutter:   clamp(16px, 5vw, 48px);

  --shadow-1: 0 1px 2px rgba(20,20,26,.05), 0 1px 3px rgba(20,20,26,.04);
  --shadow-2: 0 4px 6px -2px rgba(20,20,26,.06), 0 12px 24px -6px rgba(20,20,26,.09);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #121215;
    --bg-raised:     #1a1a1f;
    --bg-sunken:     #0d0d10;
    --text:          #f0f0ee;
    --text-muted:    #a3a3ad;
    --text-faint:    #74747e;
    --border:        #2a2a31;
    --border-strong: #3a3a43;
    --accent:        #7fbfa8;
    --accent-text:   #0d1f1a;
    --accent-soft:   #1b2a25;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 4px 6px -2px rgba(0,0,0,.4), 0 12px 24px -6px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg:            #121215;
  --bg-raised:     #1a1a1f;
  --bg-sunken:     #0d0d10;
  --text:          #f0f0ee;
  --text-muted:    #a3a3ad;
  --text-faint:    #74747e;
  --border:        #2a2a31;
  --border-strong: #3a3a43;
  --accent:        #7fbfa8;
  --accent-text:   #0d1f1a;
  --accent-soft:   #1b2a25;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 6px -2px rgba(0,0,0,.4), 0 12px 24px -6px rgba(0,0,0,.5);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.021em; font-weight: 640; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.25rem); letter-spacing: -0.026em; }
h3 { font-size: 1.14rem; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; color: var(--text-faint); }
p  { text-wrap: pretty; }

a { color: inherit; }
img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-stuck { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.02em; margin-right: auto; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; }
.nav-links a {
  text-decoration: none; color: var(--text-muted); font-size: .93rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-s); transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-sunken); }

.dropdown { position: relative; }
.dropdown > button {
  font: inherit; font-size: .93rem; font-weight: 500; color: var(--text-muted);
  background: none; border: 0; cursor: pointer; padding: 7px 11px; border-radius: var(--radius-s);
  display: inline-flex; align-items: center; gap: 5px; transition: color .15s, background .15s;
}
.dropdown > button:hover, .dropdown[open] > button { color: var(--text); background: var(--bg-sunken); }
.dropdown > button svg { width: 11px; height: 11px; opacity: .6; transition: transform .2s; }
.dropdown[open] > button svg { transform: rotate(180deg); }
/* The class below sets display:grid, which outranks the UA stylesheet's rule
   for [hidden] — without this the menu is stuck permanently open. */
.dropdown-menu[hidden] { display: none; }
.dropdown-menu {
  position: absolute; top: calc(100% + 7px); left: 0; min-width: 230px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; display: grid; gap: 1px;
}
.dropdown-menu a {
  padding: 9px 12px; border-radius: 8px; font-size: .9rem; color: var(--text);
  text-decoration: none; display: block; transition: background .12s;
}
.dropdown-menu a:hover { background: var(--bg-sunken); }
.dropdown-menu a small { display: block; color: var(--text-faint); font-size: .78rem; font-weight: 400; margin-top: 1px; }

.nav-toggle { display: none; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  margin-left: 4px; padding: 0; cursor: pointer; color: var(--text-muted);
  background: none; border: 1px solid transparent; border-radius: 9px;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-sunken); border-color: var(--border); }
.theme-toggle svg { width: 17px; height: 17px; grid-area: 1 / 1; }
/* Show the icon for the theme you would switch *to*. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- hero ---------- */
.hero { padding: clamp(60px, 9vw, 116px) 0 clamp(48px, 7vw, 88px); position: relative; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1000px 420px at 18% -12%, var(--accent-soft), transparent 68%);
}
.hero h1 { max-width: 15ch; }
.hero .lede { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: var(--text-muted); max-width: 56ch; margin-top: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .94rem; font-weight: 550; text-decoration: none;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-sunken); }

/* ---------- sections ---------- */
section { padding: clamp(44px, 6vw, 78px) 0; }
.section-head { margin-bottom: 30px; }
.section-head p { color: var(--text-muted); margin-top: 9px; max-width: 58ch; }

/* ---------- products ---------- */
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 15px; }
.product-card {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.product-card p { color: var(--text-muted); font-size: .92rem; flex: 1; }
.product-link { color: var(--accent); font-size: .88rem; font-weight: 560; margin-top: 3px; }
.product-card:hover .product-link span { display: inline-block; transform: translateX(3px); transition: transform .18s; }

/* ---------- prose (legal + product pages) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.1em; margin-bottom: .55em; }
.prose h3 { margin-top: 1.7em; margin-bottom: .45em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.05em; color: var(--text-muted); }
.prose li { margin-bottom: .35em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* ---------- misc content blocks carried over from the old pages ---------- */
.feature-grid, .features-grid, .contact-grid, .stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 15px;
}
.feature-card, .contact-item, .stat-card, .about-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1);
}
.feature-card h3, .contact-item h3 { margin-bottom: 6px; }
.feature-card p, .contact-item p, .about p { color: var(--text-muted); font-size: .93rem; }
.contact-item a { color: var(--accent); text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }
.screenshot-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.screenshot-row img { width: 210px; flex: none; border-radius: 12px; border: 1px solid var(--border); scroll-snap-align: start; }
.store-badges { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; margin-top: 20px; }
.store-badges img { height: 42px; width: auto; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-sunken); padding: 46px 0 28px; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 32px; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 640; margin-bottom: 9px; }
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-col p { color: var(--text-muted); font-size: .88rem; max-width: 34ch; }
.footer-col h4 { margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: .89rem; padding: 3px 0; transition: color .15s; }
.footer-col a:hover { color: var(--text); }
.social-links { display: flex; gap: 8px; }
.social-links a { padding: 0; }
.social-links svg { width: 17px; height: 17px; fill: var(--text-muted); transition: fill .15s; }
.social-links a:hover svg { fill: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); margin-top: 34px; padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--text-faint); font-size: .84rem;
}

@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.is-open {
    display: grid; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--bg-raised); border-bottom: 1px solid var(--border);
    padding: 10px var(--gutter) 16px; gap: 2px; box-shadow: var(--shadow-2);
  }
  .nav-links.is-open .dropdown-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 10px; background: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg-raised); cursor: pointer; color: var(--text);
  }
  .nav-toggle svg { width: 17px; height: 17px; }
}
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Brand mark: inline SVG so it follows the theme instead of being a fixed PNG. */
.brand .logo, .footer-brand .logo { width: 24px; height: 24px; fill: var(--accent); flex: none; }
