/* isotunnel website. Design rules (see design/site-studio.html to tune them):
   - Reads like a useful page made by a person, in the hscpapers spirit: plain text first,
     a frame only around the two things that are objects (the app screenshot, the "get it" box).
   - No slogan hero, no numbered step cards, no stock section order, no mono labels.
   - Same tokens as the app: Merriweather Sans everywhere, tabular figures, Graphite palette.
   - Theme follows the system unless the visitor picks one.
   Layout: a text column with the app screenshot beside it (sticky), stacking on phones.
   Switches on <html>: data-shot, data-frame, data-links, data-rules, data-changelog. */
@font-face { font-family: "Merriweather Sans"; font-weight: 400; font-display: swap; src: url(fonts/merriweather-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Merriweather Sans"; font-weight: 700; font-display: swap; src: url(fonts/merriweather-sans-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #f4f4f3; --surface: #fbfbfa; --hover: #ebebe9; --border: #dadad6;
  --text: #1c1c1a; --dim: #666660; --accent: #1c1c1a; --on-accent: #ffffff; --link: #1c1c1a; --bad: #b33a2c;

  --font: "Merriweather Sans", system-ui, sans-serif;
  --fs: 15px;
  --lh: 1.3;
  --h1: 52px;
  --h2: 16px;
  --hw: 400;
  --measure: 74ch;
  --wrap: 1140px;
  --gap: 22px;      /* between sections */
  --radius: 8px;
  --shot-w: 360px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1a1a1a; --hover: #232323; --border: #2e2e2e;
    --text: #ececec; --dim: #9c9c9c; --accent: #ececec; --on-accent: #111111; --link: #ececec; --bad: #ef6a5a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1a1a1a; --hover: #232323; --border: #2e2e2e;
  --text: #ececec; --dim: #9c9c9c; --accent: #ececec; --on-accent: #111111; --link: #ececec; --bad: #ef6a5a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* our display rules must never un-hide an element */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs) / var(--lh) var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
h1 { font-size: var(--h1); line-height: 1.2; font-weight: var(--hw); letter-spacing: -0.01em; }
h2 { font-size: var(--h2); line-height: 1.3; font-weight: var(--hw); }
h3 { font-size: 1em; font-weight: var(--hw); }
.dim { color: var(--dim); }

a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:root[data-links="plain"] main a:not(.btn) { text-decoration: none; border-bottom: 1px solid var(--border); }
:root[data-links="plain"] main a:not(.btn):hover { border-color: currentColor; }

/* single-line UI text sits high in this font: trim to cap height, as in the app */
.btn, .top a, .top .brand { text-box: trim-both cap alphabetic; }

/* ── header: as plain as hscpapers' ── */
.top-inner { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.top nav { display: flex; gap: 18px; margin-left: auto; font-size: 14px; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.theme {
  width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--dim);
  display: grid; place-items: center; cursor: pointer;
}
.theme:hover { color: var(--text); background: var(--hover); }
.theme svg { width: 15px; height: 15px; }
:root[data-rules="on"] .top { border-bottom: 1px solid var(--border); }
@media (max-width: 520px) {
  .top-inner { gap: 12px; }
  .top nav { gap: 14px; }
  .top nav a:not(:first-child) { display: none; }
}

/* ── page grid: text column + screenshot ── */
.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--shot-w); gap: 56px; padding-block: 40px 64px; align-items: start; }
.text { display: grid; gap: var(--gap); min-width: 0; }
.text > section { display: grid; gap: 12px; max-width: var(--measure); }
:root[data-rules="on"] .text > section + section { border-top: 1px solid var(--border); padding-top: var(--gap); }
.text p { max-width: var(--measure); }

.shot { position: sticky; top: 24px; margin: 0; display: grid; gap: 10px; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: 13px; color: var(--dim); }
.shot .light-img { display: none; }
.shot .dark-img { display: block; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .shot .light-img { display: block; } :root:not([data-theme="dark"]) .shot .dark-img { display: none; } }
:root[data-theme="light"] .shot .light-img { display: block; }
:root[data-theme="light"] .shot .dark-img { display: none; }

:root[data-frame="border"] .shot .frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
:root[data-frame="shadow"] .shot .frame { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 22px 50px -28px rgba(0, 0, 0, 0.5); }

:root[data-shot="top"] .page { grid-template-columns: minmax(0, 1fr); }
:root[data-shot="top"] .shot { position: static; order: -1; width: min(100%, var(--shot-w)); }
:root[data-shot="none"] .page { grid-template-columns: minmax(0, 1fr); }
:root[data-shot="none"] .shot { display: none; }

@media (max-width: 820px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 24px 48px; }
  .shot { position: static; width: min(100%, var(--shot-w)); grid-row: 2; }
  .text { display: contents; }
  .intro { grid-row: 1; }
  .text > section:not(.intro) { grid-row: auto; }
  .page > .text > section { margin-bottom: 0; }
}

/* ── intro ── */
.intro { gap: 14px; }
.intro .lede { font-size: 1.06em; }

/* ── the one boxed thing: getting it ── */
.get {
  padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: grid; gap: 12px; max-width: 460px;
}
.get .price { font-weight: 700; }
.btn {
  /* A block, not flex: text-box trimming only works on block containers. Capitals-only text
     with equal padding sits optically centred in a 36px button. */
  display: inline-block; vertical-align: middle; text-align: center; justify-self: start;
  padding: calc((36px - 1cap - 2px) / 2) 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  font: 700 14px var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { opacity: 0.88; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.note { font-size: 14px; color: var(--dim); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn:disabled { opacity: 0.6; cursor: default; }
.form-error { font-size: 14px; color: var(--bad); }
.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--dim); }
.renew summary { cursor: pointer; font-size: 14px; color: var(--dim); }
.renew summary:hover { color: var(--text); }
.renew-form { display: grid; gap: 8px; margin-top: 10px; }

/* ── order page ── */
.order { max-width: 560px; padding-block: 40px 64px; display: grid; gap: 16px; }
.order-title { font-size: 28px; }
#view { display: grid; gap: 14px; justify-items: start; }
.keybox {
  width: 100%; display: flex; gap: 10px; align-items: center; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.key { flex: 1; min-width: 0; overflow-wrap: anywhere; font: inherit; font-size: 13px; user-select: all; }
@media (max-width: 480px) { .keybox { flex-direction: column; align-items: stretch; } }

/* ── what the network sees ── */
.sees { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.sees > div { display: grid; gap: 4px; align-content: start; }
@media (max-width: 560px) { .sees { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* ── details list ── */
.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; }
.details dt { color: var(--dim); }
@media (max-width: 480px) { .details { grid-template-columns: minmax(0, 1fr); gap: 2px; } .details dd { margin-bottom: 8px; } }

/* ── questions ── */
.qa { display: grid; gap: 18px; }
.qa > div { display: grid; gap: 4px; }
.qa p { color: var(--dim); }

/* ── changelog ── */
.log { display: grid; gap: 16px; list-style: none; padding: 0; }
.log li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; }
.log time { color: var(--dim); }
.log ul { padding-left: 1.1em; display: grid; gap: 4px; }
@media (max-width: 480px) { .log li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
:root[data-changelog="off"] #changelog, :root[data-changelog="off"] .nav-changelog { display: none; }

.bottom { padding-block: 24px 40px; font-size: 13px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 18px; }
:root[data-rules="on"] .bottom { border-top: 1px solid var(--border); }
.bottom a { color: var(--dim); }

/* ── legal pages: one readable column ── */
.doc { max-width: 680px; padding-block: 40px 64px; display: grid; gap: 14px; }
.doc h1 { font-size: 30px; }
.doc h2 { margin-top: 18px; }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.doc .facts { display: grid; gap: 10px; margin: 0; }
.doc .facts dt { font-weight: var(--hw); }
.doc .facts dd { margin: 0 0 4px; color: var(--dim); }
/* Placeholders the owner must fill in before launch: deliberately loud. */
mark.todo { background: #ffd54a; color: #1c1c1a; padding: 0 3px; border-radius: 3px; }
