/* Pixfin landing pages.
 *
 * Standalone - these pages do not load /styles.css. That sheet dresses the RJ
 * Labs agency site and its blue-on-white defaults kept having to be undone here;
 * one sheet per surface is cheaper than a page of overrides.
 *
 * The palette is the App Store screenshots' "ocean-fresh" theme
 * (marketing/screenshots/src/compose.mjs), so the site and the store listing
 * read as one product rather than two designs.
 */

/* Nunito, self-hosted (see buildFonts in tools/pixfin/build-assets.mjs). One
   variable file per subset covers both weights in use; the browser fetches the
   latin-ext file only for a page with a character in its range. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/apps/pixfin/fonts/nunito-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/apps/pixfin/fonts/nunito-latin.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;
}

:root {
  --ink: #0c4a6e;
  --ink-soft: #4a6f8f;
  --accent: #0284c7;
  --accent-deep: #0369a1;
  --bg: #ffffff;
  --bg-alt: #f0f9ff;
  --line: #dbeafe;
  --card: #ffffff;
  --deep-1: #0c4a6e;
  --deep-2: #062f49;
  --on-deep: #e0f2fe;
  --on-deep-soft: #a8cfe6;

  --display: "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 1100px;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6f3fb;
    --ink-soft: #9fc0d6;
    --accent: #38bdf8;
    --accent-deep: #7dd3fc;
    --bg: #08161f;
    --bg-alt: #0c2231;
    --line: #17364a;
    --card: #0e2635;
    --deep-1: #041c2b;
    --deep-2: #010f18;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--text);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

h1, h2, h3, .brand-name, .step-num, .closing-title {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

a { color: var(--accent-deep); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 760px; }
.center { text-align: center; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
/* Inside the Pixfin app's own web view, flagged by the in-app script in each
   page's head. That view supplies a native bar already titled Pixfin, and its
   reader has the app, so the header is a second brand over links they can
   scroll to and a Download button that would drop them into the App Store. */
.in-app .site-header { display: none; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-icon { border-radius: 7px; display: block; }
.brand-name { font-size: 18px; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 15px;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff !important;
  padding: 9px 18px;
  font-size: 15px;
}
.btn-primary:hover { background: var(--accent-deep); }

@media (max-width: 620px) {
  .nav a:not(.btn) { display: none; }
}

/* --- Hero --------------------------------------------------------------- */

/* The hero is the tank: the app's Still Water scene, a betta floating in it, and
 * the pitch on the water in white. Stops are AmbientScene.stillWater's asset
 * colours (Scene.StillWater.Stop1-4 in the iOS repo), top to bottom; it is
 * deep and saturated in both appearances, which is why the copy on it stays
 * white in both, as the app's chrome does. Inset with rounded corners so it
 * reads as a tank in the page rather than a page-wide band. */
.tank {
  --still-1: #56c9d6;
  --still-2: #369cb3;
  --still-3: #1c6e8c;
  --still-4: #0c4566;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 12px;
  border-radius: 32px;
  min-height: clamp(640px, calc(100svh - 86px), 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, var(--still-1) 0%, var(--still-2) 33%, var(--still-3) 67%, var(--still-4) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .tank {
    --still-1: #1a5e66;
    --still-2: #0e414d;
    --still-3: #062936;
    --still-4: #031621;
  }
}
.tank-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-inner {
  padding-top: clamp(48px, 9vh, 96px);
  text-align: center;
}
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  text-shadow: 0 2px 24px rgba(4, 30, 46, 0.18);
}
/* The ads' and the reels' highlight yellow, on the same phrase the store
 * highlights. The shadow is what keeps it legible on the pale top of the light
 * water; on the dark water it is barely there. */
.hero h1 .hl {
  color: #ffd54a;
  text-shadow: 0 2px 0 rgba(12, 69, 102, 0.28), 0 4px 22px rgba(4, 30, 46, 0.35);
}
/* A CJK headline is roughly one em per glyph, so the cap that suits a Latin line
 * of the same word count runs past the column and leaves a one-character orphan
 * on the next line. The constraint is the column, not the type scale. */
:lang(ja) .hero h1,
:lang(zh) .hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.2;
}
.lead {
  margin: 18px 0 0;
  max-width: 34em;
  font-size: 18px;
  color: var(--ink-soft);
}
.hero .lead {
  margin-left: auto;
  margin-right: auto;
  max-width: 31em;
  color: rgba(255, 255, 255, 0.9);
}
.trust {
  margin: 16px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.cta-row.center { justify-content: center; }
.badge { display: inline-block; line-height: 0; }
.badge img { height: 52px; width: auto; }
.badge:hover { opacity: 0.82; }

.qr {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.hero .qr { color: rgba(255, 255, 255, 0.85); text-align: left; }
.qr img {
  width: 62px;
  height: 62px;
  padding: 5px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.hero .qr img { width: 52px; height: 52px; padding: 4px; border: 0; }
.qr span { max-width: 6em; line-height: 1.3; }
/* A QR is no use on the device you would scan it with. */
@media (max-width: 900px) { .qr { display: none; } }

/* The betta holds the middle of the water below the copy, as the creature
 * holds the middle of the app's tank. pixfin-tank.js moves it; the wrapper
 * only places it. */
.tank-creature {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 24px 0 56px;
}
.betta {
  width: clamp(240px, 36vw, 440px);
  height: auto;
  will-change: transform;
  filter: drop-shadow(0 24px 30px rgba(3, 22, 33, 0.28));
}

@media (max-width: 620px) {
  .tank { margin: 8px; border-radius: 24px; min-height: 600px; }
  .hero .lead { font-size: 16.5px; }
  .betta { width: 68vw; }
  .tank-creature { padding-bottom: 40px; }
}

/* --- Sections ----------------------------------------------------------- */

.section { padding: 68px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 38px); }
.section-intro { margin: 0 0 30px; color: var(--ink-soft); }
.section-intro.center { margin-left: auto; margin-right: auto; max-width: 40em; }
.story {
  margin: 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.feature-list { margin: 18px 0 0; padding: 0; list-style: none; }
.feature-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Steps -------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.steps li { padding-top: 14px; border-top: 2px solid var(--line); }
.step-num {
  display: block;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}
.steps h3 { margin: 0 0 8px; font-size: 20px; }
.steps p { margin: 0; color: var(--ink-soft); }

@media (max-width: 780px) { .steps { grid-template-columns: 1fr; gap: 22px; } }

/* --- Feature tour (CSS-only tabs) --------------------------------------- */

.tour { position: relative; }
/* Visually hidden but still focusable, so the group is keyboard-navigable. */
.tour-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.tour-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  margin-top: 8px;
}
.tour-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tour-card {
  display: block;
  cursor: pointer;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.tour-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.tour-card h3 { margin: 0 0 4px; font-size: 16px; }
.tour-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

.tour-stage { display: grid; place-items: center; min-height: 520px; }
.tour-shot {
  grid-area: 1 / 1;
  width: 100%;
  max-width: 330px;
  height: auto;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* One pair of rules per tab: light up the card, show its screenshot. */
#tour-0:checked ~ .tour-inner .tour-card:nth-child(1),
#tour-1:checked ~ .tour-inner .tour-card:nth-child(2),
#tour-2:checked ~ .tour-inner .tour-card:nth-child(3),
#tour-3:checked ~ .tour-inner .tour-card:nth-child(4),
#tour-4:checked ~ .tour-inner .tour-card:nth-child(5),
#tour-5:checked ~ .tour-inner .tour-card:nth-child(6),
#tour-6:checked ~ .tour-inner .tour-card:nth-child(7) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 30px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-1px);
}
#tour-0:checked ~ .tour-inner .tour-shot:nth-child(1),
#tour-1:checked ~ .tour-inner .tour-shot:nth-child(2),
#tour-2:checked ~ .tour-inner .tour-shot:nth-child(3),
#tour-3:checked ~ .tour-inner .tour-shot:nth-child(4),
#tour-4:checked ~ .tour-inner .tour-shot:nth-child(5),
#tour-5:checked ~ .tour-inner .tour-shot:nth-child(6),
#tour-6:checked ~ .tour-inner .tour-shot:nth-child(7) {
  opacity: 1;
  transform: scale(1);
}
.tour-radio:focus-visible ~ .tour-inner .tour-cards { outline: 2px solid var(--accent); outline-offset: 6px; }

@media (max-width: 900px) {
  .tour-inner { grid-template-columns: 1fr; gap: 24px; }
  .tour-stage { order: -1; min-height: 430px; }
  .tour-shot { max-width: 260px; }
}
@media (max-width: 560px) {
  .tour-cards { grid-template-columns: 1fr; }
}

/* --- Deep section ------------------------------------------------------- */

.section-deep {
  background: linear-gradient(165deg, var(--deep-1) 0%, var(--deep-2) 100%);
  color: var(--on-deep);
}
.section-deep .section-title { color: var(--on-deep); }
.section-deep .feature-list li { color: var(--on-deep-soft); }
.section-deep .feature-list li::before { background: #38bdf8; }

/* --- Cards -------------------------------------------------------------- */

/* align-items: start so a short card is not stretched to match a tall neighbour
 * - the two offer cards carry different numbers of bullets. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 24px;
}
.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
}
.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.card h2 { margin: 0; font-size: 21px; }
.card .section-intro { margin: 10px 0 0; font-size: 14px; }
.card-premium { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

@media (max-width: 900px) {
  .card-grid, .offer-grid { grid-template-columns: 1fr; }
}

/* --- FAQ ---------------------------------------------------------------- */

.faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 40px;
  margin-top: 34px;
}
.faq-item h3 { margin: 0 0 6px; font-size: 17px; }
.faq-item p { margin: 0; font-size: 15px; color: var(--ink-soft); }

@media (max-width: 820px) { .faq { grid-template-columns: 1fr; gap: 22px; } }

/* --- Closing ------------------------------------------------------------ */

.closing {
  text-align: center;
  background:
    radial-gradient(70% 100% at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg-alt);
}
.closing-title { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.closing-line {
  margin: 14px auto 0;
  max-width: 30em;
  font-size: 18px;
  color: var(--ink-soft);
}
.closing-strip {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-inner { text-align: center; }
.lang-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 26px;
  font-size: 14px;
}
.lang-nav a { color: var(--ink-soft); text-decoration: none; }
.lang-nav a:hover { color: var(--accent-deep); }
.lang-nav [aria-current] { color: var(--ink); font-weight: 700; }

.footer-brand { margin: 0 0 6px; font-weight: 700; }
.footer-meta,
.footer-copy { margin: 6px 0; font-size: 13px; color: var(--ink-soft); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 16px 0;
  font-size: 14px;
}
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent-deep); }
.footer-guides { margin: 0 0 26px; }

/* --- Guides ------------------------------------------------------------- */

/* Long-form articles under /apps/pixfin/guides/. One reading column, the
   landing page's palette and type, and none of its section bands: an article
   reads as one piece rather than a stack of panels. */

.guide-head {
  padding: 56px 0 36px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}
.crumbs { font-size: 14px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent-deep); }
.guide-head h1 {
  margin: 14px 0 0;
  font-size: clamp(32px, 5vw, 50px);
}
.guide-head .lead { max-width: none; }
.guide-meta { margin: 18px 0 0; font-size: 13px; color: var(--ink-soft); }

.prose { padding-bottom: 72px; font-size: 17px; }
.prose section { margin-top: 44px; }
.prose h2 { margin: 0 0 12px; font-size: clamp(23px, 3vw, 29px); }
.prose h3 { margin: 0 0 6px; font-size: 18px; }
.prose p { margin: 0 0 16px; }
.prose ul,
.prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose .cta-row { margin-top: 4px; }

#pixfin {
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.guide-figure { margin: 6px 0 22px; text-align: center; }
.guide-figure img {
  width: 240px;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 18px 40px -18px rgba(12, 74, 110, 0.45);
}
.guide-figure figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-soft); }

.guide-faq { display: grid; gap: 22px; }
.guide-faq p { margin: 0; color: var(--ink-soft); }

.guide-sources { font-size: 14px; color: var(--ink-soft); }
.guide-sources h2 { font-size: 20px; }
.guide-disclaimer { margin-top: 18px; font-style: italic; }

@media (max-width: 560px) {
  .prose { font-size: 16px; }
  #pixfin { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
