/* Shared by the plain HTML site pages (not the web app).
 *
 * Every colour here is one of the app's colours in src/theme/colors.ts:
 * src/theme/colors.test.ts fails if this file uses any other. Teal is the
 * brand; amber is for small accents only, always with dark text on it; red and
 * green only mean "price up" and "cheaper", as in the app. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-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 {
  /* colors.brand */
  --teal: #0B4F4A;
  --teal-light: #147868;
  --on-teal: #FFFFFF;
  --on-teal-muted: #CDE7E2;
  /* colors.accent */
  --amber: #F7B538;
  --on-amber: #0F172A;
  --amber-tint: #FEF3D6;
  /* colors.tint */
  --tint: #E8F3F1;
  --tint-border: #B8DAD4;
  --tint-selected: #CDE7E2;
  /* colors.surface and colors.border */
  --background: #FFFFFF;
  --subtle: #F8FAFC;
  --muted-bg: #F1F5F9;
  --border: #E2E8F0;
  /* colors.text */
  --text: #0F172A;
  --body: #334155;
  --secondary: #475569;
  --muted: #64748B;
  /* colors.danger and colors.success: price up and cheaper */
  --red: #B91C1C;
  --red-tint: #FEF2F2;
  --red-border: #FECACA;
  --green: #15803D;
  --green-strong: #166534;
  --green-tint: #F0FDF4;
  --green-border: #BBF7D0;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.28);
  --radius: 20px;
  --radius-sm: 12px;
  --page: 1120px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--background);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  /* Keeps the footer at the bottom of short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-light);
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(32px, 6vw, 44px);
  margin: 0 0 16px;
}

h2 {
  font-size: clamp(26px, 4.4vw, 38px);
  margin: 0 0 16px;
}

h3 {
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--on-teal);
  border-radius: 8px;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
  color: var(--on-teal);
}

/* A message at the top of the page, such as "Your account … has been
   deleted" (see site.js). */
.notice {
  background: var(--tint);
  border-bottom: 1px solid var(--tint-border);
  color: var(--text);
}

.notice:focus {
  outline: none;
}

.notice-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.notice p {
  flex: 1;
  margin: 0;
  font-weight: 600;
}

.notice-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.notice-close:hover {
  background: var(--tint-selected);
}

.notice-close:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.container {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.bar {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a:not(.button) {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:not(.button):hover,
.site-nav a[aria-current='page'] {
  color: var(--teal);
  background: var(--tint);
}

.header-actions {
  display: inline-flex;
  flex-shrink: 0;
  gap: 8px;
  margin-left: 8px;
}

/* Log in and Sign up need about 364px beside the logo, so narrower phones
   (360px Android phones and smaller) show Log in only; Sign up is in the hero
   just below. */
@media (max-width: 369px) {
  .site-nav .header-signup {
    display: none;
  }
}

@media (min-width: 860px) {
  .site-nav a:not(.button) {
    display: inline-block;
  }
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Signed-in and signed-out buttons: the one not in use is hidden, even
   though .button and .actions set their own display. */
[hidden] {
  display: none !important;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--teal);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.small {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 15px;
}

.button.primary {
  background: var(--teal);
  color: var(--on-teal);
}

.button.primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: var(--on-teal);
}

.button.secondary {
  background: var(--background);
  color: var(--teal);
}

.button.secondary:hover {
  background: var(--tint);
  color: var(--teal);
}

/* Teal sections: white buttons and amber focus rings, so both stand out. */

.on-teal :focus-visible {
  outline-color: var(--amber);
}

.on-teal a:not(.button) {
  color: var(--on-teal);
}

.on-teal .button.primary {
  background: var(--on-teal);
  border-color: var(--on-teal);
  color: var(--teal);
}

.on-teal .button.primary:hover {
  background: var(--tint-selected);
  border-color: var(--tint-selected);
  color: var(--teal);
}

.on-teal .button.secondary {
  background: transparent;
  border-color: var(--on-teal-muted);
  color: var(--on-teal);
}

.on-teal .button.secondary:hover {
  background: var(--teal-light);
  color: var(--on-teal);
}

/* "Coming soon to the App Store and Google Play", from site-config.mjs. */

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  padding: 8px 16px;
  border-radius: 18px;
  background: var(--amber);
  color: var(--on-amber);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.coming-soon::before {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--on-amber);
}

.coming-soon + .actions {
  margin-top: 16px;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--teal);
  color: var(--on-teal-muted);
}

.hero::before {
  content: '';
  position: absolute;
  width: 720px;
  height: 720px;
  right: -260px;
  top: -320px;
  border-radius: 50%;
  background: var(--teal-light);
  opacity: 0.55;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 64px;
}

.hero h1 {
  color: var(--on-teal);
  font-size: clamp(40px, 9vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero .lead {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.55;
  max-width: 34em;
  margin: 0;
}

.hero .free-note {
  margin: 16px 0 0;
  font-size: 15px;
}

.hero-copy {
  animation: rise 0.7s ease-out both;
}

.hero-phone {
  animation: rise 0.9s 0.15s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    padding-top: 88px;
    padding-bottom: 96px;
  }
}

/* Phone mock-up: a frame around a screenshot (or the placeholder for one). */

.phone {
  position: relative;
  width: min(300px, 68vw);
  aspect-ratio: 1170 / 2532;
  margin: 0 auto;
  padding: 12px;
  border-radius: 48px;
  background: var(--text);
  box-shadow: var(--shadow-lg);
}

.phone::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: 999px;
  background: var(--text);
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 37px;
  overflow: hidden;
  background: var(--background);
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: var(--tint);
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.45;
}

.screenshot-placeholder img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.screenshot-placeholder strong {
  color: var(--teal);
  font-size: 16px;
}

/* Sections */

.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  .section {
    padding: 112px 0;
  }
}

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head p {
  font-size: 18px;
  color: var(--secondary);
  margin: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--teal-light);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid.four {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card p {
  margin: 0;
  color: var(--secondary);
  font-size: 16px;
}

.card .icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--tint);
  color: var(--teal);
}

.card .icon svg {
  width: 24px;
  height: 24px;
}

.card.highlight {
  background: var(--amber-tint);
  border-color: var(--amber);
}

.card.highlight .icon {
  background: var(--amber);
  color: var(--on-amber);
}

/* The problem: a bank statement line next to the receipt behind it. */

.split {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.split-copy p {
  font-size: 18px;
  color: var(--secondary);
}

.compare {
  display: grid;
  gap: 16px;
}

.compare-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.statement-row,
.receipt {
  border-radius: var(--radius-sm);
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.statement-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 15px;
  color: var(--text);
}

.receipt {
  padding: 8px 20px 16px;
  border-color: var(--tint-border);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
}

.receipt ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.receipt li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.receipt li:last-child {
  border-bottom: 0;
}

.receipt .item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--text);
}

.receipt .more {
  color: var(--muted);
  font-size: 14px;
}

.example-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.badge.up {
  color: var(--red);
  background: var(--red-tint);
  border-color: var(--red-border);
}

.badge.promo {
  color: var(--teal);
  background: var(--tint);
  border-color: var(--tint-border);
}

.badge.cheaper {
  color: var(--green-strong);
  background: var(--green-tint);
  border-color: var(--green-border);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* How it works */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  position: relative;
}

.step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 700;
  font-size: 18px;
}

/* Privacy and trust */

.trust {
  background: var(--tint);
  border-top: 1px solid var(--tint-border);
  border-bottom: 1px solid var(--tint-border);
}

.trust .card {
  border-color: var(--tint-border);
}

.trust .card .icon {
  background: var(--teal);
  color: var(--on-teal);
}

.trust-more {
  margin: 32px 0 0;
  text-align: center;
  color: var(--secondary);
}

/* Vision and About */

.vision {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.vision .vision-statement {
  margin: 0 0 40px;
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}

.vision .vision-statement::before {
  content: '';
  display: block;
  width: 56px;
  height: 6px;
  margin: 0 auto 28px;
  border-radius: 999px;
  background: var(--amber);
}

.founder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.founder strong {
  color: var(--text);
  font-size: 18px;
}

.founder span {
  color: var(--secondary);
}

.about-text {
  max-width: 640px;
  margin: 24px auto 0;
  color: var(--secondary);
}

/* FAQ */

.faq {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.faq details {
  border-radius: var(--radius-sm);
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.faq summary {
  position: relative;
  display: block;
  padding: 20px 56px 20px 24px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  position: absolute;
  right: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(225deg);
  margin-top: -2px;
}

.faq summary:hover {
  color: var(--teal);
}

.faq .answer {
  padding: 0 24px 20px;
  color: var(--secondary);
}

.faq .answer p {
  margin: 0;
}

.faq .answer p + p {
  margin-top: 10px;
}

/* Closing call to action */

.cta-box .coming-soon {
  margin-top: 28px;
}

.cta-box {
  position: relative;
  overflow: hidden;
  padding: 56px 28px;
  border-radius: 28px;
  background: var(--teal);
  color: var(--on-teal-muted);
  text-align: center;
}

.cta-box::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  left: -160px;
  bottom: -260px;
  border-radius: 50%;
  background: var(--teal-light);
  opacity: 0.6;
}

.cta-box > * {
  position: relative;
}

.cta-box h2 {
  color: var(--on-teal);
}

.cta-box p {
  margin: 0 auto;
  max-width: 32em;
  font-size: 18px;
}

.cta-box .actions {
  justify-content: center;
}

/* Legal pages and the 404 page */

.document {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.document h1 {
  margin-bottom: 8px;
}

.document h2 {
  font-size: 23px;
  margin: 40px 0 8px;
  letter-spacing: -0.01em;
}

.document h3 {
  font-size: 18px;
  margin: 28px 0 4px;
}

.document ul {
  padding-left: 22px;
}

.document li + li {
  margin-top: 6px;
}

/* Footer */

.site-footer {
  background: var(--text);
  color: var(--on-teal-muted);
  font-size: 15px;
}

.site-footer :focus-visible {
  outline-color: var(--amber);
}

.footer-grid {
  display: grid;
  gap: 32px;
  padding-top: 56px;
  padding-bottom: 32px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer .brand {
  color: var(--on-teal);
}

.site-footer .brand:hover {
  color: var(--on-teal);
}

.footer-tagline {
  margin: 12px 0 0;
  max-width: 26em;
}

.site-footer h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-teal);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a {
  color: var(--on-teal-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--on-teal);
  text-decoration: underline;
}

.company {
  margin: 0;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--body);
  font-size: 14px;
  color: var(--on-teal-muted);
}

/* Fade in as each section scrolls into view. site.js adds .js-reveal to the
   page only when the visitor hasn't asked for reduced motion, so without
   JavaScript everything is simply shown. */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .button:hover,
  .card:hover {
    transform: none;
  }
}

@media (max-width: 479px) {
  .hero .actions .button,
  .cta-box .actions .button {
    flex: 1 1 100%;
  }

  .card {
    padding: 24px;
  }
}
