/* Shared by the public app pages: /apps, /android and /vibhavgpt-windows, and by /sources.
   Colours, type and motion come from the tokens in /theme/vibhav.css, so both
   themes work. The only raw colour is the QR code's fixed dark-on-light panel,
   which a phone camera has to read in either theme. */

:root {
  --paper-2: var(--color-paper-2);
  --paper-3: var(--color-paper-3);
  --rule: var(--color-rule);
  --rule-2: var(--color-rule-2);
  --sky-blue: var(--color-sky-blue);
  --display: var(--font-display);
  --body: var(--font-body);
  --mono: var(--font-mono);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: transparent;
  background-image: none;
  background-size: auto;
  background-attachment: scroll;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 76px 0 64px; }

/* --- Navigation --------------------------------------------------------- */

.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.nav__links { display: flex; align-items: center; flex-wrap: wrap; gap: 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--display); font-size: 1.1rem; font-weight: 650; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: var(--radius-icon); }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 0.94rem; text-decoration: none; white-space: nowrap; }
.nav-link:hover { color: var(--ink); }

/* --- Type --------------------------------------------------------------- */

h1, h2, h3 { min-width: 0; overflow-wrap: anywhere; font-style: normal; }
h1 {
  max-width: 11ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 4.6vw + 0.6rem, 4.4rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1;
}
h2 { margin: 0 0 18px; font-family: var(--display); font-size: 1.6rem; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.lede { max-width: 46ch; margin: 20px 0 0; color: var(--ink-2); font-size: 1.12rem; }

/* --- Buttons and links -------------------------------------------------- */

/* .download is the one filled action on a platform page. On the apps page the
   plain .button is outlined, and only a platform that matches the visitor's
   device (see the page's small script) is filled. */
.download, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.download, [data-recommended] .button { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button:hover { border-color: var(--accent); }
.download:hover, [data-recommended] .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.download svg, .button svg { flex: 0 0 auto; width: 18px; height: 18px; }
.download-meta { color: var(--muted); font-size: 0.9rem; }
.direct {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 0.94rem;
  text-underline-offset: 3px;
}
.direct:hover { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 32px; }
.web-link { margin: 18px 0 0; color: var(--muted); font-size: 0.92rem; }
.web-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-underline-offset: 3px; }

/* --- Device frames: drawn shapes around a sketch of the workspace ------
   A phone with its side buttons, a monitor on a stand with a window title bar,
   and two plain frames for the Sources page. Inside, the workspace is drawn
   as plain shapes (a question, an answer, the floating message box): nothing
   in them is text, a screenshot or a claim. Only tokens are used, so both
   themes work. */

.device {
  position: relative;
  display: grid;
  justify-self: center;
  border: 1px solid var(--rule-2);
  background: linear-gradient(155deg, var(--paper-3), var(--paper-deep));
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--rule);
}
.device__screen {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}
.device__ui { position: absolute; inset: 14% 12% 8%; display: flex; flex-direction: column; gap: 7%; }
.device__ui i { display: block; height: 6px; border-radius: 3px; background: var(--rule-2); }
.device__ui .device__q { width: 58%; height: 16px; margin-left: auto; margin-bottom: 4%; border-radius: 8px; background: var(--paper-3); }
.device__ui .device__short { width: 62%; }
.device__ui .device__composer { margin-top: auto; height: 20px; border-radius: 10px; border: 1px solid var(--rule-2); background: var(--paper-2); box-shadow: var(--shadow-sm); }
.device__glyph { position: relative; z-index: 1; width: 30%; max-width: 72px; color: var(--accent); }

.device--phone { width: 150px; aspect-ratio: 9 / 18; padding: 8px; border-radius: 30px; }
.device--phone::before, .device--phone::after { content: ""; position: absolute; width: 3px; border-radius: 2px; background: var(--rule-2); }
.device--phone::before { left: -4px; top: 22%; height: 12%; }
.device--phone::after { right: -4px; top: 28%; height: 16%; }
.device--phone .device__screen { border-radius: 22px; }
.device--phone .device__screen::before { content: ""; position: absolute; top: 8px; left: 33%; width: 34%; height: 8px; border-radius: var(--radius-pill); background: var(--paper-deep); }
.device--phone .device__ui { inset: 16% 10% 6%; gap: 5%; }

.device--window { width: min(100%, 260px); aspect-ratio: 16 / 10; padding: 6px; border-radius: 14px; grid-template-rows: 22px 1fr; margin-bottom: 24px; }
.device--window::before { content: ""; position: absolute; left: 50%; bottom: -14px; width: 12%; height: 14px; transform: translateX(-50%); background: linear-gradient(var(--rule-2), var(--rule)); }
.device--window::after { content: ""; position: absolute; left: 50%; bottom: -20px; width: 34%; height: 6px; transform: translateX(-50%); border-radius: 3px 3px 6px 6px; background: var(--rule-2); }
.device__bar { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-bottom: 1px solid var(--rule); border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--paper-deep) 70%, transparent); }
.device__bar img { width: 12px; height: 12px; }
.device__controls { display: flex; gap: 5px; margin-left: auto; }
.device__controls b { width: 7px; height: 7px; border-radius: var(--radius-round); background: var(--rule-2); }
.device--window .device__screen { border-radius: 0 0 8px 8px; }

/* The Sources page: the same window without a stand, and a plain video frame. */
.device--flat { margin-bottom: 0; }
.device--flat::before, .device--flat::after { display: none; }
.device--video { width: min(100%, 260px); aspect-ratio: 16 / 9; padding: 6px; border-radius: 14px; }
.device--video .device__screen { border-radius: 9px; }

.device--lg.device--phone { width: 240px; }
.device--lg.device--window { width: 100%; max-width: 440px; }

/* --- Hub pages: Apps and Sources ------------------------------------------
   White elevated cards on the warm ground in light mode, the raised paper
   surface in dark mode (never a white patch). One card system serves both
   pages. Only /apps and /sources use these classes. */
.hub-hero { padding: 56px 0 32px; }
.hub-hero h1 { max-width: 14ch; }

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }

.app-card {
  --card-surface: var(--color-paper-2);
  --card-line: color-mix(in srgb, var(--ink) 12%, transparent);
  --card-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent), 0 8px 24px -12px color-mix(in srgb, var(--ink) 20%, transparent);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card, 20px);
  background: var(--card-surface);
  box-shadow: var(--card-shadow);
}
:root:not([data-theme="light"]) .app-card {
  --card-surface: var(--color-paper-raised);
  --card-line: color-mix(in srgb, white 10%, transparent);
  --card-shadow: var(--shadow-md);
}
.app-card[data-recommended] { border-color: var(--accent-line, var(--accent)); box-shadow: 0 0 0 1px var(--accent-line, var(--accent)), var(--card-shadow); }
.app-card--wide { max-width: 560px; }
.app-card__head { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px 14px; }
.app-card__head > .platform__tag { grid-column: 1 / -1; justify-self: start; }
.app-card__title { min-width: 0; }
.app-card h2, .app-card h3 { margin: 0; font-family: var(--display); font-size: 1.3rem; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.2; }
.app-card__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.app-card__icon--windows { background: color-mix(in srgb, var(--sky-blue) 14%, transparent); color: var(--sky-blue); }
.app-card__icon--android { background: color-mix(in srgb, var(--color-accent-pine) 16%, transparent); color: var(--color-accent-pine); }
.app-card__icon--web { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.app-card__fact { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.app-card__text { margin: 0; color: var(--ink-2); }
.app-card__actions { display: grid; justify-items: start; gap: 6px; padding-top: 4px; }
.app-card .platform__hint { margin: 0; }
.app-card .qr { margin: 4px 0 0; }
.app-card .qr svg { width: 112px; height: 112px; }

.platform__tag { padding: 3px 10px; border: 1px solid var(--accent-line); border-radius: var(--radius-pill); color: var(--accent); font: 600 0.78rem var(--body); white-space: nowrap; }
.platform__tag[hidden] { display: none; }
.platform__hint { max-width: 44ch; margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Sources: sections, repository paths and documentation rows */
.src-section { margin-top: 36px; }
.src-section__title { margin: 0 0 14px; font-size: 1.05rem; color: var(--ink-2); font-family: var(--body); font-weight: 650; letter-spacing: 0; }
.src-path { margin: 0; }
.src-path code, .src-row code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.src-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.src-row {
  --card-surface: var(--color-paper-2);
  --card-line: color-mix(in srgb, var(--ink) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 18px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card-surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
  transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
:root:not([data-theme="light"]) .src-row { --card-surface: var(--color-paper-raised); --card-line: color-mix(in srgb, white 10%, transparent); }
.src-row:hover { border-color: var(--accent); }
.src-row__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; }
.src-row__main > span { color: var(--ink-2); font-size: 0.94rem; }
.src-row svg { flex: 0 0 auto; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 1020px) {
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Three cards in two columns would leave a hole: the last one takes the row. */
  .app-grid > .app-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hub-hero { padding: 32px 0 22px; }
  .app-grid, .src-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .app-card { padding: 20px; }
  .app-card--wide { max-width: none; }
}

/* --- Release facts, steps, notes and checksum --------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 56px;
  align-items: center;
  padding: 64px 0 56px;
}
.hero--phone { grid-template-columns: minmax(0, 1fr) 300px; }

/* Desktop visitors get the page on their phone in one scan. */
.scan { display: flex; align-items: center; gap: 16px; margin-top: 36px; color: var(--muted); font-size: 0.9rem; }
.scan__code { flex: 0 0 auto; width: 92px; height: 92px; padding: 8px; border-radius: 12px; background: #f4f8fc; }
.scan__code svg { display: block; width: 100%; height: 100%; }
.scan strong { display: block; color: var(--ink); font-weight: 600; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.facts div { padding: 20px 20px 20px 0; }
.facts div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt { color: var(--muted); font-size: 0.82rem; }
/* Figures in the sans: Prata's old-style 1 reads as an l in "1.0.1". */
.facts dd { margin: 6px 0 0; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.columns { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; margin-top: 56px; }

/* Installing is a real sequence, so it is numbered. */
.steps { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; color: var(--ink-2); counter-increment: step; }
.steps li::before { content: counter(step); color: var(--accent); font-size: 1.7rem; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.steps strong { color: var(--ink); font-weight: 600; }
.note { margin: 20px 0 0; padding-left: 54px; color: var(--muted); font-size: 0.9rem; }

.notes { margin: 0; color: var(--ink-2); }
ul.notes { display: grid; gap: 8px; padding-left: 1.1em; }
.verify { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--rule); }
.verify h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.verify p { margin: 6px 0 0; color: var(--muted); font-size: 0.88rem; }
.checksum-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.checksum {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-icon);
  background: var(--paper-deep);
  color: var(--ink-2);
  font: 500 0.78rem/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.copy {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-icon);
  background: transparent;
  color: var(--ink-2);
  font: 600 0.84rem var(--body);
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.copy:hover { border-color: var(--accent); color: var(--ink); }
.command { margin-top: 10px; color: var(--faint); font-size: 0.82rem; }
.command code { color: var(--ink-2); font-family: var(--mono); font-size: 0.78rem; overflow-wrap: anywhere; }

/* The other platform, one clear link. */
.also { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.also h2 { margin-bottom: 10px; }
.also p { max-width: 54ch; margin: 0 0 16px; color: var(--ink-2); }

/* --- Footer ------------------------------------------------------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  margin-top: 64px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.86rem;
}
.footer span { margin-right: auto; }
.footer a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--muted); text-underline-offset: 3px; }
.public-operator a { display: inline-flex; align-items: center; min-height: 44px; }
.footer a:hover { color: var(--ink); }
/* The profile links: one group, each a 44px target. */
.footer__social { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); }

/* --- Motion --------------------------------------------------------------
   Short entrances and small hover shifts, opacity and transform only. Content
   is visible without any of it: the animation only ever starts from a faded
   state, and nothing waits for a script. Reduced motion keeps a quick fade and
   drops every movement. */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: apps-rise var(--dur-short) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
  .device { transition: transform var(--dur-short) var(--ease-out); }
  .platform:hover .device, .platform:focus-within .device { transform: translateY(-4px); }
  .button:hover, .download:hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .rise { animation: apps-fade var(--dur-micro) linear both; }
}
@keyframes apps-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes apps-fade { from { opacity: 0; } }

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

@media (max-width: 860px) {
  .hero, .hero--phone { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 40px 0; }
  .hub-hero { padding: 40px 0 28px; }
  .device--lg.device--phone { width: 220px; }
  .device--lg.device--window { max-width: 440px; }
  .scan { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}
@media (max-width: 420px) {
  .download, .button { width: 100%; }
  .direct { justify-content: center; }
  .facts dd { font-size: 1.12rem; }
  .footer span { flex-basis: 100%; }
}

/* A QR code: dark on white, whatever the page's theme, because scanners read it that way. It is a picture of an address, so the
   caption says where it goes. On a small screen the person is probably holding the phone already, so it is not shown. */
.qr { display: grid; gap: 10px; justify-items: start; margin: 18px 0 0; }
.qr svg { display: block; width: 152px; height: 152px; border-radius: 12px; }
.qr figcaption { max-width: 22rem; color: var(--color-muted, var(--muted)); font-size: 0.86rem; line-height: 1.5; }
@media (max-width: 720px) { .qr--desktop { display: none; } }
