/*
 * tadviewer.com: the home page and the release notes. The colours are the
 * app's own (packages/tadviewer/src/components/ui/ui.css), light and dark.
 */

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

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f7f6f4;
  --surface: #ffffff;
  --text: #1c2127;
  --text-2: #44403c;
  --muted: #6b6560;
  --border: #e2e0dd;
  --border-strong: #cfccc8;
  --accent: #2965cc;
  --accent-strong: #1f56b0;
  --on-accent: #ffffff;
  --accent-soft: #eef3fb;
  --code-bg: #f2f1ef;
  --titlebar: #f2f1ef;
  --glow: rgba(41, 101, 204, 0.11);
  --shadow: 0 24px 60px -20px rgba(28, 25, 23, 0.28), 0 2px 8px rgba(28, 25, 23, 0.06);
  --card-shadow: 0 1px 2px rgba(28, 25, 23, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a18;
    --bg-soft: #22201e;
    --surface: #282624;
    --text: #f3eee9;
    --text-2: #d6cfc8;
    --muted: #a8a29e;
    --border: #3a3633;
    --border-strong: #5a5550;
    --accent: #6cb4ff;
    --accent-strong: #9ccbff;
    --on-accent: #0f2236;
    --accent-soft: #233246;
    --code-bg: #2d2b28;
    --titlebar: #2d2b28;
    --glow: rgba(108, 180, 255, 0.1);
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
    --card-shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
a[href^="mailto:"] { white-space: nowrap; } /* an address doesn't break at its hyphen */
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 1px 5px;
}
strong { font-weight: 650; }
h1, h2, h3 { color: var(--text); line-height: 1.2; }
h2 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 6px; }
p { margin: 0 0 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 780px; margin-bottom: 40px; }
.section-head p { color: var(--text-2); font-size: 18px; text-wrap: pretty; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* --- Header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; }
.nav nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav nav a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.nav nav a:hover { color: var(--text); background: var(--code-bg); }
.nav nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav nav a.gh { display: inline-flex; padding: 6px 8px; }
.nav nav a.gh svg { width: 20px; height: 20px; fill: currentColor; }
.nav nav a.btn { color: var(--on-accent); margin-left: 6px; }
.nav nav a.btn:hover { background: var(--accent-strong); color: var(--on-accent); }

/* --- Buttons --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 9px;
  font: inherit; font-size: 15.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { color: var(--text); border-color: var(--muted); }
.btn-small { min-height: 34px; padding: 0 14px; font-size: 14.5px; border-radius: 8px; }

/* --- Hero --- */

.hero {
  padding: 72px 0 64px;
  text-align: center;
  background: radial-gradient(1100px 480px at 50% -80px, var(--glow), transparent 72%);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; margin-bottom: 22px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill b { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-weight: 650; font-size: 13px; }
.hero h1 {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0 auto 20px;
  max-width: 16ch;
}
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 640px; margin: 0 auto 30px; line-height: 1.55; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.cta-note a { color: var(--muted); }
.cta-note a:hover { color: var(--text); }
.cta-note a, .cta-note code, .platform .pm code { white-space: nowrap; }
.facts {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px;
  font-size: 14px; color: var(--muted);
}
.facts li { display: inline-flex; align-items: center; gap: 7px; }
.facts svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.showcase { margin: 56px auto 0; max-width: 1180px; padding: 0 24px; }
.app-window {
  position: relative;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--titlebar);
  box-shadow: var(--shadow);
}
.titlebar { display: flex; align-items: center; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--border); position: relative; }
.titlebar .dots { display: flex; gap: 7px; }
.titlebar .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); display: block; }
.titlebar .title { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); font-weight: 500; pointer-events: none; }
.app-window video, .app-window > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.playpause {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 6px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.playpause:hover { color: var(--text); background: var(--border); }
.playpause svg { width: 12px; height: 12px; fill: currentColor; }
.playpause .play { display: none; }
.playpause.paused .play { display: block; }
.playpause.paused .pause { display: none; }
.caption { margin: 16px auto 0; max-width: 720px; font-size: 14px; color: var(--muted); text-align: center; }

/* --- Features --- */

.hero + .section { padding-top: 64px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.feature .icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.feature .icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature p { color: var(--text-2); margin: 0; }
.feature code { white-space: nowrap; }

/* --- What's new --- */

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--card-shadow); display: flex; flex-direction: column; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 1040 / 600; object-fit: cover; object-position: left top; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px 22px 22px; }
.card-body p { color: var(--text-2); margin: 0; }
.also { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; padding: 0; list-style: none; }
.also li { padding-left: 26px; position: relative; color: var(--text-2); }
.also li::before {
  content: ""; position: absolute; left: 2px; top: 0.55em; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg) translateY(-3px);
}
.more { margin-top: 28px; font-weight: 600; }

/* --- Privacy --- */

.privacy { display: flex; gap: 22px; align-items: flex-start; max-width: 860px; }
.privacy .icon { flex: none; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.privacy .icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy p { color: var(--text-2); font-size: 17px; }

/* --- Download --- */

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.platform { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--card-shadow); }
.platform h3 { margin-bottom: 4px; }
.platform .btn { width: 100%; justify-content: space-between; }
.platform .btn small { font-weight: 500; opacity: 0.8; font-size: 13px; }
.platform .pm { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.platform .pm code { font-size: 12.5px; }
.after { margin-top: 28px; color: var(--text-2); }
.after + .after { margin-top: 8px; }

/* --- Mailing list, feedback --- */

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.two p { color: var(--text-2); }
.fine { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

/* EmailOctopus's signup form, drawn by its script into .subscribe-slot. Its own styles are
   scoped to [data-form="…"]; these rules, more specific, make it an email box and a button
   on one row, as the rest of the site's controls look. */
.subscribe-slot { margin-top: 18px; min-height: 75px; }
#contact [data-form].inline-container { max-width: 520px !important; }
#contact [data-form] .form-container { margin: 0; max-width: none; }
#contact [data-form] .emailoctopus-form-wrapper { margin-top: 0; }
#contact [data-form] .main-form { justify-content: flex-start; align-items: stretch; gap: 10px; }
#contact [data-form] [eo-form-fields-container] { flex: 1 1 220px; }
#contact [data-form] .main-form .emailoctopus-form-row { flex: 1 1 auto; min-width: 0; margin: 0 !important; }
#contact [data-form] .form-control {
  width: 100%; height: auto; min-height: 44px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; box-shadow: none;
}
#contact [data-form] .form-control::placeholder { color: var(--muted); }
#contact [data-form] .form-control:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; box-shadow: none; }
#contact [data-form] .main-form .btn {
  flex: 0 0 auto; width: auto !important; margin: 0 !important;
  min-height: 44px; padding: 0 20px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 15.5px; font-weight: 600; line-height: 1;
}
#contact [data-form] .btn-primary { background: var(--accent); color: var(--on-accent); }
#contact [data-form] .btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
#contact [data-form] .emailoctopus-success-message,
#contact [data-form] .emailoctopus-error-message { text-align: left; color: var(--text-2) !important; }
#contact [data-form] .emailoctopus-error-message:not(:empty) { margin-bottom: 10px; }
#contact [data-form] .text-center { text-align: left; }
#contact [data-form] .mastfoot { margin-top: 8px !important; }
#contact [data-form] .mastfoot p {
  width: auto !important; height: auto !important; padding: 0; overflow: visible;
  background: none !important; text-indent: 0 !important;
  font: inherit; font-size: 12.5px; line-height: 20px; color: var(--muted);
}
#contact [data-form] .mastfoot a { position: static; text-indent: 0 !important; color: var(--muted); font-size: inherit; font-weight: 500; text-decoration: underline; }

/* --- Footer --- */

.site-footer { border-top: 1px solid var(--border); padding: 36px 0 48px; font-size: 14.5px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer p a { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.site-footer p a:hover { text-decoration-color: currentColor; }

/* --- Release notes page --- */

.notes h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.03em; margin: 56px 0 8px; }
.notes .lede { margin: 0 0 24px; text-align: left; }
.notes .toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 40px; padding: 0; list-style: none; }
.notes .toc a { display: inline-block; font-size: 14px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text-2); }
.notes .toc a:hover { border-color: var(--border-strong); color: var(--text); }
.release { padding: 36px 0 20px; border-top: 1px solid var(--border); scroll-margin-top: 72px; }
.release h2 { font-size: 26px; margin-bottom: 2px; }
.release .date { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.release h3 { margin-top: 24px; font-size: 17px; }
.release ul { padding-left: 22px; }
.release li { margin: 6px 0; color: var(--text-2); }
.release li::marker { color: var(--muted); }
.release pre { background: var(--code-bg); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13.5px; }
.release pre code { background: none; padding: 0; }

/* --- Narrow screens --- */

@media (max-width: 900px) {
  .grid3, .cards, .platforms, .two { grid-template-columns: 1fr; }
  .grid3 { gap: 32px; }
  .two { gap: 32px; }
  .also { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}
@media (max-width: 640px) {
  .wrap, .showcase { padding: 0 16px; }
  .hide-sm { display: none; }
  .nav { gap: 8px; }
  .nav nav a { padding: 6px 7px; }
  .hero { padding: 48px 0 40px; }
  .hero + .section { padding-top: 48px; }
  .cta .btn { width: 100%; }
  .showcase { margin-top: 40px; }
  .titlebar { height: 26px; }
  .titlebar .dots i { width: 8px; height: 8px; }
  .titlebar .title { font-size: 11.5px; }
  .playpause { width: 22px; height: 22px; right: 4px; }
  .playpause svg { width: 10px; height: 10px; }
  .privacy { flex-direction: column; gap: 14px; }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
}
