/* What the home and download pages share: colors, nav, footer, buttons and the download menu, the demo window. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* The serif of every headline: one place to change it. */
  --serif: "PT Serif", Georgia, serif;
  color-scheme: light;
  --bg: #f3f0e8;
  --paper: #fbfaf6;
  --fg: #1b1a17;
  --muted: #6f6b62;
  --line: #d9d3c5;
  --teal: #0f706a;
  --btn-bg: transparent;
  --btn-bg-hover: rgba(0, 0, 0, 0.04);
  --btn-border: rgba(27, 26, 23, 0.18);
  --btn-fg: var(--fg);
  --primary-bg: #1b1a17;
  --primary-bg-hover: #000;
  --primary-fg: #fbfaf6;
  --split: rgba(255, 255, 255, 0.18);
  --menu-bg: #fbfaf6;
  --menu-border: var(--line);
  --menu-hover: rgba(0, 0, 0, 0.05);
  --window-border: rgba(0, 0, 0, 0.12);
  --footer-bg: #ebe6da;
  --window-shadow: 0 50px 100px -30px rgba(40, 30, 10, 0.35), 0 20px 40px -20px rgba(40, 30, 10, 0.25);
  /* Surfaces over the paper (cards, menus) and under it (a sidebar, a lane), hovers and hairlines inside a window. */
  --raised: #fff;
  --well: #f1ede3;
  --wash: rgba(0, 0, 0, 0.05);
  --edge: rgba(0, 0, 0, 0.06);
  --rule: #ece7db;
  --line-strong: #bfb7a5;
  --faint: #a59f92;
  --bullet: #8a8478;
  --bar: #e9e4d7;
  --scroll: #cfc8b8;
  --teal-wash: #e3efe9;
  --teal-edge: #b9d8cf;
  --orange: #b5622a;
  --orange-wash: #f8e4d8;
  --violet: #6a52b5;
  --shade: 40, 30, 10;
}
/* Dark: the same warm paper, at night (the system's look, or the one picked: home/theme.js). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151411;
  --paper: #1d1c18;
  --fg: #ebe7dc;
  --muted: #a29c90;
  --line: #34312a;
  --teal: #46b3a6;
  --btn-bg-hover: rgba(255, 255, 255, 0.06);
  --btn-border: rgba(235, 231, 220, 0.2);
  --primary-bg: #ebe7dc;
  --primary-bg-hover: #fff;
  --primary-fg: #151411;
  --split: rgba(0, 0, 0, 0.18);
  --menu-bg: #24231e;
  --menu-hover: rgba(255, 255, 255, 0.06);
  --window-border: rgba(255, 255, 255, 0.1);
  --footer-bg: #1a1915;
  --window-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.7), 0 20px 40px -20px rgba(0, 0, 0, 0.5);
  --raised: #26241f;
  --well: #191814;
  --wash: rgba(255, 255, 255, 0.06);
  --edge: rgba(255, 255, 255, 0.07);
  --rule: #2b2924;
  --line-strong: #4d493f;
  --faint: #757064;
  --bullet: #7f796d;
  --bar: #23211d;
  --scroll: #3b382f;
  --teal-wash: rgba(70, 179, 166, 0.15);
  --teal-edge: rgba(70, 179, 166, 0.45);
  --orange: #e3925c;
  --orange-wash: rgba(227, 146, 92, 0.15);
  --violet: #a993f0;
  --shade: 0, 0, 0;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  /* A column the height of the window at least, so the footer sits at its bottom on a short page. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Thin scrollbars in the page's colours (the plugins' files, the setup command). */
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--line-strong); }
.serif { font-family: var(--serif); font-weight: 400; }

nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.9rem;
}
nav .brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--serif); font-size: 1.55rem; margin-right: auto; }
nav .brand img { width: 26px; }
nav a.link { color: var(--muted); }
nav a.link:hover { color: var(--fg); }
/* GitHub at the nav's end, as an icon (assets/social.svg; Discord and X are in the footer); it stays beside the phone
   menu's button. */
nav .social { display: flex; gap: 2px; margin: -6px -8px -6px -0.6rem; }
nav .social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); transition: color 0.15s, background 0.15s; }
nav .social a:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 7%, transparent); }
nav .social a:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
nav .social svg { width: 17px; height: 17px; }
/* The view controls, with AI or without and light or dark, boxed apart from the links: they change the page, not where
   you go. Each shows the icon of the look it switches to. */
nav .view { display: flex; align-items: center; gap: 2px; padding: 2px; margin: -6px 0 -6px 0.35rem; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--line); }
nav .view button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; transition: color 0.15s, background 0.15s; }
nav .view button:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 7%, transparent); }
nav .view button:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
nav .view svg { width: 16px; height: 16px; }
/* With AI or without (home/ai.js), on every page: what only one of them shows (no answer yet is without), and the
   nav's switch, the app's provenance mark for which it is (a robot, AI; a person, Human). */
:root:not([data-ai="on"]) .ai-on, :root[data-ai="on"] .ai-off { display: none !important; }
:root:not([data-ai="on"]) .ai-mode .bot, :root[data-ai="on"] .ai-mode .human { display: none; }
:root[data-theme="dark"] .theme .moon, :root:not([data-theme="dark"]) .theme .sun { display: none; }

/* The footer: a panel the window's width (its content the page's), the name and a way in (download, the demo), then
   every page in columns, the logo's crystal cut off in its corner. The same on every page. */
footer {
  position: relative;
  overflow: hidden;
  margin-top: 140px;
  padding: 88px max(24px, calc((100% - 1180px) / 2 + 24px)) 44px;
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  /* The pitch on the left, the links on the right, the credit under both. */
  display: grid;
  grid-template-columns: minmax(0, 30rem) auto;
  justify-content: space-between;
  column-gap: 4rem;
}
footer .credit { grid-column: 1 / -1; }
/* (the body is a column: what's centred with a max-width would otherwise shrink to its content) */
body > :not(svg) { width: 100%; }
body > :has(+ footer) { flex-grow: 1; } /* (what's above the footer takes the room left) */
footer > :not(.mark) { position: relative; z-index: 1; }
footer .mark { position: absolute; z-index: 0; right: -40px; bottom: -130px; width: 400px; transform: rotate(-9deg); pointer-events: none; }
footer .name { display: inline-block; font-size: clamp(3.6rem, 8vw, 5.6rem); line-height: 0.95; letter-spacing: -0.03em; color: var(--fg); }
footer .pitch p { max-width: 30rem; margin: 1rem 0 2rem; font-size: 1.08rem; line-height: 1.55; }
footer .pitch .cta { justify-content: flex-start; }
footer .pitch .arrow { width: 14px; height: 14px; transition: transform 0.2s; }
footer .pitch .button.primary:hover .arrow { transform: translateX(3px); }
footer .columns { display: grid; grid-template-columns: repeat(4, auto); gap: 3.5rem; align-self: start; padding-top: 0.9rem; }
footer .columns nav { all: unset; display: flex; flex-direction: column; align-items: flex-start; }
footer h2 { margin-bottom: 0.9rem; font-size: 0.92rem; font-weight: 600; color: var(--fg); }
footer .columns a { display: flex; align-items: center; gap: 0.55rem; width: fit-content; padding: 0.3rem 0; transition: color 0.15s; }
footer .columns svg { width: 15px; height: 15px; }
footer .columns .x svg { width: 13px; height: 13px; margin: 0 1px; }
footer a:hover, footer a[aria-current="page"] { color: var(--fg); }
footer a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
footer .credit { margin-top: 72px; font-size: 0.85rem; }
footer .credit a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
footer .heart { display: inline-block; width: 0.95em; height: 0.95em; vertical-align: -0.12em; color: var(--teal); }
@media (max-width: 1000px) {
  footer { grid-template-columns: minmax(0, 1fr); }
  footer .columns { grid-template-columns: repeat(4, auto); justify-content: start; margin-top: 64px; padding-top: 0; }
}
@media (max-width: 760px) {
  footer { padding-top: 64px; }
  footer .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; margin-top: 56px; padding-top: 0; }
  footer .mark { width: 240px; right: -70px; bottom: -90px; opacity: 0.6; }
  footer .credit { margin-top: 56px; }
}
@media (max-width: 760px) {
  nav a.link { display: none; }
  nav .social { margin-right: -0.6rem; }
  nav .view { margin-left: 0; }
}

/* The phone menu (home/menu.js): under 760px a two-line button opens the nav's links over the page. */
.menu-button, .sheet { display: none; }
@media (max-width: 760px) {
  .menu-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -10px -12px -10px 0;
    border: 0;
    background: none;
    color: var(--fg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-button .bars { position: relative; width: 18px; height: 8px; }
  .menu-button .bars::before, .menu-button .bars::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.25s ease;
  }
  .menu-button .bars::before { top: 0; }
  .menu-button .bars::after { bottom: 0; }
  .menu-button[aria-expanded="true"] .bars::before { transform: translateY(3.25px) rotate(45deg); }
  .menu-button[aria-expanded="true"] .bars::after { transform: translateY(-3.25px) rotate(-45deg); }

  /* Open: the bar stays at the top of the screen and the page behind doesn't scroll. */
  .menu-open { overflow: hidden; }
  .menu-open body > nav { position: fixed; top: 0; left: 0; right: 0; z-index: 31; background: var(--bg); }
  .sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    overflow-y: auto;
    padding: 8px 16px 40px;
    background: var(--bg);
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .sheet[hidden] { display: none; }
  .sheet.open { opacity: 1; }
  .sheet nav { all: unset; display: flex; flex-direction: column; }
  .sheet a {
    padding: 8px 0;
    font-family: var(--serif);
    font-size: 2.4rem;
    line-height: 1.1;
    color: var(--fg);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transition-delay: calc(var(--i) * 30ms + 40ms);
  }
  .sheet.open a { opacity: 1; transform: none; }
  .sheet a[aria-current="page"] { color: var(--teal); }
  .sheet a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet a, .menu-button .bars::before, .menu-button .bars::after { transition: none; }
}
img, svg { display: block; }
/* The agents' one-colour logos (black in their files) turn light on the dark page. */
:root[data-theme="dark"] img.mono { filter: invert(0.92); }
a { color: inherit; text-decoration: none; }

.icon { width: 16px; height: 16px; flex: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.15rem;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.button:hover { background: var(--btn-bg-hover); }
.button.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.button.primary:hover { background: var(--primary-bg-hover); }
.button.icon-only { width: 44px; padding: 0; }

.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.download { display: inline-flex; position: relative; }
.download > .button { border-radius: 12px 0 0 12px; }
.download-more summary { list-style: none; border-radius: 0 12px 12px 0; width: 40px; padding: 0; border-left: 1px solid var(--split); }
.download-more summary::-webkit-details-marker { display: none; }
.download-more .menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 220px;
  z-index: 20;
  padding: 6px;
  border-radius: 14px;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.download-more .menu a { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 9px; font-size: 0.9rem; }
.download-more .menu a:hover { background: var(--menu-hover); }

/* The demo: the real app in a window. */
.window {
  border-radius: 14px;
  overflow: hidden;
  background: #1e1e1e;
  border: 1px solid var(--window-border);
  box-shadow: var(--window-shadow);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: #262626;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #8a8a8a;
  font-size: 0.78rem;
}
.window-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { flex: 1; text-align: center; margin-right: 52px; }
.window iframe { display: block; width: 100%; height: min(680px, 78vh); border: 0; background: #1e1e1e; }
/* A demo shown dark (a picker's data-theme="dark"): its bar goes dark with it. */
.window.dark, .window.dark iframe { background: #1a1b26; }
.window.dark .window-bar { background: #16161e; color: #787c99; border-bottom-color: rgba(255, 255, 255, 0.06); }

/* A demo that draws the Mac app's window itself (?window=mac, and it says so: vaultite-demo:window): no bar of ours, its
   traffic lights in its own sidebar, the Mac's corners (concentric with its pages' cards) and shadow, a light rim in
   the dark. A demo that doesn't (a release before it) keeps the bar. The frame grows by the bar, so nothing moves. */
.window.mac { position: relative; border: 0; border-radius: 16px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3), var(--window-shadow); }
.window.mac::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
:root[data-theme="dark"] .window.mac::after, .window.mac.dark::after { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16); }
.window.mac .window-bar { display: none; }
.window.mac iframe { height: calc(min(680px, 78vh) + 40px); }

@media (max-width: 640px) {
  .window iframe { height: 560px; }
  .window.mac iframe { height: 600px; }
}

/* A glass bundle (the demo says so, vaultite-demo:glass; b.html, and home/tryit.js's picker): the window on a desktop,
   which it blurs, as a Mac's and Windows 11's window server does; the demo's bars are see-through to it (?desk=page). */
.desk { --desk-pad: 0px; padding: var(--desk-pad); border-radius: 22px; transition: padding 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.5s; }
.desk.glass {
  --desk-pad: clamp(14px, 3.4vw, 44px);
  background: var(--desk-paper);
  box-shadow: var(--window-shadow);
  --desk-paper:
    radial-gradient(38% 50% at 14% 22%, #3b82f6 0 40%, transparent 72%),
    radial-gradient(34% 46% at 86% 16%, #f472b6 0 38%, transparent 70%),
    radial-gradient(42% 52% at 78% 86%, #fb923c 0 36%, transparent 70%),
    radial-gradient(40% 50% at 22% 88%, #2dd4bf 0 34%, transparent 72%),
    radial-gradient(30% 36% at 52% 50%, #a78bfa 0 30%, transparent 70%),
    linear-gradient(135deg, #6366f1, #9333ea 55%, #db2777);
}
:root[data-theme="dark"] .desk.glass {
  --desk-paper:
    radial-gradient(38% 50% at 14% 22%, #1d4ed8 0 40%, transparent 72%),
    radial-gradient(34% 46% at 86% 16%, #be185d 0 38%, transparent 70%),
    radial-gradient(42% 52% at 78% 86%, #c2410c 0 36%, transparent 70%),
    radial-gradient(40% 50% at 22% 88%, #0f766e 0 34%, transparent 72%),
    radial-gradient(30% 36% at 52% 50%, #6d28d9 0 30%, transparent 70%),
    linear-gradient(135deg, #1e1b4b, #3b0764 55%, #500724);
}
.desk.glass .window { background: transparent; -webkit-backdrop-filter: blur(40px) saturate(170%); backdrop-filter: blur(40px) saturate(170%);
  border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 30px 70px -20px rgba(20, 10, 40, 0.55); }
:root[data-theme="dark"] .desk.glass .window { border-color: rgba(255, 255, 255, 0.14); }
.desk.glass .window-bar { background: color-mix(in srgb, var(--bar) 55%, transparent); border-bottom-color: rgba(255, 255, 255, 0.12); }
/* (transparent, and in the demo's light or dark: a frame in another colour scheme gets a solid ground) */
.desk.glass iframe { background: transparent; color-scheme: light; }
.desk.glass.dark iframe { color-scheme: dark; }
/* (full screen, the window is the screen: the desktop goes under the demo) */
.desk.glass iframe:fullscreen { background: var(--desk-paper); }
@media (prefers-reduced-motion: reduce) { .desk { transition: none; } }
