/* Torwarden — public site.
 *
 * Design: "Product" — soft elevation, rounded surfaces, tinted section bands,
 * a centred hero. Committed dark: the app is dark, so a site that flipped to
 * white on a light OS would look like a different company's product between
 * the marketing page and the first screenshot.
 *
 * Because it commits, every colour is painted explicitly and nothing is left
 * to the host's ground. The absence of a prefers-color-scheme block here is a
 * decision, not an omission.
 *
 * Two tiers: primitives first, then semantic aliases. Components name aliases,
 * never raw values, so a palette change stays one block.
 *
 * No font files, no CDN, no build step, no JavaScript. The product's whole
 * promise is that it has no runtime dependencies; a marketing site that pulls
 * three of them in from someone else's server is an odd way to say so.
 */

:root {
  color-scheme: dark;

  /* --- brand primitives --- */
  --brand-lime: #81f222;
  --brand-ink: #0d0f12;

  /* --- ground and surfaces --- */
  --ground: #0b0d10;
  --surface: #14181d;        /* cards, panels */
  --surface-2: #0f1216;      /* tinted section bands */
  --surface-3: #191e24;      /* table headers, inset chrome */
  --code-bg: #07090b;        /* terminal blocks sit below the ground */

  /* --- text --- */
  --fg-strong: #ffffff;
  --fg: #e7ebf0;
  --fg-muted: rgba(231, 235, 240, .64);
  --fg-dim: rgba(231, 235, 240, .42);

  /* --- lines --- */
  --line: #232931;
  --hairline: rgba(231, 235, 240, .10);
  --edge: #2b323b;

  /* --- accent. Lime is the CTA on a dark ground; as running text it is too
         hot, so --accent-text is the calmer one for labels. --- */
  --accent: var(--brand-lime);
  --accent-fg: #0a1400;
  --accent-soft: rgba(129, 242, 34, .11);
  --accent-line: rgba(129, 242, 34, .28);
  --accent-text: #a6f45f;
  --link: #9bd7ff;

  --ok: #46d17f;
  --warn: #f0b429;
  --crit: #ef5f5f;

  /* --- elevation. A dark surface reads depth from a lifted background plus a
         soft ambient shadow; a hard offset shadow just looks like a smudge. --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 26px rgba(0, 0, 0, .32);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .45), 0 18px 46px rgba(0, 0, 0, .45);

  --r: 12px;
  --r-sm: 8px;

  --maxw: 1000px;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 58px; }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg-strong); }
.brand svg { width: 25px; height: 25px; flex: none; }
.brand b { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; }

.site-nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--fg-muted); text-decoration: none; font-size: 13.5px; font-weight: 550; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--fg-strong); }

/* --------------------------------------------------------------- buttons --- */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--fg-strong);
  font: 600 14px/1.2 var(--sans);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .14s ease, border-color .14s ease, transform .1s ease;
}
.btn:hover { background: var(--surface-3); border-color: #39414c; color: var(--fg-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: var(--accent-fg);
  border-color: transparent; font-weight: 700;
}
.btn-primary:hover { background: #92f841; border-color: transparent; color: var(--accent-fg); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ------------------------------------------------------------------ type --- */

h1, h2, h3, h4 { color: var(--fg-strong); line-height: 1.18; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.6rem); font-weight: 750; letter-spacing: -.026em; margin-top: 0; }
h3 { font-size: 1.02rem; font-weight: 700; margin-top: 0; }
h4 { font-size: .94rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--fg-strong); }

.lede { font-size: 1.02rem; color: var(--fg-muted); max-width: 56ch; }
.eyebrow {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 14px;
}
.muted { color: var(--fg-muted); }

code {
  font-family: var(--mono); font-size: .87em;
  background: var(--surface-3); color: var(--fg);
  padding: .14em .42em; border-radius: 5px;
  border: 1px solid var(--hairline);
}
pre {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.8;
  background: var(--code-bg); color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px; margin: 0 0 1.2em;
  overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.tbl-wrap { overflow-x: auto; margin: 0 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th {
  font: 700 10.5px/1.4 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-dim);
}
td code { white-space: nowrap; }

/* ----------------------------------------------------------------- notes --- */

.note {
  border: 1px solid var(--line); border-left: 3px solid var(--edge);
  border-radius: var(--r-sm); background: var(--surface);
  padding: 15px 18px; margin: 0 0 1.4em;
  box-shadow: var(--shadow-sm);
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--fg-strong); }
.note-warn { border-left-color: var(--warn); }
.note-info { border-left-color: var(--accent); }
.note-spaced { margin-top: 24px; }

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

.hero { padding: clamp(52px, 8vw, 84px) 0 34px; text-align: center; }
.hero .lede { margin: 0 auto 24px; }
.hero h1 { max-width: 15ch; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-note { font-size: 12.5px; color: var(--fg-dim); margin-top: 18px; }

/* The pill is the page's one ornament, so it carries the single fact a visitor
   most wants confirmed before reading anything else. */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 5px 14px; margin-bottom: 18px;
  font: 600 12px/1 var(--sans);
}
.pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none;
}

/* -------------------------------------------------------------- sections --- */

.section { padding: 40px 0; }
.section > h2:first-child { margin-top: 0; }
.section-lede { max-width: 58ch; color: var(--fg-muted); }

/* Alternating tinted bands give the page rhythm without rules or boxes. A band
   must span the viewport, so it wraps a .wrap rather than sitting inside one. */
.band {
  background: var(--surface-2);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.section-head { text-align: center; margin-bottom: 26px; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--fg-muted); max-width: 54ch; margin: 0 auto; }

/* A section head is normally a centred one-liner. Where the body is two real
   paragraphs — as under "What leaves your network" — centring 480 characters
   inside 54ch makes a tall thin ribbon that is genuinely hard to read. The
   heading stays centred; the prose gets a wider measure and a left edge to
   return to. */
.section-head-prose p { text-align: left; max-width: 68ch; }
.section-head-prose p + p { margin-top: 12px; }

/* ----------------------------------------------------------------- cards --- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 20px 21px 18px;
}
.card h3 { margin: 0 0 .35em; font-size: .96rem; }
.card p { color: var(--fg-muted); font-size: 13.5px; margin: 0; }
.card-mark {
  font: 700 10.5px/1 var(--mono); letter-spacing: .13em;
  color: var(--accent-text); text-transform: uppercase; margin: 0 0 9px;
}

/* --------------------------------------------------------------- install --- */

.install-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 22px; }
.install-card {
  min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 20px 21px 18px;
}
.install-card h3 { margin: 0 0 .2em; font-size: 1rem; }
.install-card > p { color: var(--fg-muted); font-size: 13.5px; margin: 0 0 13px; }
.install-card pre { margin: 0 0 12px; }
.install-card pre:last-child { margin-bottom: 0; }
.install-note { font-size: 12.5px; color: var(--fg-dim); margin: 12px 0; }

/* ------------------------------------------------------------ screenshot --- */

.shot {
  display: block; width: 100%; height: auto;
  max-width: 860px; margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
figure { margin: 0 0 1.6em; }
figcaption {
  text-align: center; max-width: 860px; margin: 12px auto 0;
  font-size: 13px; color: var(--fg-dim);
}

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

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.pricing-switch { display: flex; justify-content: center; margin: 22px 0 26px; }
.switch-track {
  display: inline-flex; align-items: stretch; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.switch-track .opt {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 17px; border-radius: 999px;
  font: 600 13px/1 var(--sans); color: var(--fg-muted); white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.switch-track .opt em {
  font: 700 10px/1 var(--mono); letter-spacing: .06em; font-style: normal; opacity: .85;
}
.switch-track .opt-m { background: var(--accent); color: var(--accent-fg); }
#billing-yearly:focus-visible ~ .pricing-switch .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The toggle is a checkbox and a handful of sibling selectors — no JavaScript
   on a site whose product's entire pitch is having no runtime dependencies. */
#billing-yearly:checked ~ .pricing-switch .opt-m { background: none; color: var(--fg-muted); }
#billing-yearly:checked ~ .pricing-switch .opt-y { background: var(--accent); color: var(--accent-fg); }

.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid var(--accent-line); border-radius: 5px;
  font: 700 9.5px/1 var(--mono); letter-spacing: .06em;
  padding: 4px 6px; margin-left: 7px; vertical-align: 1px;
}


/* ------------------------------------------------------------------ docs --- */

.docs { display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 40px; padding: 30px 0 56px; }
.docs-nav { position: sticky; top: 78px; align-self: start; font-size: 14px; }
.docs-nav h4 {
  font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-dim); margin: 20px 0 8px;
}
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav a {
  display: block; padding: 5px 0 5px 12px; color: var(--fg-muted);
  text-decoration: none; border-left: 2px solid var(--hairline);
}
.docs-nav a:hover { color: var(--fg-strong); }
.docs-nav a[aria-current] { color: var(--fg-strong); font-weight: 650; border-left-color: var(--accent); }

.docs-body { min-width: 0; max-width: 74ch; }
.docs-body h2 { margin-top: 1.9em; }
.docs-body h2:first-of-type { margin-top: .6em; }
.docs-body h3 { margin-top: 1.7em; }
.docs-body ul, .docs-body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.docs-body li { margin-bottom: .4em; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li {
  counter-increment: step;
  position: relative; padding-left: 42px; margin-bottom: 1.8em;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg);
  font: 700 13px/1 var(--mono);
}
.steps > li > h3 { margin-top: 0; }

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

.site-foot {
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
  padding: 34px 0 44px; font-size: 14px;
}
.foot-grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.site-foot h4 {
  font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-dim); margin: 0 0 10px;
}
.site-foot a { display: block; color: var(--fg-muted); text-decoration: none; padding: 3px 0; }
.site-foot a:hover { color: var(--fg-strong); }
.foot-legal {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--fg-dim); font-size: 12.5px;
}

/* ----------------------------------------------------------------- small --- */

@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 0; }
  .docs-nav {
    position: static; margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 1px solid var(--hairline);
  }
  .docs-nav a { display: inline-block; border-left: 0; padding: 4px 12px 4px 0; }
  .docs-nav a[aria-current] { border-left: 0; text-decoration: underline; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 13px; }
}

@media (max-width: 640px) {
  .site-head .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .site-nav { width: 100%; margin-left: 0; flex-wrap: wrap; }

}

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-fg);
  padding: 10px 16px; border-radius: var(--r-sm); z-index: 50;
}
.skip:focus { left: 12px; top: 10px; }

/* Replacing two inline style attributes. The site sends a strict CSP with
 * style-src 'self' and no 'unsafe-inline', so a style= attribute is silently
 * dropped by the browser — the rule has to live in this file to apply. */
.hero-cta-spaced { margin-top: 22px; }
.figure-spaced   { margin-top: 30px; }

/* The line under the hero buttons. The credentials themselves live on the
 * sign-in page now, where someone needs them. */
.demo-note { margin-top: 10px; }

/* ---------------------------------------------------------------- pricing --
   Vertical cards rather than a wide table. A table made the reader compare
   across a row to answer "what do I get", which is the wrong axis: people pick
   a plan, then read down it. Cards also survive a narrow screen without the
   data-label trick the table needed. */
.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.tier-card {
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
/* The one we would like read first, marked once and quietly. */
.tier-card-featured {
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.tier-head { min-height: 52px; }
.tier-name {
  display: inline; margin: 0;
  font: 700 15px/1.2 var(--sans); color: var(--fg-strong); letter-spacing: -.01em;
}
.tier-tag {
  margin-left: 7px; padding: 2px 7px; border-radius: 999px; vertical-align: 2px;
  font: 700 9.5px/1.6 var(--sans); letter-spacing: .09em;
  color: var(--accent-fg); background: var(--accent);
}
.tier-for { margin: 4px 0 0; font-size: 12px; color: var(--fg-dim); }

.tier-price { margin-top: 16px; white-space: nowrap; }
.tier-price .amt {
  font: 700 30px/1 var(--sans); color: var(--fg-strong); letter-spacing: -.03em;
}
.tier-price .per { margin-left: 2px; font-size: 12.5px; color: var(--fg-dim); }
.tier-note { margin: 5px 0 0; font-size: 12px; color: var(--fg-dim); min-height: 16px; }

.tier-facts { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--hairline); }
.tier-facts > div { display: flex; justify-content: space-between; gap: 10px; }
.tier-facts > div + div { margin-top: 8px; }
.tier-facts dt { font-size: 12px; color: var(--fg-dim); }
.tier-facts dd { margin: 0; font-size: 12.5px; color: var(--fg); text-align: right; }

/* Pushed to the bottom so every card's button sits on one line, whatever the
   support text above it does. margin-top:auto belongs on the flex child, which
   is this wrapper — not on the button inside it. */
.tier-cta { margin-top: auto; padding-top: 18px; }
/* .btn is display:inline-block, so justify-content is inert on it — that is a
   flex property and there is no flex container here. A full-width
   inline-block centres its text with text-align. */
.tier-cta .btn { width: 100%; text-align: center; }

/* The billing toggle swaps price, note and button together. Yearly is hidden
   by default; the checked state hides monthly and reveals it. */
.tiers .by { display: none; }
#billing-yearly:checked ~ .tiers .bm { display: none; }
#billing-yearly:checked ~ .tiers .tier-price > .by { display: inline; }
#billing-yearly:checked ~ .tiers p.tier-note.by { display: block; }
#billing-yearly:checked ~ .tiers .tier-cta .by { display: inline-flex; }
