/* Expentrac landing page — shared stylesheet (en + zh-Hant)
   Palette: one interactive blue, warm paper canvas, decorative apricot/green only. */

:root {
  --blue: #2878d8;          /* brand / interactive */
  --blue-deep: #1e5fb0;     /* hover */
  --blue-text: #1d66c2;     /* small blue text (AA on paper) */
  --blue-ghost: rgba(40, 120, 216, 0.16);
  --ink: #14263f;
  --slate: #56677d;
  --paper: #fbf8f3;
  --wash: #eaf2fc;
  --card: #ffffff;
  --line: #e4e2db;
  --line-wash: #dfe7f0;
  --apricot: #ed8a63;       /* decorative only */
  --leaf: #2f9e6e;          /* decorative only */
  --shadow-card: 0 1px 2px rgba(20, 38, 63, 0.06), 0 12px 32px rgba(20, 38, 63, 0.1);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang TC", "Noto Sans TC", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: var(--blue-text);
}

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Nav ---------- */

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo img {
  display: block;
  height: 24px;
  width: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(0.875rem, 3vw, 1.5rem);
}

.lang-switch {
  display: inline-flex;
  background: #eef0f4;
  border-radius: 999px;
  padding: 3px;
}

.lang-switch a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  line-height: 1.5;
}

.lang-switch a[aria-current] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 38, 63, 0.15);
}

.nav-login {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate);
  text-decoration: none;
}

.nav-login:hover {
  color: var(--ink);
}

/* ---------- Kickers & headings ---------- */

.kicker {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-text);
  margin-bottom: 0.75rem;
}

.section-h {
  font-size: clamp(1.5rem, 4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

.hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.hero-sub {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--slate);
  max-width: 34rem;
}

.hero-cta {
  margin-top: 2rem;
}

.store-badge {
  display: inline-block;
  border-radius: 8px;
}

.store-badge img {
  display: block;
  height: 52px;
  width: auto;
}

.badge-micro {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

.trust-pills {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-pills li {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

.hero-visual {
  position: relative;
  /* keep the phone's sheared bottom edge flush with the section edge
     when the copy column is the taller one (761-900px band) */
  align-self: end;
}

.phone-crop {
  position: relative;
  height: clamp(420px, 44vw, 600px);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.phone-wrap {
  position: relative;
  width: min(380px, 84%);
}

.phone-img {
  width: 100%;
  height: auto;
}

/* ---------- Receipt-tear divider ---------- */

.tear {
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--line) 0,
    var(--line) 8px,
    transparent 8px,
    transparent 16px
  );
}

/* ---------- Shared-ledger spotlight ---------- */

.spotlight {
  background: var(--wash);
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: 38rem;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding-block: 16px;
}

.steps li + li {
  border-top: 1px dashed var(--line-wash);
}

.step-num {
  width: 30px;
  height: 30px;
  border: 1px solid var(--blue);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue-text);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.steps h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.steps p {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--slate);
}

/* ---------- Features ledger ---------- */

.features {
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.features-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

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

.lrow {
  display: grid;
  grid-template-columns: 76px 44px 1fr;
  gap: 20px;
  align-items: start;
  padding-block: 28px;
  border-top: 1px solid var(--line);
}

.ledger .lrow:last-child {
  border-bottom: 1px solid var(--line);
}

.lnum {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--blue-ghost);
  font-variant-numeric: tabular-nums;
}

.licon {
  color: var(--blue);
  margin-top: 2px;
}

.licon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.lrow h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.lrow p {
  margin-top: 6px;
  color: var(--slate);
  font-size: 0.9688rem;
  max-width: 56ch;
}

/* Budget detail crop — a real window into the screenshot's budget card.
   Pixel anchor (750x1530 hero image): card spans x 9.2%..90.8%, y 27.2%..41.5%.
   Re-tune if images/hero-*.png are ever replaced. */
.crop {
  position: relative;
  margin-top: 18px;
  max-width: 540px;
  aspect-ratio: 2.81 / 1;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line-wash);
  box-shadow: var(--shadow-card);
  background: #eef1f6;
}

.crop img {
  position: absolute;
  width: 122.5%;
  max-width: none;
  height: auto;
  left: -11.3%;
  top: 0;
  transform: translateY(-27.2%);
}

/* ---------- Use cases ---------- */

.usecases {
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.usecase-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.uc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.uc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.uc-num {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--blue-text);
  font-variant-numeric: tabular-nums;
}

.dots {
  display: flex;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.dot + .dot {
  margin-left: -5px;
}

.dot-b { background: #a8ccf3; }
.dot-a { background: #f4c1a8; }
.dot-g { background: #a9dfc4; }
.dot-n { background: #c6cfdb; }

.uc-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.uc-card p {
  margin-top: 6px;
  font-size: 0.9063rem;
  color: var(--slate);
}

/* ---------- Final CTA ---------- */

.cta {
  background: var(--wash);
  padding-block: clamp(4rem, 9vw, 6rem);
  text-align: center;
}

.cta-icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.cta .section-h {
  max-width: 26em;
  margin-inline: auto;
}

.cta .store-badge {
  margin-top: 1.75rem;
}

.cta-trust {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

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

.footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  padding-block: 3rem 2.5rem;
  font-size: 0.875rem;
}

.footer-chip {
  display: inline-block;
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  margin-bottom: 1.5rem;
}

.footer-chip img {
  display: block;
  height: 18px;
  width: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 1.25rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copy {
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Mobile sticky conversion bar ---------- */

.sticky-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  align-items: center;
  gap: 12px;
}

.sticky-bar img.bar-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.bar-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.bar-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}

.sticky-bar .store-badge {
  margin-left: auto;
}

.sticky-bar .store-badge img {
  height: 40px;
}

/* ---------- zh-Hant typography overrides ---------- */
/* Never letterspace, uppercase, or hyphenate CJK. */

html[lang="zh-Hant"] body {
  line-height: 1.85;
}

html[lang="zh-Hant"] .hero h1 {
  font-size: clamp(1.9rem, 6.2vw, 3rem);
  letter-spacing: 0;
  line-height: 1.3;
}

html[lang="zh-Hant"] .section-h,
html[lang="zh-Hant"] h2,
html[lang="zh-Hant"] h3 {
  letter-spacing: 0;
}

html[lang="zh-Hant"] .kicker {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.875rem;
}

/* ---------- Responsive ---------- */

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

@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-sub,
  .trust-pills {
    margin-inline: auto;
    justify-content: center;
  }

  .hero-visual {
    margin-top: 2.5rem;
  }

  .phone-crop {
    height: min(420px, 100vw);
  }

  .lrow {
    grid-template-columns: 44px 36px 1fr;
    gap: 14px;
  }

  .lnum {
    font-size: 1.5rem;
    margin-top: 4px;
  }

  .licon svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 84px;
  }

  /* .visible is toggled by the inline scroll script once the hero CTA
     scrolls out of view, so the first viewport isn't triple-stacked with
     install prompts (Smart App Banner + hero badge + bar) */
  .sticky-bar.visible {
    display: flex;
  }
}

@media (max-width: 560px) {
  .uc-grid {
    grid-template-columns: 1fr;
  }

  .nav-login {
    display: none;
  }
}

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