/* ApiSky marketing site — shared styles. Dark-first. See README.md.
   Fonts are self-hosted so the site makes no third-party request. SIL OFL 1.1. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* Shadows are near-invisible on this ground; cards separate by lightness. */
  --ground:   #0a0c10;
  --layer-1:  #11141a;
  --layer-2:  #171b23;
  --rule:     rgba(255, 255, 255, .08);
  --rule-2:   rgba(255, 255, 255, .14);

  --ink:      #e7ecf3;
  --ink-2:    #a3adbd;
  --muted:    #7c8899;  /* 5.1:1 on --layer-1; do not darken further */

  --accent:   #4dd4e8;
  --accent-2: #2aa6ba;
  --on-accent:#04171c;
  --accent-faint: rgba(77, 212, 232, .10);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;

  --wide: 1120px;
  --max: 68ch;
  --radius: 14px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Anchor targets must clear the sticky header. */
  scroll-padding-top: 5rem;
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .2px;  /* dark backgrounds read denser; a little air helps */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
  font-weight: 650;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.75rem; margin-top: 0; }
h3 { font-size: 1.05rem; margin-top: 1.8rem; letter-spacing: -.01em; }

p { margin: 0 0 1rem; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

strong { color: var(--ink); font-weight: 620; }

::selection { background: rgba(77, 212, 232, .25); color: #fff; }

/* ---------- shared bits ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
}

.section-head { max-width: 62ch; margin-bottom: 2.25rem; }
.section-head h2 { text-wrap: balance; }
.section-head p { color: var(--ink-2); margin-bottom: 0; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: rgba(10, 12, 16, .78);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

.bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo .mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -.02em;
  flex: none;
}
.logo .word { display: inline-block; }
.logo .word b { color: var(--accent); font-weight: inherit; }

/* The row must never wrap: below 860px the burger takes over instead. */
nav.site { display: flex; align-items: center; flex-shrink: 0; }
.nav-links { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.4rem; }

/* Clipped, not display:none — must stay focusable and keep its label as its name. */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  margin-right: -10px;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger:hover { background: var(--layer-2); }
.nav-burger .i-close { display: none; }
.nav-toggle:checked ~ .nav-burger .i-open { display: none; }
.nav-toggle:checked ~ .nav-burger .i-close { display: block; }
/* Focus ring goes on the label; the input is clipped. */
.nav-toggle:focus-visible ~ .nav-burger {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
nav.site a {
  font-size: .9rem;
  text-decoration: none;
  color: var(--ink-2);
  transition: color .15s ease;
}
nav.site a:hover { color: var(--ink); }

nav.site a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

.nav-cta {
  padding: .4rem .9rem;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  color: var(--ink) !important;
  font-weight: 550;
  transition: border-color .15s ease, background .15s ease;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-faint); }

main { display: block; }
main.prose {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}
main.prose p, main.prose li { max-width: var(--max); }
main.prose h2 { font-size: 1.3rem; margin-top: 2.8rem; }
main.prose h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); }
main.prose ul { padding-left: 1.15rem; }
main.prose li { margin-bottom: .4rem; }

section { padding: 5rem 0; }
section + section { border-top: 1px solid var(--rule); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4.5rem;
  border-top: 0;
}

/* Decorative: keeps the ground from being a flat black rectangle. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 0%, transparent 72%);
  opacity: .7;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -35%;
  left: 50%;
  width: min(1000px, 120%);
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(77, 212, 232, .13) 0%, transparent 65%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3.5rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -.033em;
  margin-bottom: 1.1rem;
  /* Without this the last line is a single orphaned word. Unsupported
     browsers just get the normal greedy wrap. */
  text-wrap: balance;
}
.hero .lede {
  font-size: 1.1rem;
  max-width: 46ch;
  color: var(--ink-2);
  margin-bottom: 1.8rem;
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.35rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  font-weight: 620;
  font-size: .95rem;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.cta:hover { background: #6fe0f0; color: var(--on-accent); transform: translateY(-1px); }
.cta svg { flex: none; }

.cta-ghost {
  font-size: .95rem;
  font-weight: 550;
  color: var(--ink-2);
  text-decoration: none;
}
.cta-ghost:hover { color: var(--accent); }

.cta-note {
  margin: 1.1rem 0 0;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--muted);
}

/* ---------- editor panel mock ---------- */

.panel {
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--layer-1);
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, .85);
  overflow: hidden;
  font-size: .82rem;
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  background: var(--layer-2);
  border-bottom: 1px solid var(--rule);
}
.panel-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-2); flex: none; }
.panel-bar .title {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  margin-left: .35rem;
  letter-spacing: .04em;
  /* min-width:0 lets it shrink below content width, so it ellipses not wraps. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Carries "switch per task" visually. */
.panel-bar .model {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .02em;
  color: var(--ink-2);
  background: var(--ground);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  padding: .12rem .45rem;
  white-space: nowrap;
}

.panel-body { padding: 1.05rem .95rem; display: flex; flex-direction: column; gap: .85rem; }

.msg-user {
  align-self: flex-end;
  max-width: 88%;
  background: var(--accent-faint);
  border: 1px solid rgba(77, 212, 232, .28);
  color: var(--ink);
  border-radius: 10px 10px 2px 10px;
  padding: .5rem .75rem;
  line-height: 1.5;
}

.msg-tool {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.9;
}
.msg-tool .label { color: var(--ink-2); }
.msg-tool .file { color: var(--accent); }

.msg-bot {
  border-left: 2px solid var(--accent);
  padding-left: .8rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.msg-bot code {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink);
  background: var(--layer-2);
  padding: .1rem .3rem;
  border-radius: 4px;
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  justify-content: space-between;
  padding: .6rem .95rem;
  border-top: 1px solid var(--rule);
  background: var(--layer-2);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
}
.panel-foot .cost { color: var(--ink-2); }

/* ---------- feature grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
}

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--layer-1);
  padding: 1.5rem;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.card:hover { border-color: var(--rule-2); background: var(--layer-2); transform: translateY(-2px); }
.card .num {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .9rem;
}
.card h3 { margin: 0 0 .5rem; font-size: 1.02rem; }
.card p { color: var(--ink-2); margin-bottom: 0; font-size: .95rem; }

/* ---------- steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
  counter-reset: step;
}
.step { position: relative; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: -.7rem;
  left: 0;
  background: var(--ground);
  padding-right: .6rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .1em;
}
.step h3 { margin: 0 0 .4rem; font-size: 1rem; }
.step p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- pricing ---------- */

.rates {
  margin: 2rem 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--layer-1);
  overflow: hidden;
}
.rate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem 1.5rem;
  padding: .95rem 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.rate:last-child { border-bottom: 0; }
.rate dt {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.rate dd {
  margin: 0;
  color: var(--ink-2);
  font-size: .98rem;
  text-align: right;
}
.rate dd b {
  color: var(--ink);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.currency-note {
  margin-top: 2rem;
  font-size: .88rem;
  color: var(--muted);
  max-width: 70ch;
}

/* ---------- security ---------- */

.assurances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.1rem;
}
.assure {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--layer-1);
  padding: 1.5rem;
}
.assure h3 { margin: 0 0 .5rem; font-size: 1rem; }
.assure p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.assure .descriptor {
  font-family: var(--mono);
  color: var(--ink);
  background: var(--layer-2);
  border: 1px solid var(--rule-2);
  padding: .1rem .4rem;
  border-radius: 5px;
  font-size: .85rem;
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
}
.contact-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--layer-1);
  padding: 1.35rem 1.4rem;
}
.contact-card dt {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .55rem;
}
.contact-card dd { margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.55; }
.contact-card dd a { text-decoration: none; }
.contact-card dd a:hover { text-decoration: underline; }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--rule);
  background: var(--layer-1);
}
footer.site .inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 2.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  font-size: .9rem;
  color: var(--muted);
}
footer.site .brand .logo { margin-bottom: .75rem; }
footer.site .brand p { max-width: 34ch; margin: 0; font-size: .88rem; color: var(--muted); }
footer.site h4 {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .85rem;
  font-weight: 500;
}
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: .5rem; }
footer.site a { color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--accent); }
footer.site .legal {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: .83rem;
  color: var(--muted);
}

/* ---------- prose extras ---------- */

.updated {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .93rem; }
th, td { text-align: left; padding: .6rem 1rem .6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-family: var(--mono);
  color: var(--muted);
  font-weight: 500;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* Command snippets on the connector page. CSP forbids inline styles. */
pre {
  background: var(--layer-1);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: .9rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--ink);
}
main.prose code { font-family: var(--mono); font-size: .9em; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
  .hero { padding: 3.5rem 0 3.5rem; }
  section { padding: 3.5rem 0; }
}

/* Eight links plus the logo need ~750px of bar; below that it collapses. */
@media (max-width: 860px) {
  /* Static without nav.js: nothing could close the panel on a link tap, and a
     pinned open panel would cover the destination. See README. */
  header.site { position: static; }
  .nav-js header.site { position: sticky; top: 0; }

  /* Eight rows can exceed a short viewport in landscape. */
  .nav-js .nav-toggle:checked ~ nav.site {
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* The wordmark is a link home; it was a 28px target. */
  .logo { min-height: 44px; }

  .bar { padding: .6rem 1.1rem; gap: 0; }

  .nav-burger { display: inline-flex; }

  nav.site { display: none; width: 100%; }
  .nav-toggle:checked ~ nav.site { display: block; }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-bottom: .5rem;
  }

  /* 44px tap targets. */
  nav.site a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .25rem 0;
    font-size: .95rem;
    border-top: 1px solid var(--rule);
  }
  nav.site a[aria-current="page"] {
    border-bottom: 0;
    padding-bottom: .25rem;
    color: var(--accent);
  }

  .nav-cta {
    justify-content: center;
    margin-top: .75rem;
    min-height: 44px;
    border-radius: 10px;
  }
  .nav-cta, .nav-cta:hover { border-color: var(--rule-2); }
}

@media (max-width: 620px) {
  body { font-size: 15.5px; }

  /* Set in rem, so they ignore the body size above and landed at 11.2-11.8px.
     Card numbers and the panel mock stay small on purpose. */
  .eyebrow { font-size: .78rem; letter-spacing: .07em; }
  .contact-card dt, .rate dt { font-size: .76rem; }
  footer.site h4 { font-size: .76rem; }
  .wrap { padding: 0 1.1rem; }
  main.prose { padding: 2.5rem 1.1rem 3rem; }
  h2 { font-size: 1.45rem; }
  .cta { width: 100%; justify-content: center; }
  .cta-row { gap: .9rem; }
  .cta-ghost { width: 100%; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  footer.site .inner { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; padding: 2.5rem 1.1rem 2rem; }
  footer.site .legal { padding: 1.25rem 1.1rem 2rem; }
  footer.site li { margin-bottom: 0; }
  footer.site li a { display: inline-flex; align-items: center; min-height: 40px; }

  /* Legal pages carry tables; let them scroll rather than force the page wide. */
  main.prose table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .card:hover, .cta:hover { transform: none; }
}

/* Lift contrast rather than ship a second, untested theme. */
@media (prefers-contrast: more) {
  :root { --rule: rgba(255,255,255,.2); --rule-2: rgba(255,255,255,.34); --ink-2: #ccd4de; --muted: #9aa5b4; }
}
