/* Kilo pricing — mobile-first */
:root {
  --bg: #1A1A18;
  --bg-2: #242422;
  --bg-3: #2e2e2a;
  --border: #32322e;
  --text: #fafafa;
  --text-muted: #A1A1A1;
  --brand: #F8F676;
  --brand-dark: #C9C641;
  --on-brand: #0a0a0a;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --maxw: 1120px;
  --pad: 20px;
  --header-h: 68px;
  --font: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px; /* sticky CTA space */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 700; line-height: 1.15; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* Skip link */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 6px; z-index: 100; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; line-height: 1;
  transition: transform .08s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: #fffb9b; }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { color: var(--brand); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; padding: 14px 18px; }
.btn-sub { display: block; font-size: 11px; font-weight: 400; opacity: .85; margin-top: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 12px 0;
  background: rgba(26,26,24,.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Brand (logo + wordmark) — pill outlined */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  color: var(--text); font-weight: 700; font-size: 22px; letter-spacing: -.01em;
  box-shadow: inset 0 0 0 2px rgba(250,250,250,.15), 0 1px 2px rgba(0,0,0,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: color .15s, box-shadow .15s;
}
.brand:hover { color: var(--brand); box-shadow: inset 0 0 0 2px rgba(248,246,118,.35), 0 10px 30px rgba(0,0,0,.25); }
.brand-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  color: #E9E9E8;
}
.brand-icon svg { width: 100%; height: 100%; }
.brand-word { font-weight: 700; }

/* Nav desktop */
.nav-desktop { display: none; }
.nav-desktop ul {
  display: flex; list-style: none; padding: 0; margin: 0;
  box-shadow: inset 0 0 0 2px rgba(250,250,250,.15), 0 1px 2px rgba(0,0,0,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; font-weight: 700; font-size: 14px; white-space: nowrap;
  color: var(--text-muted);
  box-shadow: inset 0 0 0 2px transparent;
  transition: color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.nav-link:hover { color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.nav-link.is-active { color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.nav-link .ext { opacity: .7; }

/* Right cluster */
.header-right { display: flex; align-items: center; gap: 10px; }

/* GitHub star badge */
.gh-badge {
  display: none; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text); font-weight: 600;
  transition: border-color .15s, color .15s;
}
.gh-badge:hover { border-color: #3a3a3a; color: var(--brand); }
.gh-badge img { filter: brightness(0) invert(1); }

/* Auth group (desktop) — connected pills */
.auth-group { display: none; }
.btn-sm { padding: 9px 16px; min-height: 40px; font-size: 14px; border-radius: 0; }
.auth-group .btn {
  box-shadow: inset 0 0 0 2px var(--border);
  border: 0;
}
.auth-group .btn-primary { box-shadow: inset 0 0 0 2px rgba(250,250,250,.15); margin-left: -2px; }

/* Burger (mobile) — card-style square */
.burger {
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 2px var(--border);
  color: var(--text);
  transition: color .15s, box-shadow .15s;
}
.burger:hover { color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.burger .icon-close { display: none; }
body.menu-open .burger .icon-menu { display: none; }
body.menu-open .burger .icon-close { display: block; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
  background: var(--bg); padding: 24px var(--pad);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; gap: 24px; overflow-y: auto;
}
body.menu-open .drawer { transform: translateX(0); }
.drawer nav { display: flex; flex-direction: column; gap: 4px; }
.drawer nav a { padding: 14px 0; font-size: 18px; font-weight: 500; border-bottom: 1px solid var(--border); }
.drawer-auth { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.drawer-auth .btn { width: 100%; padding: 14px; }

/* Hero */
.hero { padding: 48px 0 28px; }
.hero .lede { color: var(--text-muted); font-size: 1.1rem; max-width: 620px; }
.quick-links {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  list-style: none; padding: 0; margin: 28px 0 0;
}
.quick-links a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2);
  transition: border-color .15s, transform .08s;
}
.quick-links a:hover { border-color: var(--brand); }
.quick-links a:active { transform: scale(.98); }
.quick-links strong { font-size: 15px; font-weight: 600; }
.quick-links span { font-size: 12px; color: var(--text-muted); }
.quick-links em { font-size: 12px; color: var(--brand); font-style: normal; font-weight: 600; margin-top: 4px; }

/* Social proof */
.social-proof { padding: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.eyebrow { text-align: center; font-size: 13px; color: var(--text-muted); text-transform: none; margin-bottom: 20px; }
.logo-track { display: flex; gap: 48px; width: max-content; animation: scroll 40s linear infinite; }
.logo-row { display: flex; gap: 48px; align-items: center; }
.logo-row img { height: 24px; width: auto; opacity: .55; filter: brightness(0) invert(1); flex-shrink: 0; }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Product sections */
.product { padding: 56px 0; border-bottom: 1px solid var(--border); }
.product-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; }
.product-head p { color: var(--text-muted); margin: 0; font-size: .95rem; }
.product-icon { width: 44px; height: 44px; flex-shrink: 0; }
.product-logo-lg { width: 44px; height: 44px; flex-shrink: 0; color: #E9E9E8; display: grid; place-items: center; }
.product-logo-lg svg { width: 100%; height: 100%; }

/* Tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px; margin-bottom: 20px;
}
.tabs [role="tab"] {
  padding: 12px; border-radius: 9px; font-weight: 600; font-size: 14px;
  color: var(--text-muted); transition: background .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.badge { font-size: 11px; font-weight: 700; background: var(--brand); color: var(--on-brand); padding: 2px 6px; border-radius: 6px; }

/* Plans */
.plan {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; position: relative;
}
.plan.popular { border-color: var(--brand); }
.plan-ribbon {
  position: absolute; top: -12px; right: 20px;
  background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .02em;
}
.plan-price { display: flex; align-items: baseline; gap: 2px; margin: 8px 0 4px; font-weight: 700; }
.plan-price .currency { font-size: 1.5rem; }
.plan-price .amount { font-size: clamp(2.6rem, 9vw, 3.5rem); line-height: 1; letter-spacing: -.03em; }
.plan-price .period { font-size: .95rem; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.plan-price-free { font-size: 1.6rem; color: var(--brand); margin: 8px 0 4px; font-weight: 700; }
.plan-sub { color: var(--text-muted); font-size: .9rem; margin: 0 0 20px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.plan-features li { position: relative; padding-left: 26px; font-size: .95rem; color: var(--text); line-height: 1.45; }
.plan-features li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px;
  background: var(--brand); mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M7 10.5l2 2 4-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/><circle cx='10' cy='10' r='8' stroke='white' stroke-width='1.5' fill='none'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M7 10.5l2 2 4-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/><circle cx='10' cy='10' r='8' stroke='white' stroke-width='1.5' fill='none'/></svg>") center/contain no-repeat;
}
.fine-print { font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.link-arrow { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-block; margin-top: 12px; }
.link-arrow.center { display: block; text-align: center; margin-top: 24px; }

/* Kilo Pass */
.promo-banner {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: var(--on-brand); padding: 14px 16px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.promo-banner strong { font-size: 14px; }
.promo-banner span { opacity: .92; font-size: 13px; }

.billing-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px; margin-bottom: 20px;
}
.billing-toggle [role="tab"] {
  padding: 12px; border-radius: 9px; font-weight: 600; font-size: 14px;
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
}
.billing-toggle [role="tab"][aria-selected="true"] { background: var(--bg); color: var(--text); }

.pass-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: 85%;
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 2px 14px; margin: 0 calc(var(--pad) * -1) 20px; padding-left: var(--pad); padding-right: var(--pad);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pass-grid::-webkit-scrollbar { display: none; }
.pass-grid .plan-sm { scroll-snap-align: center; padding: 22px 20px; }

/* Calculator */
.calculator {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-top: 4px;
}
.calculator > summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.calculator > summary::-webkit-details-marker { display: none; }
.calculator > summary::after { content: "+"; font-size: 20px; color: var(--text-muted); }
.calculator[open] > summary::after { content: "−"; }
.calc-body { padding-top: 16px; display: grid; gap: 14px; }
.calc-body label { display: grid; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.calc-body select, .calc-body input[type="range"] {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 10px; border-radius: 8px; font: inherit; width: 100%;
}
.calc-body input[type="range"] { padding: 0; accent-color: var(--brand); }
.calc-body output { display: inline-block; color: var(--text); font-weight: 600; font-size: 15px; }
.calc-results { display: grid; gap: 8px; margin: 0; padding: 12px; background: var(--bg-3); border-radius: 10px; }
.calc-results > div { display: flex; justify-content: space-between; font-size: 14px; }
.calc-results dt, .calc-results dd { margin: 0; }
.calc-results dd { font-weight: 600; }
.calc-results .total { padding-top: 8px; border-top: 1px solid var(--border); font-size: 15px; }
.calc-results .total dd { color: var(--brand); font-size: 17px; }
.calc-note { margin: 0; color: var(--brand); font-size: 13px; font-weight: 600; text-align: center; }

/* Teams grid */
.teams-grid { display: grid; gap: 16px; }

/* Flexibility */
.flex { padding: 56px 0; background: var(--bg-2); }
.flex .lede { color: var(--text-muted); }
.flex-grid { display: grid; gap: 20px; margin-top: 24px; }
.flex-grid > div { padding: 20px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.flex-grid h3 { color: var(--brand); margin-bottom: 8px; font-size: 1.05rem; }
.flex-grid p { color: var(--text-muted); margin: 0; font-size: .93rem; }

/* Sticky CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--pad) max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(26,26,24,.98) 60%, rgba(26,26,24,0));
  pointer-events: none;
}
.sticky-cta .btn { pointer-events: auto; box-shadow: 0 10px 30px rgba(248,246,118,.35); }

/* Footer */
.site-footer { padding: 48px 0 32px; border-top: 1px solid var(--border); background: var(--bg); }
.footer-brand { margin-bottom: 24px; }
.footer-col { border-top: 1px solid var(--border); }
.footer-col:last-of-type { border-bottom: 1px solid var(--border); }
.footer-col summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.footer-col summary::-webkit-details-marker { display: none; }
.footer-col summary::after { content: "+"; color: var(--text-muted); font-size: 20px; }
.footer-col[open] summary::after { content: "−"; }
.footer-col ul { list-style: none; padding: 0 0 16px; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--brand); }
.copyright { margin-top: 28px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* ≥ 640px */
@media (min-width: 640px) {
  :root { --pad: 28px; }
  .hero { padding: 72px 0 40px; }
  .quick-links { grid-template-columns: repeat(4, 1fr); }
  .product { padding: 72px 0; }
  .pass-grid { grid-auto-columns: 1fr; grid-auto-flow: column; overflow: visible; margin: 0 0 24px; padding: 0; }
  .teams-grid { grid-template-columns: 1fr 1fr; }
  .flex-grid { grid-template-columns: repeat(3, 1fr); }
  .sticky-cta { display: none; }
  body { padding-bottom: 0; }
}

/* ≥ 1024px */
@media (min-width: 1024px) {
  .burger { display: none; }
  .drawer { display: none; }
  .nav-desktop { display: flex; flex: 1; justify-content: center; }
  .gh-badge { display: inline-flex; }
  .auth-group { display: inline-flex; }
  .hero h1 { max-width: 820px; }
  .product-head { gap: 18px; }

  .site-footer .container {
    display: grid;
    grid-template-columns: 1.2fr repeat(4, 1fr);
    gap: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col { border: 0 !important; }
  .footer-col summary { cursor: default; padding: 0 0 14px; font-size: 13px; color: var(--text); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
  .footer-col summary::after { display: none; }
  .footer-col[open], .footer-col:not([open]) { }
  .footer-col ul { padding: 0; }
  .footer-col { display: block; }
  /* Force details content visible on desktop */
  .footer-col:not([open]) ul { display: grid; }
  .copyright { grid-column: 1 / -1; text-align: left; border-top: 1px solid var(--border); padding-top: 24px; }
}

/* Focus states */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
