/* ==========================================================================
   Oshi Collect website: one stylesheet for every page.
   Colours mirror the app (lib/theme/app_colours.dart). Light is the default;
   the dark values apply when <html data-theme="dark"> (set by a tiny script
   in each page's <head>, from the visitor's choice or their device setting).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Colour tokens ---------- */
:root {
  color-scheme: light;
  --bg-fallback: #C6C0E6;
  --bg-image: url("../img/bg-light.webp");   /* the app's background colours */
  --tri-image: url("../img/tri-light.webp");  /* the triangle pattern, tiled */
  --nav: #544D85;
  --nav-text: #F5F2FB;
  --nav-muted: #DCD6F2;
  --heading: #352D63;        /* text placed straight on the background */
  --text: #443A74;
  --muted: #4F4580;
  --panel: rgba(46, 39, 84, 0.45);   /* the frosted purple backing behind blocks of text */
  --panel-solid: rgba(46, 39, 84, 0.72);   /* the same, without frosting (slow devices) */
  --table-head: #352D63;   /* table header row, release-note headings */
  --code-blue: #B8D4EC;    /* set codes in release notes */
  --panel-border: #C4B8E8;
  --panel-text: #F5F2FB;
  --panel-muted: #EEEAFB;   /* brighter than the nav's muted text, to stay readable on the see-through panels */
  --panel-line: rgba(196, 184, 232, 0.35);
  --btn: #B8D4EC;
  --btn-hover: #CBE1F3;
  --btn-text: #124A72;
  --btn-border: #B8D4EC;
  --gold: #E3C56E;
  --frame: #231D45;          /* phone frame around clips */
  --dot-on: #544D85;
  --dot-off: rgba(84, 77, 133, 0.35);
  --shadow: 0 18px 40px rgba(20, 14, 50, 0.35);
  /* slow colour drift over the triangles */
  --blob-1: rgba(243, 160, 205, 0.55);
  --blob-2: rgba(120, 185, 245, 0.55);
  --blob-3: rgba(170, 140, 240, 0.50);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-fallback: #0D0E18;
  --bg-image: url("../img/bg-dark.webp");
  --tri-image: url("../img/tri-dark.webp");
  --nav: #1A1626;
  --nav-text: #D4CEB8;
  --nav-muted: #C8C0A0;
  --heading: #E6E0CC;
  --text: #D4CEB8;
  --muted: #B0A890;
  --panel: rgba(0, 0, 0, 0.24);
  --panel-solid: rgba(0, 0, 0, 0.38);
  --table-head: #1A1626;
  --code-blue: #A9C9E8;
  --panel-border: #3A3420;
  --panel-text: #D4CEB8;
  --panel-muted: #C8C0A0;
  --panel-line: rgba(212, 206, 184, 0.16);
  --btn: #2E2A1C;
  --btn-hover: #3A3524;
  --btn-text: #D9B95C;
  --btn-border: #7A6530;
  --gold: #C9A84C;
  --frame: #07070C;
  --dot-on: #C9A84C;
  --dot-off: rgba(212, 206, 184, 0.30);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --blob-1: rgba(40, 70, 170, 0.40);
  --blob-2: rgba(140, 105, 30, 0.42);
  --blob-3: rgba(90, 50, 150, 0.42);
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-fallback);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--heading); text-wrap: balance; }
p { margin: 0; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
main { flex: 1; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--btn); color: var(--btn-text); padding: 10px 14px; border-radius: 10px; }

/* ---------- Background ----------
   Back to front: the app's background colours stretched over the screen,
   three slowly drifting colour patches, then the triangle pattern.
   The colours and the drifting patches are drawn by site.js into ONE small
   canvas, stretched to fill the screen. (They used to be three huge separate
   layers, which the browser had to blend on every frame while scrolling:
   that was the main cause of laggy scrolling.) Without the script, the
   still background image shows instead.
   The triangles are a repeating tile at a fixed size (30px wide, as on a
   phone in the app), so they stay small and sharp however big the screen is. */
.bg {
  position: fixed;
  inset: 0;
  height: 100lvh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-fallback) var(--bg-image) center / 100% 100% no-repeat;
}
.bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bg::after { content: ""; position: absolute; inset: 0; background: var(--tri-image) 0 0 / 720px 600px repeat; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--nav); color: var(--nav-text); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; padding-top: 6px; padding-bottom: 2px; }
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.logo img { width: 34px; height: 34px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; align-items: center; gap: 2px; width: 100%; margin-left: -12px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 8px; }
.site-nav a:hover { background: rgba(255, 255, 255, 0.10); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--nav-text); cursor: pointer; }
.theme-toggle:hover { background: rgba(255, 255, 255, 0.10); }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (min-width: 720px) {
  .site-header .wrap { flex-wrap: nowrap; padding: 10px 32px; }
  .site-nav { width: auto; margin-left: auto; order: 2; }
  .header-actions { order: 3; }
  .wrap { padding: 0 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--btn-border);
  background: var(--btn); color: var(--btn-text);
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.98); }
.btn-big { min-height: 56px; padding: 0 32px; font-size: 18px; width: 100%; max-width: 320px; }

/* ---------- Purple backing panel ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  color: var(--panel-text);
  padding: 20px;
  /* Frosted glass: a light blur of whatever is behind the panel. It is the
     most expensive effect on the site (about 4x the screen-drawing work
     while scrolling, measured 2026-11-20), which is fine on any reasonably
     modern device. site.js watches the first scrolls, and if the device is
     clearly struggling it adds "no-frost" to the page, which switches to
     the solid panels below. */
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.no-frost .panel { background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.panel h2, .panel h3, .panel h4 { color: var(--panel-text); }
.panel .soft { color: var(--panel-muted); }
.soft { color: var(--muted); }
.small { font-size: 13px; line-height: 1.5; }

/* ---------- Phone frame around a clip or screenshot ---------- */
.phone {
  position: relative; flex: none;
  width: 236px; aspect-ratio: 1080 / 2113;
  box-sizing: content-box;
  border: 7px solid var(--frame); border-radius: 30px;
  overflow: hidden; background: var(--frame);
  box-shadow: var(--shadow);
}
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; }
.phone.small-phone { width: 200px; }

/* ---------- Home: hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 28px; padding-bottom: 8px; text-align: center; }
.hero-text { display: contents; }
.hero h1 { font-size: 40px; line-height: 1.1; font-weight: 700; order: 1; }
.hero .tagline { font-size: 17px; line-height: 1.5; max-width: 330px; order: 2; margin-top: -8px; }
.hero .phone { order: 3; }
.hero .download { order: 4; }

.download { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.dl-android, .dl-desktop, .dl-ios { display: none; }
[data-device="android"] .dl-android { display: flex; }
[data-device="ios"] .dl-ios { display: flex; }
[data-device="desktop"] .dl-desktop, html:not([data-device]) .dl-desktop { display: flex; }
.dl-android { flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.dl-desktop { align-items: center; gap: 22px; max-width: 500px; text-align: left; }
.dl-desktop .qr { flex: none; padding: 10px; background: #fff; border-radius: 10px; }
.dl-desktop .qr img { width: 132px; height: 132px; }
.dl-desktop .dl-info { display: flex; flex-direction: column; gap: 8px; }
.dl-desktop .dl-title, .dl-ios .dl-title { font-size: 19px; font-weight: 600; line-height: 1.3; }
.dl-ios { flex-direction: column; align-items: center; gap: 6px; max-width: 340px; text-align: center; }
.dl-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; }
@media (max-width: 460px) {
  .dl-desktop { flex-direction: column; text-align: center; }
  .dl-links { justify-content: center; }
}
@media (min-width: 900px) {
  .hero { flex-direction: row; justify-content: center; gap: 72px; padding-top: 56px; padding-bottom: 24px; text-align: left; }
  .hero-text { display: flex; flex-direction: column; gap: 22px; flex: 1 1 440px; max-width: 540px; }
  .hero h1 { font-size: 64px; line-height: 1.05; }
  .hero .tagline { font-size: 21px; max-width: none; margin-top: 0; }
  .hero .phone { width: 270px; }
  .hero .download { align-items: flex-start; }
  [data-device="android"] .hero .dl-android { align-items: flex-start; }
}

/* ---------- Home: feature slider ---------- */
.features { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 36px; padding-bottom: 32px; }
.features > h2 { font-size: 26px; font-weight: 700; text-align: center; }
.slider { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; width: 100%; gap: 8px 40px; }
.slides {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 8px 28px 30px; }
.slide .phone { box-shadow: 0 8px 18px rgba(20, 14, 50, 0.30); }
.slide-text { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.slide-text h3 { font-size: 24px; font-weight: 700; }
.slide-text ul { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.arrow { display: none; width: 48px; height: 48px; padding: 0; border-radius: 50%; }
.dots { display: flex; justify-content: center; grid-column: 1 / -1; }
.dots button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.dots button span { display: block; width: 10px; height: 10px; border-radius: 999px; background: var(--dot-off); transition: width 0.2s, background 0.2s; }
.dots button[aria-current="true"] span { width: 26px; background: var(--dot-on); }
.swipe-hint { margin-top: -8px; font-size: 13px; color: var(--muted); }
.more-link { margin-top: 8px; }
@media (min-width: 900px) {
  .features { gap: 28px; padding-top: 56px; padding-bottom: 64px; }
  .features > h2 { font-size: 34px; }
  .slider { grid-template-columns: 48px minmax(0, 780px) 48px; justify-content: center; }
  .arrow { display: inline-flex; }
  .slide { flex-direction: row; justify-content: center; gap: 56px; }
  .slide .phone { width: 250px; }
  .slide-text h3 { font-size: 32px; }
  .swipe-hint { display: none; }
}

/* ---------- Inner pages (Guide, Install, Changes, Legal) ---------- */
.page { padding-top: 28px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font-size: 34px; font-weight: 700; }
.page-head p { font-size: 18px; max-width: 62ch; }
.with-toc { display: flex; flex-direction: column; gap: 22px; }
.toc { padding: 14px 18px; }
.toc summary { font-weight: 600; cursor: pointer; min-height: 32px; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; }
.toc[open] summary::after { transform: rotate(225deg); }
.toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.toc a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; font-size: 15px; }
.toc a:hover { background: rgba(255, 255, 255, 0.10); }
.toc a.here { color: var(--gold); font-weight: 600; }
.content { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section > h2 { font-size: 24px; font-weight: 700; }
.section h3 { font-size: 18px; font-weight: 600; margin-top: 6px; }
.section ul, .section ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.section li > ul { margin-top: 8px; }
.section strong { font-weight: 600; }
.panel strong { color: #fff; }
[data-theme="dark"] .panel strong { color: #EFE9D4; }
.note { border-left: 3px solid var(--gold); padding: 2px 0 2px 14px; }

/* a screenshot beside its text (Guide) */
.shot-row { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.shot-row .shots { display: flex; gap: 14px; justify-content: center; flex: none; }
.shot-row .words { display: flex; flex-direction: column; gap: 14px; min-width: 0; width: 100%; }
/* the "prices are estimates" line: centred at the bottom of its section */
.disclaimer { text-align: center; font-style: italic; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 5px; font-weight: 500; color: #fff; padding: 10px 0 2px; border-top: 1px solid var(--panel-line); margin-top: 4px; }
[data-theme="dark"] .disclaimer { color: #EFE9D4; }
@media (max-width: 480px) { .shot-row .shots .phone { width: 150px; border-width: 5px; border-radius: 22px; } .shot-row .shots.single .phone { width: 200px; } }

/* numbered steps (Install) */
.steps { list-style: none; counter-reset: step; padding: 0 !important; gap: 16px !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; min-height: 34px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; background: var(--btn); color: var(--btn-text); border: 1px solid var(--btn-border); }

/* quick facts row */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.fact b { font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1.2; }
.fact span { font-size: 14px; color: var(--panel-muted); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* questions (Install FAQ) */
.faq details { border-top: 1px solid var(--panel-line); }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 48px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; margin-right: 6px; }
.faq details[open] summary::after { transform: rotate(225deg); }
.faq details > div { padding: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }

/* tables (Legal) */
.table-box { overflow-x: auto; border: 1px solid var(--panel-line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.table-box.wide table { min-width: 560px; }  /* wide tables scroll sideways on phones */
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--panel-line); }
th { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; color: var(--panel-text); background: var(--table-head); }
tr:last-child td { border-bottom: 0; }

/* versions (Changes) */
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.release-head h2 { font-size: 26px; color: var(--heading); }   /* dark purple in light mode; dark mode keeps its light heading colour */
/* section headings ("New", "Changed", "Fixed") as dark purple labels */
.notes-h { align-self: flex-start; background: var(--table-head); color: var(--panel-text); font-size: 16px; padding: 5px 12px; border-radius: 8px; margin-top: 10px; }
.money { color: var(--gold); font-weight: 600; }
.code { color: var(--code-blue); font-weight: 600; white-space: nowrap; }
.release-head .tag { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--btn-text); background: var(--btn); border: 1px solid var(--btn-border); border-radius: 999px; padding: 2px 10px; }

@media (min-width: 900px) {
  .page { padding-top: 48px; padding-bottom: 72px; gap: 28px; }
  .page-head h1 { font-size: 44px; }
  .panel { padding: 28px; }
  .toc { padding: 16px 18px; }
  .with-toc { flex-direction: row; align-items: flex-start; gap: 32px; }
  .with-toc .toc { position: sticky; top: 92px; flex: 0 0 230px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .with-toc .toc summary { pointer-events: none; }
  .with-toc .toc summary::after { display: none; }
  .with-toc .content { flex: 1; }
  /* Wide screens: the screenshot sits on the right and the text wraps around
     it, carrying on at full width underneath. */
  .shot-row { display: flow-root; }
  .shot-row .shots { float: right; margin: 0 0 18px 32px; }
  .shot-row .words { display: block; }
  .shot-row .words > * + * { margin-top: 14px; }
  .shot-row .words > h3 { margin-top: 20px; }
  .shot-row .words ul, .shot-row .words ol:not(.steps) { display: block; }
  .shot-row .words li + li { margin-top: 8px; }
  /* When the text is shorter than the screenshot (the script checks), the two
     sit side by side with the text centred against the picture instead. */
  .shot-row.centred { display: flex; flex-direction: row; align-items: center; gap: 32px; }
  .shot-row.centred .shots { float: none; order: 2; margin: 0; }
  .shot-row.centred .words { flex: 1; }
  .narrow { max-width: 820px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--nav); color: var(--nav-text); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 18px; padding-bottom: 20px; }
.site-footer p { flex: 1 1 320px; font-size: 13px; line-height: 1.5; color: var(--nav-muted); }
.site-footer nav { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; margin-left: -10px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }

/* ---------- Motion ---------- */
/* Sections fade up as they scroll into view (only when the script is running). */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.in { opacity: 1; transform: none; }
/* Soft cross-fade between pages in browsers that support it. */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slides { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .dots button span { transition: none; }
  @view-transition { navigation: none; }
}
