/* Card Wise — design system for the website
   Tokens come straight from the app's design.md (FinCard-App/artifacts/fincard/design.md):
   white canvas, Rausch as the single accent, ink type, Inter at modest weights,
   soft radii (8 / 14 / 20 / 32 / full) and one shadow tier. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Variable.woff2") format("woff2-variations"), url("/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colors.* */
  --primary: #ff385c;
  --primary-active: #e00b41;
  --primary-disabled: #ffd1da;
  --error: #c13515;
  --ink: #222222;
  --body: #3f3f3f;
  --muted: #6a6a6a;
  --muted-soft: #929292;
  --hairline: #dddddd;
  --hairline-soft: #ebebeb;
  --border-strong: #c1c1c1;
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #f2f2f2;
  /* the "you save" green used inside the Card Wise app */
  --saved: #0a8f5a;
  --saved-text: #0b7a4d;
  --saved-tint: #e8f6ef;

  /* rounded.* */
  --r-xs: 4px; --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 32px; --r-full: 9999px;
  /* the single elevation tier */
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0, rgba(0, 0, 0, 0.1) 0 4px 8px 0;

  --font: "Inter", "Airbnb Cereal VF", Circular, -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif;
  --gutter: clamp(24px, 4vw, 40px);
  --max: 1280px;
  --nav-h: 80px;
  --section: clamp(64px, 8vw, 112px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.3, 0.5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.motion { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  font-optical-sizing: auto;
  font-feature-settings: "cv11" 1, "ss01" 0;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--primary-disabled); }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; font-weight: 500; }
.skip:focus { top: 12px; }

/* ── Type (Inter; display weights stay at 600) ───────────────────── */
.d-xl, .d-l, .d-m { font-weight: 600; color: var(--ink); text-wrap: balance; }
.d-xl { font-size: clamp(40px, 5.1vw, 68px); line-height: 1.04; letter-spacing: -0.032em; }
.d-l { font-size: clamp(32px, 3.7vw, 48px); line-height: 1.08; letter-spacing: -0.026em; }
.d-m { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.18; letter-spacing: -0.02em; }
.d-s { font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -0.18px; color: var(--ink); }
.lede { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; color: var(--body); max-width: 34em; text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.43; }
.num { font-variant-numeric: tabular-nums; }

/* ── Buttons (components.button-*) ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 14px 24px; border: 0; border-radius: var(--r-sm);
  font: 500 16px/1.25 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #f5294f; }
.btn-primary:active { background: var(--primary-active); }
.btn-secondary { background: var(--canvas); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-secondary:hover { background: var(--surface-soft); }
.btn-pill { border-radius: var(--r-full); min-height: 40px; padding: 10px 20px; font-size: 14px; line-height: 1.29; }

/* App store buttons: secondary by default; the visitor's own platform gets the Rausch fill */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 164px; min-height: 56px; padding: 8px 20px 9px; border-radius: var(--r-sm);
  background: var(--canvas); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink);
  text-decoration: none; transition: background-color 0.2s, transform 0.2s;
}
.store small { font-size: 12px; line-height: 1.2; font-weight: 400; color: var(--muted); }
.store strong { font-size: 17px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.store:hover { background: var(--surface-soft); }
.store:active { transform: scale(0.98); }
.store.is-primary { background: var(--primary); color: #fff; box-shadow: none; }
.store.is-primary small { color: rgba(255, 255, 255, 0.82); }
.store.is-primary:hover { background: #f5294f; }
.store.is-primary:active { background: var(--primary-active); }

.textlink { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s; }
.textlink:hover { color: var(--primary); }
.brandlink { color: var(--primary); font-weight: 500; text-decoration: none; }
.brandlink:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Top navigation (components.top-nav) ─────────────────────────── */
.cw-nav { position: sticky; top: 0; z-index: 50; background: var(--canvas); border-bottom: 1px solid var(--hairline-soft); transition: transform 0.45s var(--ease-out); }
.cw-nav.is-hidden { transform: translateY(-100%); }
.cw-nav-bar { max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); height: var(--nav-h); display: flex; align-items: center; gap: 16px; }
.cw-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); font-weight: 650; font-size: 20px; letter-spacing: -0.02em; margin-right: auto; }
.cw-brand img { width: 39px; height: 32px; object-fit: contain; }
.cw-nav-links { display: flex; align-items: center; gap: 4px; }
.cw-nav-links a { position: relative; text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--muted); padding: 10px 12px; border-radius: var(--r-full); transition: color 0.2s, background-color 0.2s; }
.cw-nav-links a:hover { color: var(--ink); background: var(--surface-soft); }
.cw-nav-links a[aria-current="page"] { color: var(--ink); }
.cw-nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -19px; height: 2px; background: var(--ink); border-radius: 2px; }
.cw-nav-cta { margin-left: 8px; }
.cw-menu-btn { display: none; width: 44px; height: 44px; border: 0; background: var(--surface-strong); border-radius: var(--r-full); cursor: pointer; position: relative; }
.cw-menu-btn span { position: absolute; left: 14px; right: 14px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out); }
.cw-menu-btn span:nth-child(1) { top: 18px; }
.cw-menu-btn span:nth-child(2) { top: 24px; }
.cw-menu-btn[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.cw-menu-btn[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }
.cw-sheet {
  position: fixed; left: 0; right: 0; top: var(--nav-h); bottom: 0; z-index: 49;
  background: var(--canvas); padding: 16px var(--gutter) 32px;
  display: flex; flex-direction: column; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s linear 0.3s;
}
.cw-sheet a.cw-sheet-link { text-decoration: none; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; padding: 14px 0; border-bottom: 1px solid var(--hairline-soft); color: var(--ink); }
.cw-sheet .cw-sheet-foot { margin-top: auto; padding-top: 28px; }
.cw-nav.is-open .cw-sheet { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out); }
@media (max-width: 960px) {
  .cw-nav-links { display: none; }
  .cw-menu-btn { display: inline-block; }
  .cw-nav-cta { margin-left: 0; }
}
@media (max-width: 743px) { :root { --nav-h: 68px; } .cw-sheet a.cw-sheet-link { font-size: 22px; } }
@media (max-width: 360px) { .cw-nav-cta { display: none; } }

/* ── Footer (components.footer-light + legal-band) ──────────────── */
.cw-foot { background: var(--canvas); border-top: 1px solid var(--hairline); padding: 48px 0 0; font-size: 14px; line-height: 1.43; color: var(--ink); }
.cw-foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px 24px; padding-bottom: 40px; }
.cw-foot .cw-brand { margin: 0 0 12px; }
.cw-foot p { color: var(--muted); max-width: 28em; }
.cw-foot h2 { font-size: 16px; font-weight: 500; line-height: 1.25; color: var(--ink); margin-bottom: 14px; }
.cw-foot nav { display: grid; gap: 12px; align-content: start; }
.cw-foot nav a { text-decoration: none; color: var(--ink); }
.cw-foot nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cw-foot-base { border-top: 1px solid var(--hairline); padding: 22px 0 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 13px; line-height: 1.23; color: var(--muted); }
.cw-foot-base a { color: var(--muted); }
.cw-foot-base p { max-width: none; }
@media (max-width: 860px) { .cw-foot-grid { grid-template-columns: 1fr 1fr; } .cw-foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .cw-foot-grid { grid-template-columns: 1fr; } }

/* ── iPhone (CSS) — product imagery where a live 3D phone isn't needed
   Proportions follow iPhone 15/16 Pro: 70.6 × 146.6 mm, 12 mm corners. */
.iphone { --w: 280px; position: relative; width: var(--w); aspect-ratio: 70.6 / 146.6; flex: none; }
.iphone-body {
  position: absolute; inset: 0; border-radius: calc(var(--w) * 0.17);
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 1.2%, rgba(255,255,255,0) 2.6%, rgba(255,255,255,0) 97.4%, rgba(255,255,255,0.5) 98.8%, rgba(255,255,255,0) 100%),
    linear-gradient(160deg, #e9e5df 0%, #a7a29a 22%, #e4e0d9 44%, #96918a 66%, #d6d2cb 86%, #aaa59d 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 44px 60px -40px rgba(0, 0, 0, 0.32), 0 20px 30px -22px rgba(0, 0, 0, 0.2);
}
.iphone-body::before { content: ""; position: absolute; inset: calc(var(--w) * 0.0125); border-radius: calc(var(--w) * 0.158); background: #050505; }
.iphone-screen { position: absolute; inset: calc(var(--w) * 0.039); border-radius: calc(var(--w) * 0.131); overflow: hidden; background: #fff; isolation: isolate; transform: translateZ(0); }
.iphone-screen > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.iphone-screen > img.iphone-status { inset: 0 0 auto 0; height: auto; object-fit: initial; z-index: 2; }
.iphone-screen::before { content: ""; position: absolute; z-index: 3; top: 1.28%; left: 50%; width: 32.1%; height: 4.4%; transform: translateX(-50%); border-radius: 999px; background: #000; }
.iphone-screen::after { content: ""; position: absolute; z-index: 3; bottom: 0.95%; left: 50%; width: 34%; height: 0.6%; transform: translateX(-50%); border-radius: 999px; background: rgba(0, 0, 0, 0.82); }
.iphone::before, .iphone::after { content: ""; position: absolute; width: calc(var(--w) * 0.012); border-radius: 3px; background: linear-gradient(90deg, #96918a, #dcd8d1); }
.iphone::before { left: calc(var(--w) * -0.009); top: 29.5%; height: 7.4%; }
.iphone::after { right: calc(var(--w) * -0.009); top: 26%; height: 11.7%; }
.iphone-glare { position: absolute; inset: calc(var(--w) * 0.039); border-radius: calc(var(--w) * 0.131); z-index: 4; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0) 48%); }
.iphone-screen .scr { opacity: 0; transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-out); transform: translateY(2%); }
.iphone-screen .scr.is-on { opacity: 1; transform: none; }

/* ── Founder "member cards" (brand colours, logo swoosh) ────────── */
.mcard { position: relative; width: min(100%, 440px); aspect-ratio: 85.6 / 53.98; perspective: 1000px; }
.mcard-face { position: absolute; inset: 0; border-radius: 4.2% / 6.6%; overflow: hidden; color: #fff;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.6s var(--ease-out);
  box-shadow: 0 40px 60px -36px rgba(0, 0, 0, 0.45), 0 16px 24px -18px rgba(0, 0, 0, 0.28); }
.mcard.is-tilting .mcard-face { transition: transform 0.12s linear; }
.mcard-rausch .mcard-face { background: var(--primary); }
.mcard-ink .mcard-face { background: var(--ink); }
.mcard-swoosh { position: absolute; inset: 0; width: 100%; height: 100%; }
.mcard-brand { position: absolute; left: 7.5%; top: 11%; display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: clamp(14px, 1.4vw, 16px); letter-spacing: -0.01em; }
.mcard-chip { position: absolute; left: 7.5%; top: 36%; width: 12%; aspect-ratio: 1.3; border-radius: 12% / 16%; background: #e6c77d; box-shadow: inset 0 0 0 1px rgba(90, 64, 20, 0.35); }
.mcard-chip::before { content: ""; position: absolute; inset: 22% 36%; border-left: 1px solid rgba(90, 64, 20, 0.45); border-right: 1px solid rgba(90, 64, 20, 0.45); }
.mcard-name { position: absolute; left: 7.5%; bottom: 23%; font-size: clamp(16px, 2vw, 22px); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18), 0 -1px 0 rgba(0, 0, 0, 0.3); }
.mcard-role { position: absolute; left: 7.5%; bottom: 11%; font-size: clamp(10.5px, 1vw, 12px); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.78; }
.mcard-since { position: absolute; right: 7.5%; bottom: 11%; font-size: clamp(10.5px, 1vw, 12px); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
.mcard-shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 25%) var(--my, 15%), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 46%); mix-blend-mode: soft-light; }

/* ── Reveal (headings and a few blocks only) ─────────────────────── */
html.motion .rise { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out); }
html.motion .rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
