/* pgtower.dev — hand-written, no framework. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-inset: #eef0f3;
  --ink: #0d1117;
  --ink-2: #3a4250;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #cfd4dc;
  --brand: #2f5f86;
  --brand-ink: #24506f;
  --brand-soft: #e8f0f7;
  --beacon: #e9a23b;
  --prod: #d93f3f;
  --term: #12151c;
  --term-bar: #1a1e27;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 24px 48px -16px rgba(16, 24, 40, .22);

  --wrap: 1120px;
  --wrap-wide: 1240px;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --bg-soft: #10131a;
    --bg-inset: #161a23;
    --ink: #eceef3;
    --ink-2: #c3c9d4;
    --muted: #8a93a5;
    --line: #1f2430;
    --line-strong: #2c3342;
    --brand: #6ea3d0;
    --brand-ink: #8cb8de;
    --brand-soft: #14212e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-soft: #10131a;
  --bg-inset: #161a23;
  --ink: #eceef3;
  --ink-2: #c3c9d4;
  --muted: #8a93a5;
  --line: #1f2430;
  --line-strong: #2c3342;
  --brand: #6ea3d0;
  --brand-ink: #8cb8de;
  --brand-soft: #14212e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; letter-spacing: -.022em; font-weight: 650; text-wrap: balance; }
p { margin: 0; }
code, kbd, pre { font-family: var(--mono); font-size: .86em; }
:not(pre) > code {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .08em .36em;
  white-space: nowrap;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: .1em .42em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: .8em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
.muted { color: var(--muted); }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 40px, var(--wrap-wide)); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--bg); padding: 8px 12px; }
.eyebrow {
  font: 600 13px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}
.badge-prod {
  display: inline-block;
  background: var(--prod);
  color: #fff;
  font: 700 11px/1 var(--mono);
  letter-spacing: .06em;
  padding: 4px 6px 3px;
  border-radius: 4px;
  vertical-align: 2px;
}

/* ---------- buttons & command ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 10px;
  font: 600 15px/1 var(--font);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { height: 36px; padding: 0 12px; color: var(--ink); border-color: var(--line); font-size: 14px; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--bg-soft); }

.cmd {
  display: inline-flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 6px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 15px;
  max-width: 100%;
}
.cmd code { background: none; border: 0; padding: 0; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-prompt { color: var(--beacon); user-select: none; }
.cmd-copy {
  margin-left: auto;
  font: 600 12px/1 var(--font);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
}
.cmd-copy:hover { color: var(--ink); border-color: var(--line-strong); }
.cmd-copy.is-done { color: #2f8f57; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); font-size: 15px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: none; color: var(--ink-2); cursor: pointer;
}
.icon-btn[hidden] { display: none; }
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ---------- hero ---------- */
.hero {
  padding: 88px 0 96px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--brand-soft), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.announce {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14px;
}
.announce:hover { border-color: var(--line-strong); text-decoration: none; color: var(--ink); }
.announce-tag {
  background: var(--ink); color: var(--bg);
  font: 600 12px/1 var(--mono);
  padding: 5px 8px; border-radius: 999px;
}
.hero h1 {
  margin-top: 26px;
  max-width: 16ch;
  font-size: clamp(42px, 6.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 700;
}
.lede { margin-top: 24px; max-width: 58ch; text-wrap: pretty; font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 14px; }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--beacon); }

/* ---------- showcase ---------- */
#screens { margin-top: 64px; }
.showcase > input { position: absolute; opacity: 0; pointer-events: none; }
.screen-keys { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.screen-keys label {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14px; font-weight: 550;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, color .15s, background .15s;
}
.screen-keys label:hover { border-color: var(--line-strong); color: var(--ink); }
.screen-keys kbd { font-size: 12px; }
.showcase:has(#scr-dashboard:checked) label[for="scr-dashboard"],
.showcase:has(#scr-servers:checked) label[for="scr-servers"],
.showcase:has(#scr-sessions:checked) label[for="scr-sessions"],
.showcase:has(#scr-locks:checked) label[for="scr-locks"],
.showcase:has(#scr-query:checked) label[for="scr-query"],
.showcase:has(#scr-roles:checked) label[for="scr-roles"],
.showcase:has(#scr-tuning:checked) label[for="scr-tuning"] {
  background: var(--ink); border-color: var(--ink); color: var(--bg);
}
.showcase:has(input:checked) label kbd { transition: none; }
.showcase:has(#scr-dashboard:checked) label[for="scr-dashboard"] kbd,
.showcase:has(#scr-servers:checked) label[for="scr-servers"] kbd,
.showcase:has(#scr-sessions:checked) label[for="scr-sessions"] kbd,
.showcase:has(#scr-locks:checked) label[for="scr-locks"] kbd,
.showcase:has(#scr-query:checked) label[for="scr-query"] kbd,
.showcase:has(#scr-roles:checked) label[for="scr-roles"] kbd,
.showcase:has(#scr-tuning:checked) label[for="scr-tuning"] kbd {
  background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent);
}
.showcase:has(input:focus-visible) .screen-keys { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 12px; }

.window {
  border-radius: 14px;
  overflow: hidden;
  background: var(--term);
  border: 1px solid #252a36;
  box-shadow: var(--shadow);
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  background: var(--term-bar);
  border-bottom: 1px solid #252a36;
}
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4150; }
.window-bar span { margin: 0 auto; transform: translateX(-26px); font: 500 12px/1 var(--mono); color: #7d8699; }
.screen { margin: 0; display: none; }
.showcase:not(:has(input:checked)) .screen[data-screen="dashboard"],
.showcase:has(#scr-dashboard:checked) .screen[data-screen="dashboard"],
.showcase:has(#scr-servers:checked) .screen[data-screen="servers"],
.showcase:has(#scr-sessions:checked) .screen[data-screen="sessions"],
.showcase:has(#scr-locks:checked) .screen[data-screen="locks"],
.showcase:has(#scr-query:checked) .screen[data-screen="query"],
.showcase:has(#scr-roles:checked) .screen[data-screen="roles"],
.showcase:has(#scr-tuning:checked) .screen[data-screen="tuning"] { display: block; }
.screen img { width: 100%; aspect-ratio: 2400 / 1380; background: var(--term); }
.screen figcaption {
  padding: 16px 20px 18px;
  border-top: 1px solid #252a36;
  background: var(--term-bar);
  color: #aab2c2;
  font-size: 15px;
}
.screen figcaption strong { color: #eef1f6; font-weight: 600; }
.screen figcaption code { background: #232834; border-color: #2e3442; color: #dfe4ec; }
.screen figcaption kbd { background: #232834; border-color: #3a4151; color: #eef1f6; }
.screen-hint { margin-top: 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.screen-hint kbd { font-size: 11px; }

/* ---------- pillars ---------- */
.pillars { padding: 72px 0; border-bottom: 1px solid var(--line); }
.pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.pillar-grid h2 { font-size: 20px; letter-spacing: -.015em; margin-bottom: 8px; }
.pillar-grid h2::before {
  content: ""; display: block; width: 28px; height: 3px; border-radius: 2px;
  background: var(--beacon); margin-bottom: 18px;
}
.pillar-grid p { color: var(--ink-2); font-size: 16px; }

/* ---------- stories ---------- */
.story { padding: 104px 0; }
.story + .story { border-top: 1px solid var(--line); }
.story-grid { display: grid; gap: 48px; }
.story-text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; align-items: start; }
.story h2, .compare h2, .install h2, .faq h2 {
  font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px;
}
.story-body > p { color: var(--ink-2); font-size: 18px; }
.story-head h2 { margin-bottom: 0; }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); font-size: 16px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .5em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.story-shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid #252a36; box-shadow: var(--shadow); background: var(--term); padding: 22px; }
.story-shot-narrow { max-width: 800px; }
.story-shot img { border-radius: 4px; }
.story-shot a { display: block; cursor: zoom-in; }

/* ---------- compare ---------- */
.compare { padding: 104px 0; background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-lede { max-width: 62ch; color: var(--ink-2); }
.table-scroll { margin-top: 40px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 820px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font: 600 12px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg-soft); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
td { color: var(--ink-2); }
td.p, td.y, td.n { white-space: nowrap; }
td.y { color: var(--brand); font-weight: 600; }
td.n { color: var(--line-strong); }
td.p { color: var(--muted); font-style: italic; }
.is-us > * { background: var(--brand-soft); }
.is-us th { color: var(--brand-ink); }
.fine { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* ---------- install ---------- */
.install { padding: 104px 0; }
.install-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.install-grid > div > p + p { margin-top: 16px; }
.install-grid > div > p { color: var(--ink-2); }
.install-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.install-keys { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-inset); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 14px; }
.install-keys label { padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 550; color: var(--muted); cursor: pointer; }
.install-tabs:has(#ins-script:checked) label[for="ins-script"],
.install-tabs:has(#ins-release:checked) label[for="ins-release"],
.install-tabs:has(#ins-source:checked) label[for="ins-source"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.install-tabs:has(input:focus-visible) .install-keys { outline: 2px solid var(--brand); outline-offset: 3px; }
.terminal { display: none; position: relative; background: var(--term); border: 1px solid #252a36; border-radius: 12px; }
.install-tabs:has(#ins-script:checked) [data-pane="script"],
.install-tabs:has(#ins-release:checked) [data-pane="release"],
.install-tabs:has(#ins-source:checked) [data-pane="source"],
.install-tabs:not(:has(input:checked)) [data-pane="script"] { display: block; }
.terminal pre { margin: 0; padding: 22px 24px; padding-right: 88px; overflow-x: auto; color: #dfe4ec; font-size: 14px; line-height: 1.75; }
.terminal .cmd-copy { position: absolute; top: 14px; right: 14px; background: #1c212b; border-color: #2e3442; color: #aab2c2; }
.terminal .cmd-copy:hover { color: #fff; }

/* ---------- faq ---------- */
.faq { padding: 104px 0; border-top: 1px solid var(--line); }
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 24px;
  padding: 20px 0; font-weight: 600; font-size: 17px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-top: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: 11px; }
.faq-list details p { padding: 0 0 22px; color: var(--ink-2); max-width: 64ch; }

/* ---------- cta ---------- */
.cta { padding: 96px 0; background: #0b0d12; color: #eceef3; text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.cta img { border-radius: 14px; }
.cta h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; }
.cmd-dark { background: #12151c; border-color: #2a303c; color: #dfe4ec; }
.cmd-dark .cmd-copy { background: #1c212b; border-color: #2e3442; color: #aab2c2; }

/* ---------- footer ---------- */
.footer { padding: 64px 0 40px; border-top: 1px solid var(--line); font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand p { margin-top: 12px; color: var(--muted); max-width: 30ch; }
.footer h3 { font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer nav a { color: var(--ink-2); }
.footer nav a:hover { color: var(--ink); }
.footer-legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: 13px; }
.footer-legal sup { font-size: .7em; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .story-text, .install-grid, .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .story-text { gap: 20px; }
  .story-shot { padding: 12px; }
  .pillar-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .hero { padding: 56px 0 64px; }
  .lede { font-size: 17px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .cmd { font-size: 13.5px; }
  .btn-primary { justify-content: center; }
  #screens { margin-top: 44px; }
  .screen-keys { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .screen-keys::-webkit-scrollbar { display: none; }
  .screen-keys label { flex: none; }
  .window-bar span { display: none; }
  .screen figcaption { font-size: 14px; padding: 14px 16px; }
  .story, .compare, .install, .faq { padding: 72px 0; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 404 */
.notfound {
  padding: 140px 0;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--brand-soft), transparent 70%),
    var(--bg);
}
.notfound-inner { display: flex; flex-direction: column; align-items: center; }
.notfound .eyebrow { margin-bottom: 0; }
.notfound h1 {
  margin-top: 14px;
  max-width: 18ch;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.1;
  letter-spacing: -.03em;
}
.notfound .lede { margin-top: 18px; max-width: 46ch; text-align: center; }
.notfound .hero-actions { margin-top: 30px; justify-content: center; }
@media (max-width: 720px) {
  .notfound { padding: 80px 0; }
}
