/* PyWebLib landing page (pyweblib.org).
   Standalone by design: the app at play.pyweblib.org has its own much larger
   stylesheet, and this page should never have to load it. The tokens below are
   copied from that site so the two look like one product. */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #586079;
  --border: #e3e8f2;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #ffd43b;
  --accent-ink: #1e1b4b;
  --code-bg: #0f1226;
  --code-text: #e6e7ef;
  --shadow-sm: 0 1px 2px rgba(20, 22, 50, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 22, 50, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 22, 50, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(79, 70, 229, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------------------------------------------------------------- header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none;
}
.logo-mark { display: block; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-link {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.header-link:hover { color: var(--text); background: var(--bg); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-nav { padding: 8px 14px; font-size: 0.92rem; }
.btn-lg { padding: 14px 26px; font-size: 1.03rem; border-radius: 12px; }

/* ---------------------------------------------------------------- hero */
.hero {
  background:
    radial-gradient(1100px 420px at 12% -10%, rgba(79, 70, 229, 0.13), transparent 62%),
    radial-gradient(760px 340px at 92% 0%, rgba(255, 212, 59, 0.20), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 84px;
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px; align-items: center;
}
.eyebrow {
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.09em;
  font-size: 0.76rem; font-weight: 700; color: var(--primary);
}
.hero h1 {
  margin: 0 0 18px; font-size: clamp(2.1rem, 5vw, 3.3rem);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
}
.hl {
  background: linear-gradient(transparent 62%, var(--accent) 62%);
  padding: 0 4px; color: var(--accent-ink);
}
.lede { margin: 0 0 26px; font-size: 1.08rem; color: var(--muted); max-width: 52ch; }
.lede code { background: rgba(79, 70, 229, 0.1); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-note { margin: 14px 0 0; font-size: 0.88rem; color: var(--muted); }

/* The code sample is decoration, not a real editor: no highlighting engine,
   just a few spans so it does not read as a grey slab. */
.hero-demo {
  background: var(--code-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.demo-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: rgba(255, 255, 255, 0.06);
}
.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.demo-name {
  margin-left: 8px; color: rgba(230, 231, 239, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem;
}
.demo-code {
  margin: 0; padding: 18px 20px 22px; overflow-x: auto;
  color: var(--code-text); font-size: 0.86rem; line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.demo-code code { background: none; padding: 0; font-size: inherit; }
.demo-code .k { color: #c792ea; }
.demo-code .s { color: #c3e88d; }
.demo-code .n { color: #f78c6c; }
.demo-code .f { color: #82aaff; }

/* ---------------------------------------------------------------- sections */
.section { padding: 72px 0; }
.section-title {
  margin: 0 0 32px; font-size: 1.85rem; letter-spacing: -0.015em; font-weight: 800;
}
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 8px; font-size: 1.06rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------------------------------------------------------------- band */
.band { background: var(--surface); border-block: 1px solid var(--border); padding: 66px 0; }
.band-inner {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px; align-items: center;
}
.band h2 { margin: 0 0 14px; font-size: 1.75rem; letter-spacing: -0.015em; font-weight: 800; }
.band p { margin: 0 0 14px; color: var(--muted); max-width: 58ch; }
.band-links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; }
.band-stats { display: grid; gap: 14px; }
.stat {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.stat-n { font-size: 1.7rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.stat-l { color: var(--muted); font-size: 0.92rem; }

/* ---------------------------------------------------------------- closer */
.closer { text-align: center; padding-bottom: 88px; }
.closer h2 { margin: 0 0 10px; font-size: 1.85rem; letter-spacing: -0.015em; font-weight: 800; }
.closer p { margin: 0 0 24px; color: var(--muted); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 26px 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 14px 26px;
  align-items: center; justify-content: space-between;
}
.site-footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.9rem; font-weight: 600; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .hero { padding: 52px 0 60px; }
  .hero-inner, .band-inner { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 56px 0; }
}
@media (max-width: 640px) {
  .header-inner { height: auto; padding-block: 12px; flex-wrap: wrap; gap: 10px; }
  .site-nav { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 4px; }
  .site-nav .btn-nav { margin-left: auto; }
  .cta-row .btn { width: 100%; }
  .footer-inner { justify-content: flex-start; }
}
