/* Tally website - light theme only.
   Design language ported from the Hook website (same layout, type scale and
   ambient background), recolored to Tally's green brand. */
:root {
  --bg: #fbfcfa;
  --bg-elev: #ffffff;
  --text: #18181b;
  --text-dim: #52525b;
  --text-faint: #a1a1aa;
  --border: #e6e8e3;
  --green: #65a30d;
  --green-deep: #3f6212;
  --green-light: #ceff82;
  --grad: linear-gradient(135deg, #ceff82 0%, #65a30d 100%);
  --radius-card: 18px;
  --radius-logo: 22%;
  --maxw: 720px;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-rounded);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html { min-height: 100vh; min-height: 100lvh; }
body { min-height: 100vh; min-height: 100dvh; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Ambient background ---------- */
/* Drifting radial blobs behind a frosted-glass blur, tuned for a light page. */

.ambient {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.ambient::before,
.ambient::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 140px;
  pointer-events: none;
  z-index: 5;
}
.ambient::before { top: 0; background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%); }
.ambient::after { bottom: 0; background: linear-gradient(to top, var(--bg) 0%, transparent 100%); }

.ambient__blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: opacity, left, top;
}

.ambient__blob--lime {
  background: radial-gradient(circle at 50% 50%,
    rgba(132, 204, 22, 0.55) 0%,
    rgba(132, 204, 22, 0.30) 40%,
    rgba(132, 204, 22, 0.00) 100%);
}
.ambient__blob--leaf {
  background: radial-gradient(circle at 50% 50%,
    rgba(206, 255, 130, 0.65) 0%,
    rgba(206, 255, 130, 0.34) 40%,
    rgba(206, 255, 130, 0.00) 100%);
}
.ambient__blob--mint {
  background: radial-gradient(circle at 50% 50%,
    rgba(52, 211, 153, 0.42) 0%,
    rgba(52, 211, 153, 0.22) 40%,
    rgba(52, 211, 153, 0.00) 100%);
}
.ambient__blob--moss {
  background: radial-gradient(circle at 50% 50%,
    rgba(101, 163, 13, 0.42) 0%,
    rgba(101, 163, 13, 0.22) 40%,
    rgba(101, 163, 13, 0.00) 100%);
}

.ambient__blur {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  backdrop-filter: blur(64px) saturate(135%);
  -webkit-backdrop-filter: blur(64px) saturate(135%);
  background: rgba(251, 252, 250, 0.42);
}

@media (prefers-reduced-motion: reduce) {
  .ambient__blob { opacity: 0.5; }
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    0
    max(24px, env(safe-area-inset-left));
}

.topbar__brand { display: inline-flex; align-items: center; gap: 10px; }
.topbar__brand:hover { color: var(--text); }

.topbar__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-logo);
  display: block;
  box-shadow: 0 2px 8px rgba(63, 98, 18, 0.18);
}

.topbar__wordmark { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

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

.hero {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding:
    32px
    max(24px, env(safe-area-inset-right))
    32px
    max(24px, env(safe-area-inset-left));
  text-align: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 600px;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.grad-word,
.hero__title-em {
  font-size: clamp(60px, 11vw, 104px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  /* padding gives the gradient room to paint the glyph overshoot (the "y"
     tail, bottom and right); negative margins cancel it so layout/centering
     and the stacked hero lines stay exactly as tight as before. */
  margin: -0.06em -0.14em -0.1em 0;
  padding: 0 0.14em 0.12em 0;
  background: var(--grad);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero__sub {
  margin: 0;
  max-width: 44ch;
  color: var(--text-dim);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
}

.hero__device { width: min(370px, 84vw); }

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 64px;
    text-align: left;
  }
  .hero__copy { align-items: flex-start; justify-self: end; max-width: 480px; gap: 26px; }
  .hero__title { align-items: flex-start; }
  .hero__sub { max-width: 38ch; }
  .hero__device { justify-self: start; width: min(480px, 100%); }
}

/* ---------- Device images ---------- */
/* Screenshots ship pre-framed in an iPhone mockup on a transparent background. */

.hero__device img,
.feature__device img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 26px 50px rgba(31, 41, 8, 0.22));
}

/* ---------- App Store button ---------- */

.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.appstore-btn:hover { transform: translateY(-1px); opacity: 0.92; color: var(--bg); }
.appstore-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.appstore-btn__icon { width: 28px; height: 28px; flex-shrink: 0; }
.appstore-btn__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; text-align: left; }
.appstore-btn__small { font-size: 11px; font-weight: 500; opacity: 0.78; letter-spacing: 0.01em; }
.appstore-btn__large { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Shared section title ---------- */

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  margin: 0 auto 40px;
  max-width: 16ch;
}

@media (min-width: 900px) { .section-title { margin-bottom: 56px; } }

/* ---------- Benefit strip ---------- */

.trust {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding:
    16px
    max(24px, env(safe-area-inset-right))
    72px
    max(24px, env(safe-area-inset-left));
}

.trust__grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.trust__card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
}

.trust__icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}
.trust__icon svg { width: 100%; height: 100%; }

.trust__title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.trust__body { font-size: 15px; line-height: 1.5; color: var(--text-dim); margin: 0; }

@media (min-width: 900px) {
  .trust { padding: 0 32px 112px; }
  .trust__grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .trust__card { padding: 32px 26px; }
}

/* ---------- Feature sections ---------- */

.features {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 80px;
  max-width: 1180px;
  margin: 0 auto;
  padding:
    64px
    max(24px, env(safe-area-inset-right))
    64px
    max(24px, env(safe-area-inset-left));
}

.feature { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.feature__content { max-width: 460px; text-align: center; }

.feature__title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 14px; }
.feature__sub { font-size: 17px; line-height: 1.5; color: var(--text-dim); margin: 0; }
.feature__device { width: min(350px, 82vw); }

@media (min-width: 900px) {
  .features { gap: 140px; padding: 120px 32px 120px; }
  .feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 64px;
    align-items: center;
  }
  .feature__content { text-align: left; max-width: 440px; }
  .feature__title { font-size: 44px; }
  .feature__sub { font-size: 19px; }
  .feature__device { width: min(460px, 100%); }

  .feature--image-right .feature__content { grid-column: 1; grid-row: 1; justify-self: end; }
  .feature--image-right .feature__device  { grid-column: 2; grid-row: 1; justify-self: start; }
  .feature--image-left  .feature__content { grid-column: 2; grid-row: 1; justify-self: start; }
  .feature--image-left  .feature__device  { grid-column: 1; grid-row: 1; justify-self: end; }
}

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

.cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
  padding:
    96px
    max(24px, env(safe-area-inset-right))
    96px
    max(24px, env(safe-area-inset-left));
}

.cta__title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
.cta__title .grad-word { display: inline-block; font-size: inherit; font-weight: 800; margin: 0 -0.14em 0 0; }

@media (min-width: 900px) { .cta { padding: 140px 32px; gap: 40px; } }

/* ---------- Site footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding:
    32px
    max(24px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  font-size: 13px;
  color: var(--text-faint);
}
.site-footer a:hover { color: var(--text); }
.site-footer__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }

/* ---------- Document pages (privacy) ---------- */

.doc { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 96px; position: relative; z-index: 2; }
.doc__header { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.doc__logo { width: 44px; height: 44px; border-radius: 22%; box-shadow: 0 2px 8px rgba(63, 98, 18, 0.18); }
.doc__brand { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.doc h1 { font-size: 36px; letter-spacing: -0.02em; margin: 0 0 8px; }
.doc__effective { color: var(--text-faint); font-size: 14px; margin: 0 0 32px; }
.doc h2 { font-size: 20px; letter-spacing: -0.01em; margin: 36px 0 12px; }
.doc h3 { font-size: 17px; letter-spacing: -0.01em; margin: 22px 0 8px; }
.doc p, .doc li { color: var(--text-dim); line-height: 1.65; font-size: 16px; }
.doc ul { padding-left: 20px; margin: 0 0 16px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc a:hover { opacity: 0.8; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: color-mix(in srgb, var(--green) 12%, transparent); padding: 1px 5px; border-radius: 5px; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0 24px; }
.doc__back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-faint); margin-top: 32px; }
.doc__back:hover { color: var(--text); }

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  .topbar { padding-top: max(16px, env(safe-area-inset-top)); }
  .topbar__logo { width: 32px; height: 32px; }
  .topbar__wordmark { font-size: 16px; }
  .hero__sub { font-size: 15px; }
  .hero__device { width: min(330px, 86vw); }
  .feature__title { font-size: 28px; }
  .feature__sub { font-size: 16px; }
  .feature__device { width: min(330px, 88vw); }
  .features { gap: 64px; padding-top: 48px; padding-bottom: 48px; }
  .trust { padding-bottom: 56px; }
  .cta { padding-top: 72px; padding-bottom: 72px; }
  .doc { padding: 32px 20px 64px; }
  .doc h1 { font-size: 28px; }
}
