/* Basis Preferences — /preferences. Every class is prefixed pf- so the page
   can share a document with the site footer and the contact dialog. */
.pf {
  --ink: #17435e; --deep: #10689f; --sky: #4fb3e8; --sky-2: #7fcbf1; --mut: #5f7787;
  --line: #e3ecf3; --pale: #f6fafd; --tint: #f1f8fd; --night: #0f2f44;
  --bg: #ffffff;                    /* the shared footer fades in from this */
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
.pf *, .pf *::before, .pf *::after { box-sizing: border-box; }
/* Resets sit inside :where() so they never outrank a component rule below. */
.pf :where(a) { color: inherit; text-decoration: none; }
.pf :where(h1, h2, h3, p, dl, dd, ul) { margin: 0; padding: 0; }
.pf :where(ul) { list-style: none; }
.pf :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* ---- hero --------------------------------------------------------------- */
.pf-hero {
  position: relative; overflow: hidden; margin: 12px; border-radius: 32px; padding-bottom: clamp(20px, 3vw, 44px);
  background: linear-gradient(176deg, #4fb3e8 0%, #62bcec 36%, #84ccf2 100%);
}
.pf-sun { position: absolute; right: -8%; top: -34%; width: 60%; height: 86%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.pf-clouds { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* The homepage's cloud bands: app.js paints each one, they drift by background-position and
   the pointer shifts them by transform, so the two never fight. */
.pf-cloud { position: absolute; left: -60px; right: -60px; background-repeat: repeat-x; background-size: 1600px 100%; opacity: 0; transition: opacity 1.6s ease; will-change: transform; }
.pf-cloud--top { top: 1%; height: 22%; animation: pf-drift 420s linear infinite; }
.pf-cloud--1 { top: 60%; bottom: 0; animation: pf-drift 360s linear infinite; }
.pf-cloud--2 { top: 68%; bottom: -2%; animation: pf-drift 260s linear infinite; }
.pf-cloud--3 { top: 76%; bottom: -2%; animation: pf-drift 200s linear infinite; }
.pf-cloud--top[data-ready] { opacity: .3; }
.pf-cloud--1[data-ready] { opacity: .85; }
.pf-cloud--2[data-ready] { opacity: .92; }
.pf-cloud--3[data-ready] { opacity: 1; }
@keyframes pf-drift { from { background-position: 0 0; } to { background-position: -1600px 0; } }
.pf-canvas { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; }

/* The homepage's nav bar, value for value: a fixed glass pill that stays put as the page scrolls. */
.pf-navwrap { position: fixed; top: 22px; left: 50%; z-index: 50; width: min(1180px, 92vw); transform: translateX(-50%); }
.pf-nav { display: flex; align-items: center; justify-content: space-between; padding: 13px 22px; border-radius: 999px; background: rgba(255,255,255,.75); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); border: 1px solid rgba(23,67,94,.12); box-shadow: 0 8px 32px rgba(23,67,94,.2), inset 0 1px 1px rgba(255,255,255,.6); }
.pf-brand { display: flex; align-items: center; color: var(--ink); }
.pf-links { display: flex; align-items: center; gap: 8px; }
.pf-link { padding: 9px 16px; border-radius: 999px; font-size: .95rem; font-weight: 500; color: var(--ink); transition: background .25s ease; }
.pf-link:hover, .pf-burger:hover { background: rgba(23,67,94,.07); }
.pf-login { margin-left: 6px; padding: 9px 18px; border-radius: 999px; background: var(--ink); color: #ffffff; font-size: .95rem; font-weight: 600; box-shadow: 0 4px 14px rgba(18,41,58,.25); }
/* The homepage's light/dark switch (basis-theme.js owns the click and the stored choice). */
.pf-theme { -webkit-appearance: none; appearance: none; flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: var(--basis-cursor-pointer, pointer); transition: background .25s ease; }
.pf-theme:hover { background: rgba(23,67,94,.07); }
.pf-theme .t-sun, [data-theme="dark"] .pf-theme .t-moon { display: none; }
[data-theme="dark"] .pf-theme .t-sun { display: block; }
.pf-burger { display: none; -webkit-appearance: none; appearance: none; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: var(--basis-cursor-pointer, pointer); }
.pf-navwrap[data-open] .pf-burger-open, .pf-navwrap:not([data-open]) .pf-burger-close { display: none; }
.pf-menu { display: none; position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex-direction: column; gap: 2px; padding: 12px; border-radius: 26px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 18px 48px rgba(23,67,94,.25); }
.pf-menu-link { display: block; padding: 14px 16px; border-radius: 16px; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.pf-menu-login { display: block; margin-top: 8px; padding: 14px 16px; border-radius: 999px; background: var(--ink); color: #ffffff; font-size: 1.05rem; font-weight: 600; text-align: center; }
@media (max-width: 640px) {
  .pf-link, .pf-login { display: none; }
  .pf-burger { display: grid; }
  .pf-navwrap[data-open] .pf-menu { display: flex; }
}

.pf-head { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: clamp(116px, min(10.4vw, 17vh), 150px) 16px 0; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; pointer-events: none; }
.pf-head h1 { font-size: clamp(44px, 6.4vw, 88px); font-weight: 600; line-height: 1; letter-spacing: -0.05em; color: var(--deep); text-wrap: balance; }
.pf-head h1 span { color: #ffffff; }
.pf-head p { font-size: 20px; line-height: 1.45; color: var(--ink); text-wrap: balance; }


/* The API box, option E from the canvas: a plain white card, the name on top, three big numbers under it. */
.pf-api {
  position: relative; z-index: 2; width: 560px; max-width: calc(100% - 32px); margin: clamp(40px, min(4.2vw, 6.6vh), 58px) auto 0; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 30px 28px; border-radius: 28px; background: #ffffff; box-shadow: 0 26px 70px rgba(16,90,136,.22);
}
.pf-api-name { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.03em; }
.pf-api-stats { display: flex; justify-content: space-between; gap: 24px; }
.pf-api-stats div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-api-stats dt { font-size: 46px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.pf-api-stats dd { font-size: 13px; color: var(--mut); }
/* The hero's two buttons live in the box: it is the product, so the way in belongs to it. */
.pf-api-cta { display: flex; gap: 8px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.pf-api-cta .pf-btn { flex: 1; justify-content: center; min-width: 0; height: 46px; padding: 0 16px; white-space: nowrap; }

/* ---- the three steps: small on purpose, so the flow above stays the subject -- */
.pf-steps { position: relative; z-index: 2; max-width: 1240px; margin: clamp(48px, min(5.6vw, 9.4vh), 82px) auto 0; padding: 0 clamp(16px, 2.4vw, 28px); display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1.12fr) 44px minmax(0, 1.2fr); align-items: stretch; }
.pf-step { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; min-height: 92px; padding: 16px 22px; border-radius: 22px; background: #ffffff; box-shadow: 0 14px 40px rgba(16,90,136,.14); transition: transform .35s ease, box-shadow .35s ease; }
.pf-step:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(16,90,136,.2); }
.pf-step--ink { background: var(--night); color: #f2fbff; }
.pf-step h2 { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.pf-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #f2fbff; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.pf-step--ink .pf-num { background: var(--sky-2); color: var(--night); }
.pf-arrow { display: grid; place-items: center; color: #ffffff; }
.pf-dash { animation: pf-dash 1s linear infinite; }
@keyframes pf-dash { to { stroke-dashoffset: -20; } }
.pf-glyph { flex: none; display: flex; }
.pf-glyph i { display: block; }
.pf-glyph--blocks { flex-direction: column; gap: 4px; width: 60px; }
.pf-glyph--blocks i { height: 18px; border-radius: 6px; background: #dcebf5; }
.pf-glyph--blocks i + i { background: var(--ink); }
.pf-glyph--dots { flex-wrap: wrap; gap: 5px; width: 65px; }
.pf-glyph--dots i { width: 9px; height: 9px; border-radius: 50%; background: #7fcbf1; }
.pf-glyph--dots i:nth-child(4n + 2) { background: #ffffff; }
.pf-glyph--dots i:nth-child(4n + 3) { background: #2b5873; }
.pf-glyph--dots i:nth-child(4n) { background: #f3b98e; }
.pf-glyph--dots i:nth-child(3n + 1) { animation: pf-pulse 1.6s ease-in-out infinite; }
.pf-glyph--dots i:nth-child(5n + 2) { animation: pf-pulse 1.6s ease-in-out .6s infinite; }
@keyframes pf-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.pf-glyph--bars { align-items: flex-end; gap: 4px; height: 40px; }
.pf-glyph--bars i { width: 9px; border-radius: 3px; }

/* ---- shared by the template previews further down ----------------------- */
.pf-clip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px 0 8px; border-radius: 14px; background: #ffffff; border: 1px solid #d5e4ee; color: var(--ink); }
.pf-clip.is-ref { border-style: dashed; background: transparent; }
.pf-clip.is-picked { background: var(--ink); border-color: var(--ink); color: #f2fbff; }
.pf-clip b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.pf-play { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #ffffff; }
.pf-clip.is-ref .pf-play { background: var(--mut); }
.pf-clip.is-picked .pf-play { background: var(--sky); }
.pf-wave { flex: 1; min-width: 16px; height: 22px; }
.pf-wave path { fill: none; stroke: #c9dbe7; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pf-cells { display: flex; gap: 5px; width: 100%; }
.pf-cell { flex: 1; min-width: 0; display: grid; place-items: center; height: 44px; border-radius: 12px; background: #ffffff; border: 1px solid #d5e4ee; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pf-cell.is-on { background: var(--ink); border-color: var(--ink); color: #f2fbff; }

/* ---- the two calls to action, kept out of the hero ---------------------- */
.pf-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 36px 16px 0; }
.pf-ctas--in { padding: 0; }
.pf-btn { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: 999px; background: var(--ink); color: #f2fbff; font-size: 16px; font-weight: 600; cursor: var(--basis-cursor-pointer, pointer); transition: transform .2s ease, box-shadow .2s ease; }
.pf-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(23,67,94,.22); }
.pf-btn--soft { background: var(--tint); color: var(--ink); }
.pf-close .pf-btn--soft { background: rgba(255,255,255,.8); }

/* ---- the rest of the page ------------------------------------------------ */
/* The page column. The template reel runs edge to edge, so the width limit sits on .pf-wrap, not on main. */
.pf-main { padding-bottom: clamp(72px, 9vw, 120px); }
.pf-wrap { max-width: 1240px; margin-left: auto; margin-right: auto; padding-left: clamp(16px, 4vw, 56px); padding-right: clamp(16px, 4vw, 56px); }
.pf-sec { padding-top: clamp(80px, 9vw, 128px); }
.pf-sec h2, .pf-close h2 { max-width: 18ch; font-size: clamp(34px, 4vw, 54px); font-weight: 600; line-height: 1.04; letter-spacing: -0.045em; text-wrap: balance; }
.pf-sec h2 { margin-bottom: clamp(28px, 3vw, 44px); }

/* The reel: every template in one row that app.js drifts from side to side. The padding leaves room for a
   card's hover lift and shadow, which an overflow-x scroller would otherwise clip. */
.pf-reel { overflow-x: auto; overflow-y: hidden; margin: -10px 0 -34px; padding: 10px 0 44px; scrollbar-width: none; cursor: var(--basis-cursor-grab, grab);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 min(6%, 72px), #000 calc(100% - min(6%, 72px)), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 min(6%, 72px), #000 calc(100% - min(6%, 72px)), transparent 100%); }
.pf-reel::-webkit-scrollbar { display: none; }
.pf-reel[data-dragging] { cursor: var(--basis-cursor-grabbing, grabbing); user-select: none; }
.pf-kinds { display: flex; gap: 18px; width: max-content; padding: 0 max(clamp(16px, 4vw, 56px), calc(50% - 564px)); }
/* Looping: no lead-in, and one trailing gap so two sets of cards are exactly twice one set. */
.pf-reel[data-loop] .pf-kinds { padding: 0 18px 0 0; }
.pf-kind { flex: none; width: 344px; display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 22px; border-radius: 24px; background: #ffffff; border: 1px solid var(--line); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.pf-kind:hover { transform: translateY(-4px); border-color: #cfe1ee; box-shadow: 0 22px 50px rgba(23,67,94,.1); }
.pf-kind h3 { margin-top: auto; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.pf-preview { display: flex; flex-direction: column; gap: 12px; min-height: 248px; padding: 18px; border-radius: 18px; background: var(--pale); }
.pf-q { font-size: 16px; font-weight: 600; line-height: 1.5; letter-spacing: -0.015em; }
.pf-blank { display: inline-block; width: 72px; height: 1.1em; margin: 0 6px; transform: translateY(.2em); border-bottom: 2.5px dashed var(--sky); transition: border-color .3s ease; }
.pf-kind:hover .pf-blank { border-bottom-color: var(--deep); }
.pf-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-row .pf-clip { height: 52px; }
.pf-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--mut); }
.pf-slide { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pf-slide b { flex: none; width: 52px; font-weight: 700; }
.pf-slide em { flex: none; width: 24px; text-align: right; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: #d9e7f0; }
.pf-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--ink); }
.pf-track i::after { content: ""; position: absolute; right: -8px; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; border: 2px solid var(--ink); }
.pf-say { padding: 10px 12px; border-radius: 12px; background: #ffffff; border: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.pf-say mark { padding: 0 4px; border-radius: 6px; background: #ffe3a8; color: var(--ink); font-weight: 700; }
.pf-reading { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--mut); }
.pf-reading b { padding: 4px 10px; border-radius: 999px; background: #ffffff; border: 1px solid #d5e4ee; color: var(--ink); }
.pf-timeline { position: relative; display: block; height: 64px; overflow: hidden; border-radius: 12px; background: #ffffff; border: 1px solid var(--line); }
.pf-timeline svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-timeline path { fill: none; stroke: #b9cfde; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pf-timeline i { position: absolute; top: 0; bottom: 0; border-left: 2px solid #c8641a; border-right: 2px solid #c8641a; background: rgba(232,137,58,.2); }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tags span { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 999px; background: #ffffff; border: 1px solid #d5e4ee; font-size: 13px; font-weight: 600; }
.pf-tags .is-on { background: #fff1e4; border-color: #c8641a; color: #7a3606; }
/* several rows, each answered on its own small scale */
.pf-rows { display: flex; flex-direction: column; gap: 6px; }
.pf-crit { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.pf-crit b { flex: none; width: 92px; font-weight: 600; }
.pf-mini { flex: 1; min-width: 0; display: flex; gap: 3px; }
.pf-mini i { flex: 1; min-width: 0; display: grid; place-items: center; height: 28px; border-radius: 8px; background: #ffffff; border: 1px solid #d5e4ee; font-size: 11px; font-weight: 700; font-style: normal; }
.pf-mini .is-on { background: var(--ink); border-color: var(--ink); color: #f2fbff; }
.pf-type { min-height: 76px; padding: 10px 12px; border-radius: 12px; background: #ffffff; border: 1px solid var(--line); font-size: 15px; line-height: 1.55; }
.pf-type i { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: var(--deep); animation: pf-caret 1.1s steps(1) infinite; }
@keyframes pf-caret { 50% { opacity: 0; } }
/* video: a frame with a play button, a length and a little progress, in the page's own blues */
.pf-vid { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; color: #ffffff; }
.pf-vid--wide { flex: none; width: 100%; height: 92px; aspect-ratio: auto; }
.pf-vid--a { background: linear-gradient(140deg, #7fcbf1 0%, #10689f 100%); }
.pf-vid--b { background: linear-gradient(140deg, #a9dcf5 0%, #4fb3e8 100%); }
.pf-vid--c { background: linear-gradient(140deg, #2a6f99 0%, #0f2f44 100%); }
.pf-vid::after { content: ""; position: absolute; left: 0; bottom: 0; width: 38%; height: 3px; background: rgba(255,255,255,.9); }
.pf-vid .pf-play { width: 32px; height: 32px; background: rgba(255,255,255,.94); color: var(--ink); }
.pf-vid b { position: absolute; left: 7px; top: 7px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 13px; font-weight: 700; }
.pf-vid em { position: absolute; right: 7px; bottom: 9px; padding: 2px 6px; border-radius: 6px; background: rgba(15,47,68,.5); font-size: 11px; font-weight: 600; font-style: normal; font-variant-numeric: tabular-nums; }
.pf-film { position: relative; display: flex; gap: 3px; height: 64px; padding: 6px; overflow: hidden; border-radius: 12px; background: #ffffff; border: 1px solid var(--line); }
.pf-film span { flex: 1; min-width: 0; border-radius: 6px; }
.pf-film i { position: absolute; top: 0; bottom: 0; border-left: 2px solid #c8641a; border-right: 2px solid #c8641a; background: rgba(232,137,58,.26); }

/* ---- raters: three pictures of why the answers can be trusted ----------- */
.pf-vet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pf-vet article { display: flex; flex-direction: column; gap: 28px; min-width: 0; overflow: hidden; padding: 30px; border-radius: 28px; background: var(--pale); }
.pf-vet h3 { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; }
/* 1 · the sieve: the same crowd of dots, fewer lit after each check */
.pf-vet .pf-gates { grid-column: 1 / -1; background: var(--night); color: #f2fbff; }
.pf-sieve { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr); align-items: center; margin: 0; padding: 0; list-style: none; }
.pf-sieve li { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pf-sieve b { font-size: 15px; font-weight: 600; color: #a9cfe4; }
.pf-sieve .is-final b { color: #ffffff; }
.pf-sieve .pf-sieve-go { align-items: center; padding-bottom: 32px; color: rgba(255,255,255,.38); }
.pf-dots32 { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.05); }
.pf-dots32 i { aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.1); }
.pf-dots32 .is-on { background: var(--sky-2); animation: pf-twinkle 2.6s ease-in-out infinite; }
.pf-sieve .is-final .pf-dots32 { background: rgba(127,203,241,.14); }
.pf-sieve .is-final .is-on { background: #ffffff; box-shadow: 0 0 0 3px rgba(127,203,241,.4); }
@keyframes pf-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* 2 · the wall of languages, each in its own script */
.pf-native h3 { max-width: 208px; }
.pf-wall { display: flex; flex-direction: column; gap: 12px; margin: auto -30px 0; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); }
.pf-wall-row { display: flex; gap: 10px; width: max-content; animation: pf-wall 52s linear infinite; }
.pf-wall-row--b { animation-direction: reverse; animation-duration: 60s; }
.pf-wall-row--c { animation-duration: 68s; }
.pf-wall-row span { display: inline-flex; align-items: center; height: 54px; padding: 0 22px; border-radius: 999px; background: #ffffff; border: 1px solid #d5e4ee; font-size: 19px; font-weight: 600; white-space: nowrap; }
@keyframes pf-wall { to { transform: translateX(calc(-50% - 5px)); } }
/* 3 · one rater's standing, and the answer that did not make it */
.pf-score { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding: 20px; border-radius: 20px; background: #ffffff; border: 1px solid var(--line); }
.pf-score-head { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.pf-score-head > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-score-head b { font-size: 16px; font-weight: 600; }
.pf-score-head em { font-size: 13px; font-style: normal; color: var(--mut); }
.pf-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, #7fcbf1 0%, #10689f 100%); }
.pf-pass { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: #e2f2fc; color: var(--deep); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pf-meter { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.pf-meter b { flex: none; width: 96px; font-weight: 600; }
.pf-meter > span { flex: 1; height: 8px; overflow: hidden; border-radius: 4px; background: #e3edf4; }
.pf-meter i { display: block; height: 100%; border-radius: 4px; background: var(--deep); }
.pf-answers { display: flex; gap: 5px; padding-top: 6px; }
.pf-answers i { flex: 1; min-width: 0; display: grid; place-items: center; height: 30px; border-radius: 8px; background: var(--tint); color: var(--deep); }
.pf-answers .is-out { background: #fff1e4; color: #c8641a; box-shadow: inset 0 0 0 1.5px #c8641a; }

/* ---- results: two comparisons and the readout a study ends in ---------- */
.pf-res { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 18px; align-items: stretch; }
.pf-res-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pf-vs { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 28px 30px; border-radius: 28px; background: var(--pale); }
.pf-vs h3 { margin-bottom: 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.pf-vs-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; color: var(--mut); }
.pf-vs-row b { font-weight: 600; }
.pf-vs-row > span { height: 12px; }
.pf-vs-row i { display: block; min-width: 12px; height: 100%; border-radius: 6px; background: #c9dbe7; }
.pf-vs-row em { min-width: 58px; text-align: right; font-style: normal; font-weight: 600; }
.pf-vs-row.is-us { color: var(--ink); }
.pf-vs-row.is-us i { background: var(--deep); }
.pf-readout { display: flex; flex-direction: column; gap: 26px; min-width: 0; padding: 30px; border-radius: 28px; background: #ffffff; border: 1px solid var(--line); box-shadow: 0 22px 50px rgba(23,67,94,.08); }
.pf-readout-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pf-readout-head .pf-q { font-size: 22px; letter-spacing: -0.025em; }
.pf-readout-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.pf-dist { display: flex; gap: 10px; min-height: 230px; padding: 22px 20px 14px; border-radius: 20px; background: var(--pale); }
.pf-dist > span { flex: 1; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
.pf-dist i { align-self: end; display: block; min-height: 6px; border-radius: 8px 8px 4px 4px; }
.pf-dist b { text-align: center; font-size: 13px; font-weight: 700; color: var(--mut); }
.pf-splits { display: flex; flex-direction: column; justify-content: center; gap: 14px; min-width: 0; }
.pf-win { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pf-win b { font-size: 28px; font-weight: 600; letter-spacing: -0.035em; }
.pf-win-bar { height: 14px; overflow: hidden; border-radius: 7px; background: var(--deep); }
.pf-win-bar i { display: block; height: 100%; background: #f3b98e; border-right: 3px solid #ffffff; }
.pf-win-ends { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--mut); }
.pf-win-ends em, .pf-split em { font-style: normal; font-variant-numeric: tabular-nums; }
.pf-split { display: grid; grid-template-columns: 72px minmax(0, 1fr) 38px; align-items: center; gap: 12px; font-size: 14px; }
.pf-split b { font-weight: 600; }
.pf-split > span { height: 8px; overflow: hidden; border-radius: 4px; background: #f6d9c2; }
.pf-split i { display: block; height: 100%; margin-left: auto; border-radius: 4px; background: var(--deep); }
.pf-split em { text-align: right; font-weight: 700; }


.pf-close { position: relative; overflow: hidden; margin-top: clamp(80px, 9vw, 128px); padding: clamp(40px, 6vw, 84px) clamp(24px, 5vw, 72px); border-radius: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 32px; background: linear-gradient(160deg, #4fb3e8 0%, #7fcbf1 60%, #a9dcf5 100%); }
.pf-close h2 { max-width: 877px; font-size: clamp(36px, 4.6vw, 62px); color: var(--deep); }
.pf-close h2 span { color: #ffffff; }

/* ---- small screens ------------------------------------------------------- */
@media (max-width: 1040px) {
  .pf-steps { grid-template-columns: minmax(0, 1fr); }
  .pf-arrow { height: 44px; }
  .pf-arrow svg { transform: rotate(90deg); }
  .pf-res { grid-template-columns: minmax(0, 1fr); }
}
/* Below this the API box has no sky beside it: the clips and planes use a band above it instead (app.js, box.tall). */
@media (max-width: 860px) {
  .pf-api { margin-top: 148px; }
}
@media (max-width: 720px) {
  .pf-hero { margin: 8px; border-radius: 26px; }
  .pf-head { padding-top: 112px; gap: 18px; }
  .pf-head p { font-size: 18px; }
  .pf-steps { margin-top: 36px; }
  .pf-step { min-height: 76px; padding: 14px 18px; border-radius: 20px; }
  .pf-arrow { height: 26px; }
  .pf-arrow svg { transform: rotate(90deg) scale(.62); }
  .pf-api { padding: 20px 22px 22px; border-radius: 24px; }
  .pf-api-name { font-size: 18px; }
  .pf-api-stats { gap: 12px; }
  .pf-api-stats dt { font-size: clamp(28px, 9.4vw, 40px); }
  .pf-api-cta .pf-btn { height: 44px; padding: 0 10px; font-size: 14px; }
  .pf-api-cta .pf-btn:first-child { flex: 1.5; }
  .pf-vet, .pf-readout-body { grid-template-columns: minmax(0, 1fr); }
  .pf-vet article, .pf-readout { padding: 22px; border-radius: 24px; }
  .pf-vs { padding: 22px; border-radius: 24px; }
  .pf-wall { margin: auto -22px 0; gap: 10px; }
  .pf-wall-row span { height: 46px; padding: 0 18px; font-size: 17px; }
  .pf-sieve { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .pf-sieve .pf-sieve-go { display: none; }
  .pf-dots32 { gap: 6px; padding: 14px; }
  .pf-dist { min-height: 190px; }
  .pf-vs-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
  .pf-kind { width: 300px; padding: 18px; }
  .pf-preview { padding: 14px; }
  .pf-crit b { width: 86px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-cloud, .pf-dash, .pf-glyph--dots i, .pf-type i, .pf-dots32 .is-on, .pf-wall-row { animation: none; }
  .pf-step, .pf-kind, .pf-btn { transition: none; }
}

/* ---- Create an account: the request form and its receipt ---------------- */
.pf-su { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.pf-su[hidden] { display: none; }
.pf-su-open { overflow: hidden; }
.pf-su-back { position: absolute; inset: 0; background: rgba(15,47,68,.46); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: pf-su-fade .25s ease; }
.pf-su-panel { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 28px; background: #ffffff; box-shadow: 0 40px 100px rgba(8,40,62,.36); animation: pf-su-in .38s cubic-bezier(.2, .9, .3, 1.08); }
.pf-su-sky { display: flex; align-items: flex-end; height: 104px; padding: 0 28px 22px; color: #ffffff; background: linear-gradient(176deg, #4fb3e8 0%, #62bcec 40%, #9ad6f5 100%); }
.pf-su-x { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.3); color: #ffffff; cursor: var(--basis-cursor-pointer, pointer); transition: background .2s ease; }
.pf-su-x:hover { background: rgba(255,255,255,.5); }
.pf-su-form, .pf-su-done { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px 28px; }
.pf-su-form[hidden], .pf-su-done[hidden] { display: none; }
.pf-su h2 { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.035em; color: var(--ink); }
.pf-su-form h2 { margin-bottom: 4px; }
.pf-su label { display: flex; flex-direction: column; gap: 6px; }
.pf-su label span { font-size: 13px; font-weight: 600; color: var(--mut); }
.pf-su input, .pf-su textarea { width: 100%; padding: 0 14px; border: 1px solid #d5e4ee; border-radius: 14px; background: var(--pale); color: var(--ink); font: inherit; font-size: 16px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.pf-su input { height: 48px; }
.pf-su textarea { min-height: 76px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.pf-su input:focus, .pf-su textarea:focus { outline: none; border-color: var(--deep); background: #ffffff; box-shadow: 0 0 0 4px rgba(79,179,232,.22); }
.pf-su input[aria-invalid="true"] { border-color: #c8641a; box-shadow: 0 0 0 4px rgba(200,100,26,.14); }
.pf-su .pf-su-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pf-su-status { font-size: 14px; line-height: 1.4; color: #a34e10; }
.pf-su-status[hidden] { display: none; }
.pf-su-submit { justify-content: center; width: 100%; margin-top: 6px; border: 0; font: inherit; font-size: 16px; font-weight: 600; }
.pf-su-submit:disabled { opacity: .7; cursor: default; transform: none; box-shadow: none; }
.pf-su-done { align-items: center; padding-top: 34px; text-align: center; }
.pf-su-done h2 { max-width: 19ch; font-size: 26px; text-wrap: balance; }
.pf-su-done h2:focus { outline: none; }
.pf-su-done p { font-size: 17px; line-height: 1.45; color: var(--mut); }
.pf-su-done .pf-btn { justify-content: center; min-width: 140px; margin-top: 10px; border: 0; font: inherit; font-size: 16px; font-weight: 600; }
.pf-su-check { width: 76px; height: 76px; margin-bottom: 6px; }
.pf-su-check circle, .pf-su-check path { fill: none; stroke: var(--deep); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pf-su-check circle { stroke-dasharray: 164; stroke-dashoffset: 164; animation: pf-su-draw .6s ease forwards .1s; }
.pf-su-check path { stroke-dasharray: 34; stroke-dashoffset: 34; animation: pf-su-draw .34s ease forwards .62s; }
@keyframes pf-su-draw { to { stroke-dashoffset: 0; } }
@keyframes pf-su-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pf-su-fade { from { opacity: 0; } }
@media (max-width: 480px) {
  .pf-su-sky { height: 88px; padding: 0 22px 18px; }
  .pf-su-form, .pf-su-done { padding: 22px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-su-back, .pf-su-panel { animation: none; }
  .pf-su-check circle, .pf-su-check path { animation: none; stroke-dashoffset: 0; }
}

/* ==== Dark theme =========================================================
   The site-wide choice (html[data-theme="dark"], set by /basis-theme.js). The page's tokens flip here, and the
   rules below repaint what was written as a literal white, or as "ink used as a fill": in the dark, ink is the
   TEXT colour, so every solid button and selected control takes the light fill with dark text instead. */
[data-theme="dark"] .pf {
  --ink: #e9f1f7; --deep: #6cc0f2; --mut: #94aab9; --line: #22384a; --pale: #0d1a25; --tint: #16293a; --night: #16324a;
  --bg: #0b161e; --d-card: #122230; --d-chip: #182c3d; --d-edge: #2c465a; --d-fill: #dceefa; --d-on: #0b1b26;
  color-scheme: dark;
}
/* solid fills */
[data-theme="dark"] :is(.pf-btn, .pf-login, .pf-menu-login, .pf-num, .pf-play, .pf-cell.is-on, .pf-mini .is-on, .pf-clip.is-picked) { background: var(--d-fill); border-color: var(--d-fill); color: var(--d-on); }
/* (.pf-btn.pf-btn--soft: the fill rule above carries :is()'s two-class weight, so the soft button needs the same) */
[data-theme="dark"] .pf-btn.pf-btn--soft { background: #1c3348; border-color: #1c3348; color: var(--ink); }
[data-theme="dark"] .pf-btn:hover { box-shadow: 0 12px 26px rgba(0,0,0,.35); }
[data-theme="dark"] .pf-step--ink .pf-num, [data-theme="dark"] .pf-clip.is-picked .pf-play { background: var(--sky-2); color: var(--d-on); }
[data-theme="dark"] .pf-clip.is-ref .pf-play { background: var(--mut); }
[data-theme="dark"] .pf-track i { background: var(--d-fill); }
[data-theme="dark"] .pf-track i::after { background: var(--d-card); border-color: var(--d-fill); }
[data-theme="dark"] .pf-glyph--blocks i { background: var(--d-edge); }
[data-theme="dark"] .pf-glyph--blocks i + i { background: var(--d-fill); }
/* nav */
[data-theme="dark"] .pf-nav { background: rgba(18,34,48,.82); border-color: rgba(255,255,255,.16); box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.1); }
[data-theme="dark"] .pf-brand .basis-logo-mark { background-image: var(--basis-mark-white); }
[data-theme="dark"] :is(.pf-link, .pf-burger, .pf-theme):hover { background: rgba(255,255,255,.12); }
[data-theme="dark"] .pf-menu { background: rgba(18,34,48,.96); border-color: rgba(207,232,250,.22); box-shadow: 0 18px 48px rgba(0,0,0,.45); }
/* hero: the same sky at night */
[data-theme="dark"] .pf-hero, [data-theme="dark"] .pf-su-sky { background: linear-gradient(176deg, #16324a 0%, #1d4364 42%, #244b68 100%); }
[data-theme="dark"] .pf-close { background: linear-gradient(160deg, #16324a 0%, #1d4364 60%, #244b68 100%); }
[data-theme="dark"] .pf-sun { opacity: .22; }
/* night clouds: app.js repaints them in the sky's blue (no filter — a dimmed white cloud turns grey), kept faint */
[data-theme="dark"] .pf-cloud--top[data-ready] { opacity: .2; }
[data-theme="dark"] .pf-cloud--1[data-ready] { opacity: .42; }
[data-theme="dark"] .pf-cloud--2[data-ready] { opacity: .5; }
[data-theme="dark"] .pf-cloud--3[data-ready] { opacity: .58; }
[data-theme="dark"] .pf-step { box-shadow: 0 14px 40px rgba(0,0,0,.3); }
/* surfaces: cards, then the controls that sit on them */
[data-theme="dark"] :is(.pf-api, .pf-step, .pf-kind, .pf-readout, .pf-su-panel, .pf-vet article, .pf-vs) { background: var(--d-card); }
[data-theme="dark"] .pf-step--ink, [data-theme="dark"] .pf-vet .pf-gates { background: var(--night); }
[data-theme="dark"] :is(.pf-api, .pf-readout, .pf-su-panel) { box-shadow: 0 26px 70px rgba(0,0,0,.4); }
[data-theme="dark"] :is(.pf-clip, .pf-cell, .pf-say, .pf-reading b, .pf-timeline, .pf-tags span, .pf-mini i, .pf-type, .pf-film, .pf-wall-row span, .pf-score) { background: var(--d-chip); border-color: var(--d-edge); }
[data-theme="dark"] .pf-clip.is-ref { background: transparent; }
[data-theme="dark"] .pf-kind:hover { border-color: #3b566b; box-shadow: 0 22px 50px rgba(0,0,0,.35); }
[data-theme="dark"] .pf-wave path { stroke: #3b566b; }
[data-theme="dark"] .pf-timeline path { stroke: #46627a; }
[data-theme="dark"] .pf-track { background: var(--d-edge); }
[data-theme="dark"] .pf-meter > span { background: var(--line); }
[data-theme="dark"] .pf-vs-row i { background: #3b566b; }
[data-theme="dark"] .pf-vs-row.is-us i { background: var(--deep); }
[data-theme="dark"] .pf-pass { background: rgba(108,192,242,.16); }
[data-theme="dark"] .pf-tags .is-on, [data-theme="dark"] .pf-answers .is-out { background: rgba(200,100,26,.22); border-color: #c8641a; color: #f3b98e; }
[data-theme="dark"] .pf-split > span { background: #a8724e; }
[data-theme="dark"] .pf-win-bar i { border-right-color: var(--d-card); }
/* pieces that stay a light chip in both themes keep dark text */
[data-theme="dark"] .pf-say mark, [data-theme="dark"] .pf-vid b { color: #17435e; }
/* the account dialog */
[data-theme="dark"] .pf-su input, [data-theme="dark"] .pf-su textarea { border-color: var(--d-edge); }
[data-theme="dark"] .pf-su input:focus, [data-theme="dark"] .pf-su textarea:focus { background: var(--tint); box-shadow: 0 0 0 4px rgba(108,192,242,.2); }
[data-theme="dark"] .pf-su-status { color: #f3b98e; }
