/* ============================================================
   pyhttp.com — design system
   Neutral, hairline-driven, one accent. Light by default,
   follows the OS into dark mode.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf9;
  --bg-sunk: #f4f4f2;
  --fg: #0a0a0a;
  --fg-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e7e7e4;
  --line-2: #d6d6d1;
  --accent: #15803d;
  --accent-bg: #ecfdf3;
  --btn-bg: #0a0a0a;
  --btn-fg: #fafafa;

  /* code panels are always dark */
  --code-bg: #0c0c0d;
  --code-bar: #141416;
  --code-line: #232326;
  --code-fg: #d4d4d8;
  --code-dim: #6b6b74;

  --get: #16a34a; --post: #d97706; --put: #2563eb; --del: #dc2626;

  --radius: 10px;
  --maxw: 1120px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-soft: #0e0e10;
    --bg-sunk: #151517;
    --fg: #fafafa;
    --fg-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --line: #232326;
    --line-2: #34343a;
    --accent: #4ade80;
    --accent-bg: rgba(74, 222, 128, .1);
    --btn-bg: #fafafa;
    --btn-fg: #0a0a0a;
    --code-bg: #0e0e10;
    --code-bar: #121214;
    --get: #4ade80; --post: #fbbf24; --put: #60a5fa; --del: #f87171;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
code {
  font-family: var(--mono); font-size: .86em;
  background: var(--bg-sunk); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 5px; color: var(--fg);
}
::selection { background: var(--fg); color: var(--bg); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.section { padding: 112px 0; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .section { padding: 72px 0; } }

/* Section heading: small mono label + left-aligned title */
.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  margin-bottom: 18px;
}
.label::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.section-head p { font-size: 1.08rem; color: var(--muted); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  font-weight: 500; font-size: .94rem; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { opacity: .86; }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--line-2); }
.btn-secondary:hover { background: var(--bg-sunk); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .86rem; border-radius: 7px; }
.btn .kbd-hint { font-family: var(--mono); font-size: .75rem; opacity: .55; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.02rem; letter-spacing: -.02em; }
.brand .logo { width: 24px; height: 24px; color: var(--fg); }
.brand .logo .glyph { stroke: var(--bg); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-right: auto; margin-left: 20px; }
.nav-links a { color: var(--muted); font-size: .9rem; padding: 6px 10px; border-radius: 6px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--fg); background: var(--bg-sunk); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-cta .btn-secondary { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 88px 0 0; overflow: hidden; }
@media (max-width: 700px) { .hero { padding-top: 56px; } }
.release {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .84rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 4px; margin-bottom: 28px;
  transition: border-color .15s;
}
.release:hover { border-color: var(--line-2); color: var(--fg); }
.release .tag {
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  background: var(--accent-bg); color: var(--accent);
  padding: 2px 8px; border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.6rem);
  letter-spacing: -0.045em; line-height: 1.02;
  max-width: 14ch; margin-bottom: 24px;
}
.hero h1 .dim { color: var(--faint); }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: var(--muted); max-width: 56ch; margin-bottom: 36px; }
.hero .lede strong { color: var(--fg); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-cta .btn { height: 44px; padding: 0 20px; font-size: .97rem; }
.hero-cmd {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  font-family: var(--mono); font-size: .86rem; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 8px;
}
.hero-cmd span { color: var(--faint); user-select: none; }
.hero-cmd b { color: var(--fg); font-weight: 400; }

.hero-shot { margin-top: 72px; position: relative; }
.shot-frame {
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 12px 12px 0 0; overflow: hidden;
  background: var(--bg-sunk); padding: 8px 8px 0;
}
.shot-frame img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0;
}
/* fade the bottom of the screenshot into the page */
.hero-shot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* ---------- Facts row ---------- */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.fact { padding: 28px 24px 32px 0; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--line); }
.fact .v { font-size: 1.6rem; font-weight: 600; letter-spacing: -.03em; font-family: var(--mono); }
.fact .k { color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Hairline grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  gap: 1px; background: var(--line);
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid, .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid, .grid.cols-2 { grid-template-columns: 1fr; } }
.cell { background: var(--bg); padding: 28px 26px 30px; transition: background .15s; }
.cell:hover { background: var(--bg-soft); }
.cell .ico { width: 20px; height: 20px; color: var(--fg); margin-bottom: 18px; display: block; }
.cell h3 { font-size: 1rem; letter-spacing: -.01em; margin-bottom: 8px; }
.cell p { color: var(--muted); font-size: .93rem; margin: 0; }
.cell b { color: var(--fg-2); font-weight: 500; }

/* ---------- Split (copy + code panel) ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: start; }
@media (min-width: 940px) {
  .split { grid-template-columns: 5fr 6fr; gap: 72px; }
  .split > .panel, .split > .kbd-list { position: sticky; top: 100px; }
}
.split h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.split > div > p { color: var(--muted); font-size: 1.05rem; }
.points { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--line); }
.points li { padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.points b { display: block; color: var(--fg); font-weight: 500; margin-bottom: 2px; }

.panel {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--code-line); background: var(--code-bg);
  font-family: var(--mono); font-size: 12.8px;
  color-scheme: dark;
}
.panel-bar {
  display: flex; align-items: center; gap: 2px; padding: 0 8px;
  background: var(--code-bar); border-bottom: 1px solid var(--code-line);
  font-size: 12px; color: var(--code-dim);
}
.panel-bar .tab { padding: 10px 10px; }
.panel-bar .tab.on { color: var(--code-fg); box-shadow: inset 0 -1px 0 var(--code-fg); }
.panel-bar .meta { margin-left: auto; padding-right: 6px; }
.panel-body { padding: 18px 20px; color: var(--code-fg); line-height: 1.8; overflow-x: auto; }
.row { white-space: pre; }
.row .d { color: var(--code-dim); }
.k { color: #93c5fd; } .s { color: #a7f3d0; } .n { color: #fcd34d; } .p { color: #71717a; }
.pass { color: #4ade80; } .fail { color: #f87171; }
.panel-foot {
  display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--code-line);
  color: var(--code-dim); font-size: 12px;
}
.panel-foot .pass, .panel-foot .fail { font-weight: 500; }

/* ---------- Download ---------- */
.dl { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dl-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 18px; align-items: center;
  padding: 22px 24px; background: var(--bg);
}
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-row .os { width: 22px; height: 22px; color: var(--fg); }
.dl-row h3 { font-size: 1rem; margin: 0 0 2px; }
.dl-row p { margin: 0; color: var(--muted); font-size: .9rem; }
.dl-row .btn { min-width: 150px; }
@media (max-width: 600px) {
  .dl-row { grid-template-columns: 22px 1fr; }
  .dl-row .btn { grid-column: 1 / -1; width: 100%; }
}
.dl-note { color: var(--muted); font-size: .9rem; margin-top: 20px; }

/* ---------- Shortcuts ---------- */
.kbd-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kbd-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .94rem; color: var(--fg-2);
}
.keys { display: inline-flex; gap: 4px; flex: none; }
kbd {
  font-family: var(--mono); font-size: .75rem; color: var(--fg-2);
  min-width: 24px; height: 24px; padding: 0 6px;
  display: inline-grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
}

/* ---------- Closing CTA ---------- */
.closing { padding: 128px 0; border-top: 1px solid var(--line); text-align: center; }
.closing h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.045em; margin-bottom: 18px; }
.closing p { color: var(--muted); font-size: 1.1rem; margin: 0 auto 32px; max-width: 46ch; }
.closing .hero-cta { justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: .9rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 48px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
.footer-about p { max-width: 34ch; margin-top: 12px; }
.footer-col h4 { color: var(--fg); font-size: .86rem; font-weight: 500; letter-spacing: 0; margin-bottom: 14px; }
.footer-col a { display: block; margin-bottom: 8px; transition: color .15s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .84rem; color: var(--faint); }

/* ---------- 404 ---------- */
.nf { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.nf-inner { max-width: 440px; }
.nf .status { font-family: var(--mono); font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.nf .status b { color: var(--del); font-weight: 500; }
.nf h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.04em; }
.nf p { color: var(--muted); margin-bottom: 28px; }

/* ---------- Additions: polish, stats, FAQ ---------- */
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: 8px;
  transition: top .15s;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: var(--bg-sunk); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 1rem; }
.hero-cta .btn.btn-lg { height: 46px; padding: 0 22px; }
.btn-primary { box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.08); }

/* hero: faint grid that fades out behind the headline */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 620px; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 30%, transparent 75%);
  opacity: .55;
}
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 20px 0 0; font-size: .86rem; color: var(--muted);
}
.hero-meta b { color: var(--fg); font-weight: 600; font-family: var(--mono); }
.hero-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.hero-meta [hidden] { display: none; }

.shot-frame { box-shadow: 0 30px 80px -30px rgba(0,0,0,.25); }
.shot-bar {
  display: flex; align-items: center; gap: 6px; padding: 2px 6px 9px;
  font-family: var(--mono); font-size: .72rem; color: var(--faint);
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.shot-bar span { margin: 0 auto; transform: translateX(-24px); }

/* formats strip */
.formats { border-top: 1px solid var(--line); background: var(--bg-soft); }
.formats-inner { display: flex; align-items: center; gap: 12px 32px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.formats-k { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.formats ul { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; margin: 0; padding: 0; }
.formats li { font-weight: 600; letter-spacing: -.01em; color: var(--fg-2); font-size: .98rem; }

/* "New" badge on feature cells */
.cell { position: relative; }
.new {
  position: absolute; top: 24px; right: 22px;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  color: var(--accent); background: var(--accent-bg);
  padding: 1px 8px; border-radius: 999px;
}

/* diff rows in the compare panel */
.row.diff-add { background: rgba(74, 222, 128, .12); color: #bbf7d0; margin: 0 -20px; padding: 0 20px; }
.row.diff-del { background: rgba(248, 113, 113, .12); color: #fecaca; margin: 0 -20px; padding: 0 20px; }
.panel-body b { color: #fafafa; font-weight: 500; }

/* download stats + highlighted platform */
.dl-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 16px; background: var(--bg-soft);
}
.dl-stats > div { padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; }
.dl-stats > div + div { border-left: 1px solid var(--line); }
.dl-stats .k { font-size: .8rem; color: var(--muted); }
.dl-stats .v { font-family: var(--mono); font-size: 1.3rem; font-weight: 500; letter-spacing: -.02em; }
@media (max-width: 600px) {
  .dl-stats { grid-template-columns: 1fr; }
  .dl-stats > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.dl-row h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl-row .you {
  display: none; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: 0;
  color: var(--accent); background: var(--accent-bg); padding: 1px 8px; border-radius: 999px;
}
.dl-row.is-you { background: var(--bg-soft); box-shadow: inset 3px 0 0 var(--accent); }
.dl-row.is-you .you { display: inline-block; }
.dl-row:not(.is-you) .btn-primary { background: var(--bg); color: var(--fg); border-color: var(--line-2); box-shadow: none; }
.dl-row:not(.is-you) .btn-primary:hover { background: var(--bg-sunk); opacity: 1; }
.dl-note a, .link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.dl-note a:hover, .link:hover { text-decoration-color: var(--fg); }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-weight: 500; color: var(--fg);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { color: var(--fg-2); }
.faq details p { color: var(--muted); font-size: .95rem; margin: -4px 0 20px; max-width: 62ch; }
.faq details p b { color: var(--fg-2); font-weight: 500; }
#faq .split > div:first-child p a { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media (max-width: 480px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .release { max-width: 100%; }
}

/* a screenshot inside a two-column section (Scripts tab) */
.shot-inline { border-bottom: 1px solid var(--line-2); border-radius: 12px; padding: 8px; }
.shot-inline img { border-bottom: 1px solid var(--line); border-radius: 6px; }
.split.stack { grid-template-columns: 1fr; }
.split.stack .shot-inline { margin-top: 8px; }

.footer-about .tagline { margin-top: 10px; font-size: 13px; opacity: .75; }
.footer-about .tagline em { font-style: italic; }

/* screenshot tour */
.tour { display: grid; gap: 72px; }
.tour-item { margin: 0; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.tour-item:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.tour-item:nth-child(even) .shot-frame { order: 2; }
.tour-item figcaption h3 { font-size: 1.35rem; margin: 0 0 10px; }
.tour-item figcaption p { color: var(--muted); font-size: 1.02rem; margin: 0; }
.tour-item .shot-frame { box-shadow: 0 24px 60px -30px rgba(0,0,0,.28); }
@media (max-width: 860px) {
  .tour { gap: 48px; }
  .tour-item, .tour-item:nth-child(even) { grid-template-columns: 1fr; gap: 16px; }
  .tour-item:nth-child(even) .shot-frame { order: 0; }
}
