/* ============================================================
   TPASS.calc — Website Design System
   Apple-style product showcase · keeps the app's light-blue identity
   ============================================================ */

:root {
  /* Brand light-blue identity (mirrors the app's System/Light theme) */
  --accent:        #4A6FA5;
  --accent-dark:   #355489;
  --accent-deep:   #233e6b;
  --accent-light:  #eef4fc;
  --accent-mid:    #cadcf2;
  --accent-glow:   rgba(74, 111, 165, 0.24);

  /* Luminous "morning sky" tones — softer extension of the brand blue,
     used only for gradients & ambient glows (todayOS-inspired calm) */
  --sky:        #6f9bd6;
  --sky-soft:   #a9c9ef;
  --sky-wash:   #f6faff;
  --halo:       rgba(126, 168, 222, 0.20);

  /* Neutrals — Apple-ish */
  --bg:        #ffffff;
  --bg-alt:    #f6f8fb;
  --bg-blue:   #eef3fb;
  --ink:       #1b1d21;
  --ink-soft:  #3a3d44;
  --subtle:    #6b7078;
  --hairline:  rgba(0,0,0,0.08);
  --success:   #2f8f62;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-2xl: 44px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-fast: cubic-bezier(0.4, 0, 0.2, 1);

  /* Type */
  --font-display: "Lexend", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;

  --maxw: 1180px;
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Layout ─────────────────────────────────────── */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: clamp(72px, 11vw, 150px) 0; }
.section-tight { padding: clamp(48px, 7vw, 96px) 0; }
.bg-alt  { background: var(--bg-alt); }
.bg-blue { background: linear-gradient(180deg, var(--sky-wash) 0%, #eaf1fb 100%); }

/* ── Type scale ─────────────────────────────────── */
.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.6vw, 1.18rem);
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-bottom: 14px;
}
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.subhead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  line-height: 1.6;
  color: var(--subtle);
  font-weight: 400;
}
.muted { color: var(--subtle); }
.center { text-align: center; }
.gradient-text {
  background: linear-gradient(118deg, #3f6aa6 0%, var(--sky) 52%, var(--accent-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #5277b0 0%, var(--sky) 100%);
  color: #fff;
  box-shadow: 0 10px 30px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 18px 42px var(--accent-glow); }
.btn-ghost {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--accent-mid);
}
.btn-ghost:hover { background: var(--accent-mid); }
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover { background: #000; }
.btn-lg { padding: 16px 34px; font-size: 1.08rem; }
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  transition: gap .25s var(--ease);
}
.btn-text:hover { gap: 10px; }
.btn-text svg { transition: transform .25s var(--ease); }

/* ── Nav ─────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.site-nav.scrolled { border-bottom-color: var(--hairline); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  transition: background .2s var(--ease-fast), color .2s var(--ease-fast);
  white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-alt); color: var(--ink); }
.nav-links a.active { color: var(--accent); }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--accent-dark) !important; }

/* ── Hero ────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(72px, 11vw, 132px) 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
}
/* todayOS-style soft ambient morning light — luminous, calm, breathable */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 72% at 50% -22%, rgba(169,201,239,0.42) 0%, rgba(169,201,239,0) 58%),
    radial-gradient(58% 44% at 84% 6%, var(--halo) 0%, transparent 56%),
    radial-gradient(52% 42% at 12% 14%, rgba(186,213,242,0.30) 0%, transparent 56%),
    linear-gradient(180deg, var(--sky-wash) 0%, #ffffff 72%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}
/* Hero kicker → soft glass pill (todayOS calm chip) */
.hero .kicker {
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--accent-mid);
  padding: 7px 17px;
  border-radius: 999px;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 2px 14px rgba(74,111,165,0.08);
  margin-bottom: 22px;
}
.hero .display { margin-bottom: 24px; }
.hero .lede { max-width: 30em; margin: 0 auto 34px; }
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-note {
  font-size: 0.88rem;
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hero device */
.hero-stage {
  position: relative;
  margin-top: clamp(40px, 6vw, 76px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1;
}
.hero-stage .glow {
  position: absolute;
  bottom: 4%;
  width: min(680px, 80vw);
  height: 360px;
  background: radial-gradient(ellipse at center, var(--halo) 0%, transparent 70%);
  filter: blur(48px);
  z-index: 0;
}
/* Device screenshots are transparent PNGs — drop-shadow traces their shape,
   so bare-screen shots and full-phone shots both read as clean floating devices. */
.shot {
  display: block;
  filter: drop-shadow(0 30px 60px rgba(28,40,70,0.26));
}
.hero-device {
  width: clamp(230px, 32vw, 300px);
  z-index: 1;
}
.hero-device .shot { width: 100%; }

/* ── Stats strip ─────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat .num small { font-size: 0.5em; font-weight: 700; margin-left: 2px; color: var(--accent); }
.stat .label {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--subtle);
  font-weight: 600;
}

/* ── Sticky scroll showcase (Apple-style pinned) ── */
.sticky-show { position: relative; }
.sticky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
.sticky-media {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sticky-frame {
  position: relative;
  height: min(74vh, 600px);
  width: clamp(240px, 27vw, 300px);
}
.sticky-frame .device-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.97) translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.sticky-frame .device-shot.active {
  opacity: 1;
  transform: none;
}
.sticky-panels {
  display: flex;
  flex-direction: column;
  /* trailing space so the pinned device stays put while the LAST panel is
     centered and read, instead of releasing early and sliding off-screen */
  padding-bottom: 30vh;
}
.sticky-panel {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6vh 0;
}
.sticky-panel .idx {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.sticky-panel h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.sticky-panel p {
  color: var(--subtle);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.75;
  max-width: 40ch;
}
.sticky-panel .tag-row { margin-top: 20px; }

/* tags reused in panels */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--accent-mid);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* inline image used inside sticky panels on mobile */
.panel-shot {
  display: none;
  margin: 22px auto 4px;
  width: min(230px, 62vw);
  filter: drop-shadow(0 22px 44px rgba(28,40,70,0.22));
}
@media (max-width: 900px) {
  .panel-shot { display: block; }
}

/* ── Bento feature grid ──────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.bento-card {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.bg-alt .bento-card { background: #fff; }
.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(28,40,70,0.10);
}
.bento-card.span-3 { grid-column: span 3; }
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-6 { grid-column: span 6; }
.bento-ico {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-light);
  color: var(--accent-dark);
  margin-bottom: 18px;
}
.bento-ico svg { width: 24px; height: 24px; }
.bento-card h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.bento-card p { color: var(--subtle); font-size: 0.98rem; line-height: 1.65; }

/* ── Transport marquee ──────────────────────────── */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Steps ───────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 34px 28px;
  position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.step:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(28,40,70,0.09); }
.step .step-n {
  counter-increment: step;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--accent-mid);
  margin-bottom: 16px;
}
.step .step-n::before { content: counter(step, decimal-leading-zero); }
.step h4 { font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; margin-bottom: 10px; }
.step p { color: var(--subtle); font-size: 0.96rem; line-height: 1.7; }

/* ── Final CTA ───────────────────────────────────── */
.cta-final {
  position: relative;
  border-radius: var(--r-2xl);
  padding: clamp(48px, 7vw, 90px) clamp(28px, 5vw, 72px);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(80% 120% at 50% -10%, rgba(126,168,222,0.55) 0%, transparent 60%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
}
.cta-final .headline { color: #fff; }
.cta-final p { color: rgba(255,255,255,0.85); margin: 16px auto 30px; max-width: 40ch; font-size: 1.12rem; }
.cta-final .btn-primary { background: #fff; color: var(--accent-dark); box-shadow: 0 14px 40px rgba(0,0,0,0.22); }
.cta-final .btn-primary:hover { box-shadow: 0 20px 54px rgba(0,0,0,0.3); }
.cta-final .btn-ghost { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.34); }
.cta-final .btn-ghost:hover { background: rgba(255,255,255,0.24); }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--hairline);
  padding: 48px 0 40px;
  color: var(--subtle);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-brand img { width: 26px; height: 26px; border-radius: 7px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: var(--subtle); text-decoration: none; transition: color .2s; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

/* ── Generic page header (sub-pages) ─────────────── */
.page-hero {
  padding: clamp(64px, 9vw, 120px) 0 clamp(36px, 5vw, 64px);
  text-align: center;
  background:
    radial-gradient(80% 60% at 50% -20%, var(--halo) 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-wash) 0%, #ffffff 100%);
  position: relative;
}
.page-hero .lede { max-width: 56ch; margin: 18px auto 0; }

/* ── Content card (support / privacy / maic) ─────── */
.content-card {
  max-width: 820px;
  margin: 0 auto clamp(56px, 8vw, 100px);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 52px);
  box-shadow: 0 18px 50px rgba(28,40,70,0.07);
}

/* PDF embed (maic) */
.pdf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 16px; padding: 14px 18px;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--r-md);
}
.pdf-toolbar span { font-size: 0.9rem; font-weight: 600; color: var(--subtle); }
.pdf-frame-wrap {
  border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 20px 50px rgba(28,40,70,0.12);
  background: #525659;
}
.pdf-frame { display: block; width: 100%; height: 86vh; min-height: 600px; border: none; }

/* ── Scroll reveal ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-device, .marquee-track { animation: none !important; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .sticky-grid { grid-template-columns: 1fr; gap: 0; }
  .sticky-media { display: none; }
  .sticky-panels { padding-bottom: 0; }
  .sticky-panel { min-height: auto; padding: 28px 0; text-align: center; }
  .sticky-panel p { margin: 0 auto; }
  .sticky-panel .tag-row { justify-content: center; }
  .bento-card.span-3, .bento-card.span-2 { grid-column: span 6; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links .hide-sm { display: none; }
  .footer-inner { flex-direction: column; gap: 18px; }
}
