/* The frame every link.us page shares, the homepage too: the font, the
   design values, the header and its menu (markup from nav.py, behaviour
   in nav.js), the footer and the dialogs. Text pages add site.css; the
   homepage adds its own sections. The font is served from link.us
   itself: no third-party requests. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter.woff2) format("woff2"); }

/* ---------- Design values ---------- */
:root {
  --bg: #050507;
  --surface: #0D0E13;
  --surface-2: #14151C;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #F3F4F8;
  --soft: #D6D8E3;
  --muted: #A3A7BA;
  --faint: #6E7286;
  --accent: #6C7BFF;
  --accent-hi: #9AA5FF;
  --accent-soft: rgba(108, 123, 255, 0.16);
  --warm: #FF8A4C;
  --warm-deep: #E86F30;
  --warm-soft: rgba(255, 138, 76, 0.16);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --display: Inter, system-ui, sans-serif;
}

/* ---------- Page ---------- */
* { box-sizing: border-box; }
/* Nothing may widen the page sideways (decorative glows reach past the
   edges): clip on html too, since iOS Safari ignores body's overflow. clip,
   unlike hidden, keeps the sticky header working. */
html { color-scheme: dark; overflow-x: hidden; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; line-height: 1.6; overflow-x: hidden; overflow-x: clip; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
body.drawer-lock, body.dialog-lock { overflow: hidden; }
@keyframes nodePulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Header ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(5, 5, 7, 0.8);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); transition: transform 0.3s ease; }
.nav.away { transform: translateY(-100%); }
.nav a, .drawer a, .footer a { text-decoration: none; overflow-wrap: normal; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 68px; }
.wordmark { display: flex; align-items: baseline; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.wordmark:hover { color: var(--text); }
.wordmark-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-hi); margin: 0 3px; box-shadow: 0 0 10px rgba(154, 165, 255, 0.8); animation: nodePulse 3s ease-in-out infinite; }
.nav-links { display: flex; gap: 32px; font-size: 16px; font-weight: 500; }
.nav-links a { min-height: 44px; display: flex; align-items: center; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: #FFFFFF; }
.nav-actions { display: flex; gap: 12px; align-items: center; }
/* Rectangular buttons share one size and text style (40px high,
   semibold): the header's, the contact form's, the side column's, the
   pricing page's and the shop's. */
.nav-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border-radius: 10px; font-weight: 600; color: var(--text); border: 1px solid var(--line-strong); transition: border-color 0.2s, background 0.2s; }
.nav-btn:hover { border-color: var(--accent-hi); }
.nav-btn.primary { color: #050507; background: #FFFFFF; border-color: #FFFFFF; }
.nav-btn.primary:hover { color: #050507; background: var(--accent-hi); border-color: var(--accent-hi); }
@media (max-width: 520px) { .nav-btn.ghost { display: none; } }
/* A plain link beside the buttons: the account dashboard (not needed to use Link Node). */
.nav-text { min-height: 40px; display: inline-flex; align-items: center; padding: 0 18px; font-size: 16px; color: var(--text); font-weight: 500; border: 1px solid var(--line-strong); border-radius: 10px; transition: color 0.2s, border-color 0.2s; }
.nav-text:hover { color: #FFFFFF; border-color: var(--accent-hi); }
/* Small screens keep only the wordmark and a menu button, which slides in
   a panel with the links. */
.nav-toggle { display: none; width: 44px; height: 44px; margin-right: -10px; align-items: center; justify-content: center; background: none; border: 0; border-radius: 10px; color: var(--text); cursor: pointer; }
.nav-toggle:hover { background: rgba(255, 255, 255, 0.06); }
@media (max-width: 960px) { .nav-links, .nav-actions { display: none; } .nav-toggle { display: inline-flex; } }
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(320px, 86vw); display: flex; flex-direction: column; padding: 12px 16px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%); visibility: hidden; transition: transform 0.32s var(--ease), visibility 0s linear 0.32s; }
.drawer.open { transform: none; visibility: visible; transition: transform 0.32s var(--ease); }
.drawer.open + .drawer-scrim { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.drawer:focus { outline: none; }
.drawer .nav-toggle { display: inline-flex; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin-bottom: 8px; }
.drawer-head span { font-size: 16px; font-weight: 600; color: var(--muted); }
.drawer a { min-height: 48px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; font-size: 17px; font-weight: 500; color: var(--text); }
.drawer a:hover, .drawer a:focus-visible, .drawer a[aria-current] { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; width: auto; }
.drawer .drawer-sub { font-size: 16px; color: var(--muted); min-height: 44px; }
@media (min-width: 961px) { .drawer, .drawer-scrim { display: none; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 72px 0 44px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 48px; margin-bottom: 64px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-brand .wordmark { margin-bottom: 16px; }
.footer-brand .wordmark-dot { animation: none; box-shadow: none; }
.footer-brand p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 300px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.footer-col h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--accent-hi); }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: #FFFFFF; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 16px; color: var(--faint); }

/* ---------- Dialogs ---------- */
.rdialog { width: min(32rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.rdialog::backdrop { background: rgba(5, 5, 7, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rdialog[open] { animation: rise 0.35s var(--ease) both; }
.rdialog-body { position: relative; padding: 32px 32px 26px; display: flex; flex-direction: column; gap: 14px; }
.rdialog h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; padding-right: 40px; }
.rdialog p { margin: 0; color: var(--muted); font-size: 16px; }
.rdialog .close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.rdialog .close:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); }

/* The download dialog (nav.py DOWNLOAD_DIALOG, nav.js), on every page. */
.ddialog { width: min(46rem, calc(100vw - 32px)); }
.ddialog a { text-decoration: none; overflow-wrap: normal; }
.dl-version { font-size: 16px; color: var(--muted); margin-top: -6px; }
.dl-version a { color: var(--accent-hi); }
.dl-primary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: 16px; background: #FFFFFF; color: #050507; transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease); }
/* Hidden on phones and unknown systems: [hidden] must beat display: flex. */
.dl-primary[hidden] { display: none; }
.dl-primary:hover { color: #050507; transform: translateY(-2px); box-shadow: 0 10px 40px rgba(108, 123, 255, 0.45); }
.dl-primary strong { display: block; font-family: var(--display); font-size: 19px; color: #050507; }
.dl-primary strong + span { font-size: 16px; color: #4A4D60; }
.dl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.dl-list li { margin: 0; }
.dl-list li + li { border-top: 1px solid var(--line); }
.dl-item { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 13px 18px; color: var(--text); transition: background 0.2s; }
.dl-item:hover { background: rgba(255, 255, 255, 0.04); color: #FFFFFF; }
.dl-item b { font-weight: 600; font-size: 16px; }
.dl-item small { display: block; font-size: 16px; color: var(--muted); }
.dl-item code { flex: none; font-size: 16px; color: var(--muted); background: none; padding: 0; }
@media (max-width: 520px) { .dl-item { flex-wrap: wrap; } .dl-item code { flex-basis: 100%; } }
.dl-note { list-style: none; margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.dl-note li { margin: 0; color: var(--muted); }
.dl-note a { color: var(--accent-hi); }
.dl-note b { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .nav, .drawer, .drawer-scrim, .wordmark-dot, .rdialog[open] { transition: none; animation: none; } }
