/* Gizlet web: same palette as the launcher's dark theme (frontends/lite/src/theme.rs). */
:root {
  --bg: #121418;
  --bg-top: #1d2027;
  --surface: #20242b;
  --surface-hi: #2b303a;
  --line: #343a46;
  --text: #f3f5f8;
  --dim: #a4abb8;
  --faint: #6c7380;
  --accent: #34b6ff;
  --accent-hi: #9ee3ff;
  --on-accent: #06121c;
  --warm: #ff9a3d;
  --success: #3ddc97;
  --radius: 18px;
  --font: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "SF Pro Display", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.6 var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 520px) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; min-width: 0; }
body { overflow-x: hidden; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin: 0 0 1rem; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(820px, 100% - 40px); }

/* Top bar ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 20, 24, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 1.15rem var(--display); }
.brand:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; color: var(--accent); vertical-align: middle; }
.footer .logo-mark { width: 20px; height: 20px; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--dim); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-hi); text-decoration: none; }
.search { flex: 1; display: flex; justify-content: flex-end; }
.search input {
  width: min(320px, 100%); padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem;
}
.lang { color: var(--faint); font-size: 0.9rem; margin-left: auto; }
.section-store .lang { margin-left: 0; }

/* Buttons ---------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--on-accent); font: 700 0.95rem var(--font); cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.button:hover { background: var(--accent-hi); text-decoration: none; transform: translateY(-1px); }
.button-big { padding: 13px 26px; font-size: 1.05rem; }
.button-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.button-ghost:hover { background: var(--surface-hi); }
.eyebrow { display: block; color: var(--warm); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Icons and cards ---------------------------------------------------------- */
.icon {
  flex: none; display: inline-grid; place-items: center; overflow: hidden;
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tile) 100%, white 18%), var(--tile));
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--tile) 70%, black), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.icon img { width: 100%; height: 100%; object-fit: cover; }
.icon-s { width: 44px; height: 44px; border-radius: 12px; }
.icon-l { width: 112px; height: 112px; border-radius: 28px; }
.icon-letter { font: 800 2rem var(--display); color: rgba(0, 0, 0, 0.55); }
.icon-l .icon-letter { font-size: 3rem; }

.row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.row .card { flex: 0 0 250px; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  border: 1px solid transparent; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.card:hover { text-decoration: none; border-color: var(--accent); background: var(--surface-hi); transform: translateY(-2px); }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--dim); font-size: 0.85rem; }

/* Store home ----------------------------------------------------------------- */
.store-home { padding: 28px 0 56px; }
.hero-rail { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: minmax(150px, auto); gap: 16px; margin-bottom: 40px; }
.hero {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  border-radius: 26px; padding: 26px; color: var(--text); min-height: 170px;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--tile) 55%, transparent), transparent 60%), var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hero:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tile) 70%, white); }
.hero-main { grid-row: span 2; min-height: 360px; padding: 36px; }
.hero-glow {
  position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: var(--tile); filter: blur(80px); opacity: 0.35;
}
.hero-body { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hero:not(.hero-main) .icon-l { width: 64px; height: 64px; border-radius: 18px; }
.hero-name { font: 800 1.5rem var(--display); }
.hero-main .hero-name { font-size: clamp(2rem, 4vw, 3rem); }
.hero-desc { color: var(--dim); max-width: 48ch; }
.hero:not(.hero-main) .hero-desc, .hero:not(.hero-main) .button { display: none; }
.hero:only-child { grid-column: 1 / -1; }
.shelf { margin: 0 0 36px; }
.empty { color: var(--dim); padding: 40px 0; font-size: 1.1rem; }

.open-repo {
  margin-top: 24px; padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--line);
}
.open-repo label { display: block; font: 700 1.1rem var(--display); margin-bottom: 12px; }
.open-row { display: flex; align-items: center; gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 18px; }
.open-row .prefix { color: var(--faint); font-family: var(--mono); font-size: 0.95rem; }
.open-row input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 0.95rem var(--mono); padding: 8px 4px; outline: none; }
.open-repo .hint { color: var(--dim); margin: 10px 0 0; font-size: 0.9rem; }
.open-repo.compact { margin-top: 40px; }

.page-title { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 32px 0 20px; word-break: break-word; }
.notfound { padding-bottom: 60px; }
.notfound p { color: var(--dim); }

/* App page ------------------------------------------------------------------ */
.app-hero {
  background: radial-gradient(90% 140% at 85% -20%, color-mix(in srgb, var(--tile) 45%, transparent), transparent 65%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-hero-inner { display: flex; align-items: center; gap: 28px; padding: 44px 0 36px; }
.app-title { flex: 1; min-width: 0; }
.app-title h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 4px 0 8px; }
.lede { color: var(--dim); font-size: 1.12rem; max-width: 60ch; margin: 0 0 10px; }
.meta { color: var(--faint); font-size: 0.9rem; margin: 0; }
.app-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 32px 0 64px; }
.app-main section { margin-bottom: 36px; }
.shots { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.shot { flex: 0 0 min(520px, 85%); scroll-snap-align: start; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.readme { color: #dfe3ea; overflow-wrap: anywhere; }
.readme h1, .readme h2, .readme h3 { margin: 1.6em 0 0.6em; }
.readme h1:first-child { margin-top: 0; }
.readme pre { background: var(--surface); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.readme code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 6px; }
.readme pre code { background: none; padding: 0; }
.readme table { border-collapse: collapse; display: block; overflow-x: auto; }
.readme th, .readme td { border: 1px solid var(--line); padding: 6px 10px; }
.readme img { border-radius: 10px; }
.readme blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--dim); }

.app-side { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(255, 255, 255, 0.05); }
.panel h2 { font-size: 1.1rem; }
.panel p { color: var(--dim); font-size: 0.92rem; margin: 0 0 8px; }
.copy-line { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; margin-bottom: 14px; }
.copy-line code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--accent-hi); }
.copy { border: 0; background: var(--surface-hi); color: var(--text); font: 600 0.8rem var(--font); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.copy:hover { background: var(--line); }
.packages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.packages li { display: flex; flex-direction: column; gap: 4px; }
.pkg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.pkg:hover { border-color: var(--accent); text-decoration: none; }
.pkg-target { flex: 1; font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.pkg-size { color: var(--dim); font-size: 0.85rem; white-space: nowrap; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge-lite { background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.badge-full { background: color-mix(in srgb, var(--warm) 22%, transparent); color: var(--warm); }
.sha { color: var(--faint); font-size: 0.75rem; padding-left: 12px; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 16px; }
.hint { color: var(--dim); }

/* Site ----------------------------------------------------------------------- */
.landing-hero { padding: 72px 0 56px; overflow: hidden; }
.landing-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.display { font-size: clamp(3rem, 7.4vw, 5.6rem); margin: 14px 0 22px; line-height: 1.02; letter-spacing: -0.035em; }
.display em { font-style: normal; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.console {
  justify-self: center; width: min(440px, 100%); aspect-ratio: 1 / 1.05;
  background: linear-gradient(160deg, #2a2f38, #1a1d23); border-radius: 36px 36px 64px 64px;
  padding: 26px; display: flex; flex-direction: column; gap: 26px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(-4deg);
}
.console-screen {
  aspect-ratio: 4 / 3; border-radius: 12px; padding: 14px;
  background: linear-gradient(180deg, #1d2027, #121418); border: 6px solid #0b0c0f;
  display: flex; flex-direction: column; gap: 12px; font: 600 11px var(--font); color: var(--dim);
}
.cs-top { display: flex; justify-content: space-between; }
.cs-tiles { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; align-items: center; }
.cs-tile { aspect-ratio: 1; border-radius: 10px; }
.cs-a { background: linear-gradient(145deg, #5fd2ff, #34b6ff); box-shadow: 0 0 0 3px var(--accent-hi); }
.cs-b { background: linear-gradient(145deg, #ffbd7a, #ff9a3d); }
.cs-c { background: linear-gradient(145deg, #6be9b4, #3ddc97); }
.cs-d { background: linear-gradient(145deg, #c79bff, #8b5cf6); }
.cs-sys { display: flex; gap: 10px; justify-content: center; }
.cs-sys span { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-hi); }
.console-pad { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; }
.dpad { position: relative; width: 84px; height: 84px; }
.dpad::before, .dpad::after { content: ""; position: absolute; background: #0d0f13; border-radius: 6px; }
.dpad::before { left: 28px; top: 0; width: 28px; height: 84px; }
.dpad::after { top: 28px; left: 0; height: 28px; width: 84px; }
.abxy { position: relative; width: 92px; height: 92px; }
.abxy i { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: #0d0f13; }
.abxy i:nth-child(1) { left: 31px; top: 0; }
.abxy i:nth-child(2) { right: 0; top: 31px; background: var(--warm); }
.abxy i:nth-child(3) { left: 31px; bottom: 0; background: var(--accent); }
.abxy i:nth-child(4) { left: 0; top: 31px; }

.features { padding: 40px 0 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin: 10px 0 8px; font-size: 1.1rem; }
.feature p { color: var(--dim); margin: 0; font-size: 0.95rem; }
.feature-num { font: 700 0.85rem var(--mono); color: var(--warm); }
.store-strip { padding: 40px 0 10px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; }
.publish { padding: 40px 0 72px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { counter-increment: step; background: var(--surface); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.steps h3 { margin: 12px 0 6px; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--dim); font-size: 0.95rem; }
.terminal { background: #0b0c0f; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; overflow-x: auto; color: #cfe9ff; line-height: 1.7; }
.devs { padding-bottom: 64px; }
.endpoints { width: 100%; border-collapse: collapse; margin: 18px 0 26px; }
.endpoints td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.endpoints td:first-child { white-space: nowrap; color: var(--accent-hi); }
.endpoints td:last-child { color: var(--dim); }

.footer { border-top: 1px solid rgba(255, 255, 255, 0.06); color: var(--faint); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 26px 0; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--dim); }

@media (max-width: 900px) {
  .landing-grid, .app-body { grid-template-columns: minmax(0, 1fr); }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .hero-rail { grid-template-columns: minmax(0, 1fr); }
  .hero-main { grid-row: auto; min-height: 300px; }
  .console { width: min(340px, 90%); }
  .endpoints td:first-child { white-space: normal; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .nav a:not(.active) { display: none; }
  .search input { width: 100%; }
  .feature-grid, .steps { grid-template-columns: minmax(0, 1fr); }
  .app-hero-inner { flex-direction: column; align-items: flex-start; }
  .row .card { flex-basis: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
