/* The TreeMendous product pages (TREE-1441, TREE-1442): the app's own look,
   its dark palette (pkg/ui/theme) and Go Sans Mono, which the app draws its
   text with. The navigation is a function-key bar, as in the app. */

@font-face { font-family: "Go Sans Mono"; src: url("fonts/GoSansMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Go Sans Mono"; src: url("fonts/GoSansMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0e1116;          /* the terminal's background */
  --bg-raised: #161920;   /* BgDark */
  --bg-card: #1e232e;     /* BgCard */
  --bg-key: #252d3d;      /* BgBadge */
  --border: #30363d;      /* BorderColor */
  --text: #f0f6fc;        /* TextPrimary */
  --text-2: #c9d1d9;      /* TextSecondary */
  --muted: #8b949e;       /* TextMuted */
  --accent: #58a6ff;      /* AccentBlue */
  --accent-strong: #2b5cbb; /* BgSelected */
  --on-accent: #ffffff;
  --green: #3fb950;
  --yellow: #d29922;
  --orange: #db6d28;
  --purple: #bc8cff;
  --cyan: #39c5cf;
  --focus: #ffdd00;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff; --bg-raised: #f6f8fa; --bg-card: #ffffff; --bg-key: #eaeef2;
    --border: #d0d7de; --text: #1f2328; --text-2: #3b434b; --muted: #59636e;
    --accent: #0969da; --accent-strong: #0969da; --on-accent: #ffffff;
    --green: #1a7f37; --yellow: #9a6700; --orange: #bc4c00; --purple: #8250df; --cyan: #1b7c83;
    --shadow: 0 20px 50px rgba(31, 35, 40, .18);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 "Go Sans Mono", ui-monospace, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code, kbd, pre { font-family: "Go Sans Mono", ui-monospace, Menlo, Consolas, monospace; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--focus); color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
@media (min-width: 700px) { .wrap { padding-inline: 32px; } }

/* The top bar: the name, then the function keys. */
.topbar {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.brand span { color: var(--muted); font-weight: 400; }
/* a long product name goes onto a second line on a narrow screen, rather
   than widening the page (TREE-1521) */
@media (max-width: 559px) { .brand { white-space: normal; flex-wrap: wrap; row-gap: 0; min-width: 0; } .brand span { white-space: nowrap; } }
.topbar nav { min-width: 0; max-width: 100%; margin-left: auto; }
.fkeys { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.fkeys::-webkit-scrollbar { display: none; }
.fkeys a {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 6px;
  color: var(--text-2); text-decoration: none; font-size: 14px; white-space: nowrap; border: 1px solid transparent;
}
.fkeys a b { font: 700 12px "Go Sans Mono", monospace; color: var(--accent); }
.fkeys a:hover { background: var(--bg-key); border-color: var(--border); color: var(--text); }
.fkeys a.buy { background: var(--accent-strong); color: var(--on-accent); }
.fkeys a.buy b { color: var(--on-accent); opacity: .8; }
@media (max-width: 699px) { .topbar nav { width: 100%; margin-left: 0; } }

.phase { font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--border); }
.phase .wrap { padding-block: 8px; }
.tag { display: inline-block; font: 700 11px/1 "Go Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 4px; background: var(--yellow); color: #000; margin-right: 8px; vertical-align: 1px; }

/* The top section. */
.hero { padding: 56px 0 32px; text-align: center; }
.hero .eyebrow { font: 400 14px "Go Sans Mono", monospace; color: var(--muted); margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.05; letter-spacing: -.02em; margin: 0 auto 18px; max-width: 16ch; text-wrap: balance; }
.hero .lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-2); max-width: 40em; margin: 0 auto 28px; text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 8px; font-weight: 700; font-size: 17px;
  text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--bg-card); cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.1); }
.btn[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.shot { margin: 44px auto 0; max-width: 1060px; }
.shot img, .gallery img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-raised); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.shot figcaption { text-align: center; }

/* Sections. */
section { padding: 64px 0; border-top: 1px solid var(--border); }
.kicker { font: 700 13px "Go Sans Mono", monospace; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
h3 { font-size: 19px; margin: 0 0 6px; }
.intro { color: var(--text-2); max-width: 44em; margin: 0 0 32px; }
p { margin: 0 0 14px; }

.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; } .split--flip > :first-child { order: 2; } }
.split > * { min-width: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 18px 14px; }
.card p { color: var(--text-2); font-size: 15px; margin: 0; }
.card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card h3 small { font: 400 12px "Go Sans Mono", monospace; color: var(--muted); }

/* A protocol's colour dot, as the app colours its sidebar. */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; }

.ticks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: var(--text-2); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.ticks strong { color: var(--text); }

kbd {
  display: inline-block; min-width: 2.2em; text-align: center; padding: 2px 6px; font-size: 13px; line-height: 1.4;
  color: var(--text); background: var(--bg-key); border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 5px;
}
.keys { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin: 0; padding: 0; list-style: none; }
.keys li { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 15px; }

.formats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; list-style: none; }
.formats li { font: 400 13px "Go Sans Mono", monospace; padding: 3px 8px; border-radius: 999px; background: var(--bg-key); color: var(--text-2); border: 1px solid var(--border); }
.formats li.rw { border-color: color-mix(in srgb, var(--orange) 60%, var(--border)); }

.gallery { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .gallery { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .gallery .wide { grid-column: 1 / -1; } }
.gallery figure { margin: 0; min-width: 0; }

/* Buying. */
.buy { display: grid; gap: 24px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
@media (min-width: 800px) { .buy { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); padding: 36px 40px; } }
.price { font-size: 44px; font-weight: 700; line-height: 1; margin: 0 0 6px; }
.price small { font-size: 16px; color: var(--muted); font-weight: 400; }
.price--tba { font-size: 24px; color: var(--text-2); }

/* Downloads. */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; position: relative; } /* holds the hidden labels in its scrolling (TREE-1521) */
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--border); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--bg-raised); }
tbody th { white-space: nowrap; }
td { color: var(--text-2); }
.dl { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dl .size { color: var(--muted); }

details { border: 1px solid var(--border); border-radius: 10px; padding: 0 18px; margin: 16px 0 0; background: var(--bg-raised); }
details summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--accent); }
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 14px; margin: 0 0 14px; }
.code .nw { white-space: nowrap; }
.distros { list-style: none; padding: 0; margin: 0 0 6px; }
.distro { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.distro__icon { width: 28px; height: 28px; margin-top: 2px; }
.distro h3 { font-size: 16px; }
.distro h3 span { font-weight: 400; color: var(--muted); }
.note { border-left: 4px solid var(--yellow); padding: 4px 0 4px 14px; color: var(--text-2); margin: 16px 0 0; }

footer { border-top: 1px solid var(--border); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; gap: 20px; }
@media (min-width: 800px) { footer .wrap { grid-template-columns: 2fr 1fr; } }
footer a { color: var(--text-2); }
footer .disclaimer { font-size: 13px; }
.sibling { display: flex; gap: 14px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.sibling img { width: 40px; height: 40px; }
.sibling span { display: block; color: var(--muted); font-size: 14px; }
.sibling:hover { border-color: var(--accent); }
.siblings { display: grid; gap: 10px; align-content: start; }

/* A long text page, such as TinyVi's commands (TREE-1537). */
.prose { max-width: 960px; }
.prose h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; margin: 0 0 18px; }
.prose h2 { margin-top: 48px; scroll-margin-top: 80px; }
.prose p, .prose li { color: var(--text-2); max-width: 72ch; }
.prose .table-wrap { margin: 16px 0 24px; }
.prose table { font-size: 14px; }
.prose td code, .prose th code { white-space: nowrap; }
.prose code { color: var(--text); }
.prose pre { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }

/* Cards in two columns, for cards with a picture. */
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }

/* Phone screenshots side by side, and drawings made for a page (TREE-1614). */
.phones { display: grid; gap: clamp(10px, 2.4vw, 24px); grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 860px; margin: 44px auto 0; }
.phones figure { margin: 0; min-width: 0; }
.phones img { display: block; width: 100%; border-radius: clamp(12px, 3vw, 26px); border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-raised); }
.phones figcaption { text-align: center; }
.phone { max-width: 300px; margin: 0 auto; }
.phone img { display: block; width: 100%; border-radius: 26px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-raised); }
.drawn { margin: 0 0 16px; }
.drawn svg { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.drawn figcaption { margin-top: 6px; }
.state { font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.state b { color: var(--text-2); }

/* The screenshot carousel (TREE-2122): the pictures in a ring after the top
   section, the front one large, the rest turned to the sides and darker. The
   script (carousel.js) adds .is-live; without it the pictures stand one
   under another. */
.carousel { padding: 0 0 56px; }
.carousel-track { display: grid; gap: 28px; max-width: 1000px; margin: 0 auto; padding-inline: 20px; }
.carousel-slide { margin: 0; }
.carousel-slide img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-raised); user-select: none; -webkit-user-drag: none; }
.carousel-slide figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.carousel.is-live .carousel-stage { position: relative; height: clamp(280px, 56vw, 600px); overflow: hidden; touch-action: pan-y; }
.carousel.is-live .carousel-track { position: absolute; inset: 0; display: block; max-width: none; padding: 0; perspective: 1600px; perspective-origin: 50% 40%; }
.carousel.is-live .carousel-slide { position: absolute; left: 50%; top: 50%; width: var(--slide-w, 760px); will-change: transform, opacity; backface-visibility: hidden; cursor: pointer; }
.carousel.is-live .carousel-slide.is-front { cursor: default; }
.carousel.is-live .carousel-slide figcaption { display: none; }
.carousel.is-live .carousel-slide::after { content: ""; position: absolute; inset: 0; border-radius: 10px; background: var(--bg); opacity: var(--dim, 0); pointer-events: none; }
.carousel-glow { display: none; }
.carousel.is-live .carousel-glow {
  display: block; position: absolute; left: 50%; top: 48%; width: min(900px, 90%); height: 60%;
  transform: translate(-50%, -50%); pointer-events: none; filter: blur(56px); opacity: .55;
  background: radial-gradient(closest-side at 35% 50%, var(--accent), transparent 70%), radial-gradient(closest-side at 68% 55%, var(--purple), transparent 70%);
}
.carousel-caption { text-align: center; color: var(--text-2); font-size: 15px; min-height: 1.6em; margin: 14px auto 10px; padding-inline: 20px; max-width: 46em; }
.carousel-controls { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding-inline: 20px; }
.carousel-controls[hidden] { display: none; }
.carousel-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; padding: 0; }
.carousel-btn:hover { border-color: var(--accent); }
.carousel-btn svg { width: 16px; height: 16px; fill: currentColor; }
.carousel-dots { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.carousel-dot { width: 28px; height: 28px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.carousel-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-key); border: 1px solid var(--border); }
.carousel-dot[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); }
.carousel-btn:focus-visible, .carousel-dot:focus-visible, .carousel-slide:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
