/* Ubliquity landing — tokens and base.
   The wordmark is the system: chamfered 45° corners, squares and right-pointing
   triangles as the only ornaments, wordmark blue and orange. Light is the
   reference; dark is redefined for OS dark (unless the visitor chose light) and
   for an explicit choice. */

@font-face { font-family: 'Chakra Petch'; font-weight: 500; font-display: swap; src: url('../assets/fonts/chakra-petch-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; font-display: swap; src: url('../assets/fonts/chakra-petch-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url('../assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url('../assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('../assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }

:root {
  --ground: #f5f6fa;
  --surface: #ffffff;
  --ink: #141824;
  --muted: #4a4f63;
  --line: #d7dae5;
  --blue: #3b5bad;
  --blue-strong: #2e4a94;
  --orange: #d6893a;
  --orange-text: #9c5a14;
  --on-orange: #141824;
  --xml: #c3c8d8;
  --xml-tag: #a3add0;
  --plate: rgba(245, 246, 250, 0.94);
  --plate-ink: #141824;
  --shadow: 0 2px 4px rgba(20, 24, 36, 0.06), 0 24px 48px rgba(59, 91, 173, 0.14);

  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --cut: 16px;
  --cut-lg: 48px;
  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1240px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #141824;
    --surface: #1c2131;
    --ink: #f5f6fa;
    --muted: #a9afc6;
    --line: #2a3044;
    --blue: #7b98e6;
    --blue-strong: #9ab0ee;
    --orange: #e39a4c;
    --orange-text: #f0b072;
    --on-orange: #141824;
    --xml: #2b3249;
    --xml-tag: #3e4a74;
    --plate: rgba(20, 24, 36, 0.94);
    --plate-ink: #232a40;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --ground: #141824;
  --surface: #1c2131;
  --ink: #f5f6fa;
  --muted: #a9afc6;
  --line: #2a3044;
  --blue: #7b98e6;
  --blue-strong: #9ab0ee;
  --orange: #e39a4c;
  --orange-text: #f0b072;
  --on-orange: #141824;
  --xml: #2b3249;
  --xml-tag: #3e4a74;
  --plate: rgba(20, 24, 36, 0.94);
  --plate-ink: #232a40;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
section[id] { scroll-margin-top: 120px; }
a { color: var(--blue-strong); text-underline-offset: 0.2em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
::selection { background: var(--orange); color: var(--on-orange); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Theme switch — hidden until the head script has stamped data-theme, so a
   visitor without JavaScript follows the OS and never sees a dead control. */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
:root:not([data-theme]) .theme-toggle { display: none; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-dark { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-light { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-dark { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Shared pieces ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
p { margin: 0; }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--muted); max-width: 60ch; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 20;
  background: var(--orange); color: var(--on-orange); padding: 10px 16px; font-weight: 700;
}
.skip:focus { top: 12px; }

.cta {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--orange); color: var(--on-orange);
  font: 700 1.125rem/1 var(--font-display); text-decoration: none;
  padding: 18px 28px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.cta:hover { background: color-mix(in srgb, var(--orange) 86%, var(--ink)); }
.cta:active { transform: translateY(1px); }
.cta-lg { font-size: 1.25rem; padding: 20px 30px; }
.cta-sm { font-size: 0.95rem; padding: 11px 16px; --cut: 10px; }
.tri { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { width: min(100% - 2 * var(--gutter), 1360px); margin-inline: auto; height: 72px; display: flex; align-items: center; gap: 20px; }
.brand img { height: 30px; width: auto; }
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; }
.topnav a:hover { color: var(--blue-strong); text-decoration: underline; }

.lang { position: relative; }
.lang > button {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  background: transparent; color: var(--ink); border: 1px solid var(--line); cursor: pointer;
  font: 600 0.9rem var(--font-body);
}
.lang img { width: 20px; height: 14px; }
.lang .caret { width: 9px; height: 6px; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.lang ul button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  background: none; border: 0; color: var(--ink); font: 400 0.95rem var(--font-body); cursor: pointer; text-align: left;
}
.lang ul button:hover, .lang ul button[aria-current='true'] { background: color-mix(in srgb, var(--blue) 12%, transparent); }

/* ---------- Hero: the lens over the XML ---------- */
.hero { position: relative; overflow: hidden; min-height: min(900px, calc(100svh - 72px)); display: flex; align-items: center; }
.lens { justify-self: end; width: 100%; max-width: min(600px, calc((100svh - 190px) * 0.75)); }
.xml-field {
  position: absolute; inset: 0; margin: 0; padding: 28px var(--gutter);
  font: 400 15px/1.7 var(--font-mono); color: var(--xml);
  white-space: pre; overflow: hidden; user-select: none; pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.hero-inner {
  position: relative; width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; padding: 56px 0 72px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center;
}
.hero-plate {
  /* A cleared zone inside the XML, not a card set beside it. */
  background: var(--plate); padding: clamp(28px, 3vw, 44px);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}
.hero h1 { font-size: clamp(2.6rem, 4.6vw, 4rem); letter-spacing: -0.015em; }
.hero h1 em { font-style: normal; color: var(--orange-text); display: block; }
.hero .lead { margin-top: 22px; }
.hero .cta { margin-top: 32px; }
.note { margin-top: 18px; font-size: 0.95rem; color: var(--muted); }

.lens {
  --drift-x: 0px; --drift-y: 0px;
  position: relative; margin: 0;
  transform: translate(var(--drift-x), var(--drift-y));
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lens-glass {
  background: #3b5bad; padding: 10px; box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - var(--cut-lg)) 0, 100% var(--cut-lg), 100% 100%, var(--cut-lg) 100%, 0 calc(100% - var(--cut-lg)));
}
/* A loupe, not a thumbnail: the glass holds the PDF page cut from the capture
   (tool/landing_captures.sh), so the invoice in it can actually be read. */
.lens-window {
  overflow: hidden; background: #fff;
  clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 42px, 100% 100%, 42px 100%, 0 calc(100% - 42px));
}
.lens-window img { width: 100%; height: auto; }
.lens-sq { position: absolute; right: -14px; bottom: 34px; width: 22px; height: 22px; background: var(--orange); }

/* ---------- Privacy band ---------- */
.privacy { background: #3b5bad; color: #fff; padding: clamp(64px, 9vw, 112px) 0; }
.privacy .wrap { position: relative; }
.privacy h2 { max-width: 18ch; }
.privacy .lead { color: #e6ebfa; margin-top: 22px; }
.privacy .aside { margin-top: 28px; font-size: 0.98rem; color: #dbe2f6; padding-left: 22px; position: relative; max-width: 60ch; }
.privacy .aside::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 10px; height: 10px; background: var(--orange); }

/* ---------- Features: a spec sheet, not a card grid ---------- */
.features { padding: clamp(72px, 10vw, 128px) 0; }
.feature-list { list-style: none; margin: 40px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.feature {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.feature h3 { display: flex; align-items: baseline; gap: 14px; font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
.feature h3::before { content: ''; flex: none; width: 0; height: 0; border-left: 11px solid var(--orange); border-top: 7px solid transparent; border-bottom: 7px solid transparent; transform: translateY(-3px); }
.feature p { color: var(--muted); font-size: 1.1rem; }

/* ---------- Gallery ---------- */
.gallery { padding: clamp(40px, 6vw, 80px) 0 clamp(72px, 10vw, 128px); border-top: 1px solid var(--line); }
.gallery-track { width: min(100% - 2 * var(--gutter), 1240px); margin: 48px auto 0; display: grid; gap: clamp(56px, 8vw, 104px); }
.shot { margin: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.shot.reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.shot.reverse .frame { order: 2; }
.shot figcaption h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.shot figcaption p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; max-width: 40ch; }
.frame {
  position: relative; background: var(--surface); border: 1px solid var(--line); min-height: 120px;
  margin-bottom: 64px;
}
.frame > img { clip-path: none; }
/* The world's one device again: a chamfered lens magnifying what the caption names. */
.callout {
  position: absolute; right: -24px; bottom: -64px; width: 56%;
  background: #3b5bad; padding: 7px;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
  filter: drop-shadow(0 18px 28px rgba(20, 24, 36, 0.28));
}
.callout img {
  width: 100%; height: auto; background: #fff;
  clip-path: polygon(0 0, calc(100% - 23px) 0, 100% 23px, 100% 100%, 23px 100%, 0 calc(100% - 23px));
}
.shot.reverse .callout { right: auto; left: -24px; }
.frame-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ground) 70%, var(--surface)); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.frame-bar span { margin-left: 14px; font: 400 12px var(--font-mono); color: var(--muted); }
.frame img { width: 100%; height: auto; }

/* The reveal: a chamfered lens enters from the left and sweeps open across
   each capture, once. Same six vertices in both states, so it interpolates. */
.reveal-ready [data-reveal] .frame > img {
  clip-path: polygon(0 30%, 14% 30%, 20% 38%, 20% 70%, 6% 70%, 0 62%);
  transition: clip-path 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-ready [data-reveal] .callout {
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms ease-out 700ms, transform 600ms cubic-bezier(0.16, 1, 0.3, 1) 700ms;
}
.reveal-ready [data-reveal].is-revealed .frame > img { clip-path: polygon(0 0, 100% 0, 100% 0, 100% 100%, 0 100%, 0 100%); }
.reveal-ready [data-reveal].is-revealed .callout { opacity: 1; transform: none; }

/* ---------- Pricing ---------- */
.pricing { padding: 0 0 clamp(72px, 10vw, 128px); }
.price-plate {
  /* Ink in both themes: the price is orange on dark, never on the light ground. */
  background: var(--plate-ink); color: #f5f6fa; padding: clamp(36px, 5vw, 64px);
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 40px; align-items: end;
  clip-path: polygon(0 0, calc(100% - var(--cut-lg)) 0, 100% var(--cut-lg), 100% 100%, var(--cut-lg) 100%, 0 calc(100% - var(--cut-lg)));
}
.price { font: 700 clamp(3.5rem, 9vw, 7rem)/0.9 var(--font-display); color: #e39a4c; }
.price-plate .lead { color: #dfe3ef; font-size: clamp(1.2rem, 2vw, 1.6rem); }
.price-plate .cta { --orange: #e39a4c; }

/* ---------- What's new ---------- */
.whats-new { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.releases { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 28px; }
.release { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.release-head { display: flex; flex-direction: column; gap: 4px; }
.release-version { font: 700 1.6rem var(--font-display); color: var(--blue-strong); }
.release-date { color: var(--muted); font-size: 0.95rem; }
.release ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.release ul li { position: relative; padding-left: 20px; }
.release ul li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--orange); }

/* ---------- Contact ---------- */
.contact { padding: clamp(56px, 8vw, 96px) 0; background: color-mix(in srgb, var(--blue) 8%, var(--ground)); }
.contact .lead { margin-top: 14px; }
.contact-link { display: inline-block; margin-top: 22px; font: 700 clamp(1.15rem, 2.2vw, 1.6rem) var(--font-display); color: var(--blue-strong); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; position: relative; }
.footer::before { content: ''; position: absolute; top: -6px; left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); width: 11px; height: 11px; background: var(--orange); }
.footer-inner { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; display: grid; grid-template-columns: auto 1fr; gap: 14px 40px; align-items: center; }
.footer-mark { height: 26px; width: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; justify-self: end; }
.footer-links a { color: var(--ink); }
.footer-legal, .footer-pub { grid-column: 1 / -1; color: var(--muted); font-size: 0.92rem; }

/* ---------- Narrow screens ---------- */
@media (max-width: 960px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0 0; row-gap: 4px; }
  .lang { margin-left: auto; }
  .topnav { order: 10; width: 100%; margin: 0; padding: 6px 0 10px; gap: 20px; overflow-x: auto; }
  .topnav a { font-size: 0.95rem; white-space: nowrap; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: clamp(2rem, 8.4vw, 2.6rem); hyphens: manual; }
  .xml-field { font-size: 12px; }
  .feature, .release { grid-template-columns: 1fr; gap: 8px; }
  .price-plate { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cta-sm { display: none; }
  .gallery-track {
    width: auto; grid-auto-flow: column; grid-auto-columns: 86%; gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 12px; scroll-padding: var(--gutter);
  }
  .shot, .shot.reverse { grid-template-columns: 1fr; scroll-snap-align: start; align-items: start; }
  .shot.reverse .frame { order: 0; }
  .callout, .shot.reverse .callout { left: auto; right: 10px; width: 62%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-self: start; }
}

/* ---------- Help, privacy, terms ---------- */
.doc-page { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.doc-wrap { max-width: 720px; }
.doc-page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.doc-page > .wrap > .lead { margin-top: 14px; }
.doc { margin-top: 36px; }
.doc-status { color: var(--muted); }
.doc-error { font-weight: 700; margin-bottom: 16px; }
.doc .cta { margin-bottom: 16px; border: 0; cursor: pointer; }
.help-category { margin-top: 40px; }
.help-category h2 { font-size: 1.6rem; }
.help-description { color: var(--muted); margin-top: 6px; }
.help-category details { border-bottom: 1px solid var(--line); }
.help-category details:first-of-type { margin-top: 16px; border-top: 2px solid var(--ink); }
.help-category summary {
  cursor: pointer; list-style: none; padding: 18px 0; display: flex; gap: 14px; align-items: baseline;
  font: 700 1.2rem/1.3 var(--font-display);
}
.help-category summary::-webkit-details-marker { display: none; }
.help-category summary::before {
  content: ''; flex: none; width: 0; height: 0; transform: translateY(-2px);
  border-left: 10px solid var(--orange); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  transition: transform 160ms ease-out;
}
.help-category details[open] summary::before { transform: translateY(-2px) rotate(90deg); }
.help-category details:target summary, .help-category summary:hover { color: var(--blue-strong); }
.doc-body { padding: 0 0 24px 24px; }
.doc :is(h2, h3) { font-size: 1.3rem; margin: 28px 0 10px; }
.doc p, .doc li { line-height: 1.65; max-width: 33em; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc code { font: 0.9em var(--font-mono); background: color-mix(in srgb, var(--blue) 10%, transparent); padding: 1px 5px; }
.doc blockquote { position: relative; margin: 18px 0; padding: 14px 18px 14px 40px; background: color-mix(in srgb, var(--orange) 9%, transparent); }
.doc blockquote::before { content: ''; position: absolute; left: 16px; top: 22px; width: 10px; height: 10px; background: var(--orange); }
.table-scroll { overflow-x: auto; margin: 18px 0; }
.doc table { border-collapse: collapse; min-width: 100%; font-size: 0.95rem; }
.doc th, .doc td { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc th { border-bottom: 2px solid var(--blue); }
.doc-back { margin-top: 48px; }
.notfound { padding: 96px var(--gutter); text-align: center; }
.footer-pub a { color: var(--ink); }
