/* ============================================================
   TipApp — thetipapp.ai
   Aesthetic: late-night stage. Warm charcoal, spotlight amber,
   ember accent. Editorial Fraunces display + Hanken Grotesk UI
   + DM Mono for labels & money.
   ============================================================ */

:root {
  --bg:        #0d0a09;
  --bg-2:      #14100d;
  --surface:   #1b1511;
  --surface-2: #241c16;
  --line:      rgba(245, 225, 200, 0.10);
  --line-2:    rgba(245, 225, 200, 0.18);

  --text:      #f4ece1;
  --muted:     #a4948440;       /* unused alpha helper */
  --muted-fg:  #ab9c8c;
  --faint:     #6f6357;

  --gold:      #f3b14a;
  --gold-2:    #ffd488;
  --ember:     #ff6a4d;
  --rose:      #ff5e7a;

  --grad: linear-gradient(102deg, var(--gold-2) 0%, var(--gold) 38%, var(--ember) 100%);

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

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

/* ---------- Atmosphere: grain + drifting spotlight ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.spotlight {
  position: fixed; inset: -20% -10% auto -10%; height: 130vh; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 72% 8%, rgba(243, 177, 74, 0.20), transparent 60%),
    radial-gradient(50% 45% at 18% 0%, rgba(255, 106, 77, 0.14), transparent 55%);
  filter: blur(8px);
  animation: drift 18s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* ---------- Shared bits ---------- */
main, .nav, .footer { position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.eyebrow--center { text-align: center; }

.section-head { max-width: 720px; margin: 0 auto; text-align: center; }
.section-title,
.cta__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  line-height: 1.05;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}

.btn {
  --pad-y: 0.9rem;
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.98rem;
  padding: var(--pad-y) 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn--primary {
  background: var(--grad);
  color: #1a1206;
  box-shadow: 0 10px 30px -12px rgba(243, 177, 74, 0.7);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(243, 177, 74, 0.85); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-2px); }

.btn:focus-visible,
a:focus-visible,
input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

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

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.4rem clamp(1.1rem, 4vw, 2.5rem);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 6px 18px -6px rgba(243, 177, 74, 0.8), inset 0 0 0 1px rgba(255,255,255,0.25);
}
.brand__coin { font-family: var(--font-display); font-weight: 600; color: #1a1206; font-size: 1.1rem; line-height: 1; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em;
}
.brand__word--sm { font-size: 1.3rem; }
.brand__word-accent { color: var(--gold); }

.nav__links { margin-left: auto; display: flex; gap: 2rem; }
.nav__links a {
  color: var(--muted-fg); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  position: relative; transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--gold); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { padding: 0.6rem 1.2rem; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1.1rem, 4vw, 2.5rem) 3rem;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(2.9rem, 7vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}
.hero__title-accent {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--muted-fg); max-width: 30em; margin-bottom: 2rem;
}
.hero__lede em { color: var(--text); font-style: italic; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.2rem; }
.hero__trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.1rem 1.8rem;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--faint);
}
.hero__trust .tick { color: var(--gold); margin-right: 0.4em; }

/* ---------- Hero phone mock ---------- */
.hero__stage { position: relative; display: grid; place-items: center; }
.phone__glow {
  position: absolute; inset: 8% 12%; z-index: 0;
  background: radial-gradient(closest-side, rgba(243,177,74,0.32), transparent 75%);
  filter: blur(38px);
}
.phone {
  position: relative; z-index: 1;
  width: min(330px, 84vw);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  border-radius: 34px;
  padding: 0.5rem;
  box-shadow:
    0 40px 80px -30px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transform: rotate(-1.6deg);
  transition: transform 0.5s var(--ease);
}
.phone:hover { transform: rotate(0deg) translateY(-4px); }
.phone__notch { width: 42%; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.10); margin: 0.45rem auto 0.75rem; }
.phone__screen {
  background: radial-gradient(120% 80% at 50% -10%, rgba(243,177,74,0.10), transparent 60%), var(--bg);
  border-radius: 26px; padding: 1.2rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
}
.show__eyebrow { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ember); }
.show__name { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.1; margin-top: 0.15rem; }
.show__sub { color: var(--faint); font-size: 0.82rem; }

.search {
  margin: 1rem 0 0.9rem; display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.6rem 0.8rem; color: var(--faint); font-size: 0.85rem;
}
.search__icon { font-size: 1rem; }

.songlist { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.song {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.6rem 0.7rem;
}
.song--req { border-color: rgba(243,177,74,0.35); background: rgba(243,177,74,0.06); }
.song__meta { display: flex; flex-direction: column; min-width: 0; }
.song__title { font-weight: 600; font-size: 0.9rem; }
.song__artist { font-size: 0.74rem; color: var(--faint); }
.song__btn {
  flex: none; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--grad); color: #1a1206; font-weight: 500;
}
.song__btn--done { background: transparent; color: var(--gold); border: 1px solid rgba(243,177,74,0.45); }

.tipbar {
  margin-top: 1rem; padding: 0.85rem; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,106,77,0.12), rgba(243,177,74,0.06));
  border: 1px solid rgba(255,106,77,0.30);
}
.tipbar__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.6rem; }
.tipbar__label { font-size: 0.82rem; color: var(--muted-fg); }
.tipbar__total { font-family: var(--font-mono); font-weight: 500; font-size: 1.25rem; color: var(--gold-2); }
.tipbar__amts { display: flex; gap: 0.4rem; }
.chip {
  flex: 1; text-align: center; font-family: var(--font-mono); font-size: 0.8rem;
  padding: 0.45rem 0; border-radius: 10px; border: 1px solid var(--line-2); color: var(--muted-fg);
}
.chip--on { background: rgba(243,177,74,0.16); border-color: var(--gold); color: var(--gold-2); }
.chip--send { flex: 1.2; background: var(--grad); color: #1a1206; border: none; font-weight: 500; }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden; white-space: nowrap;
  padding: 0.85rem 0;
  margin-top: 1.5rem;
  -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: inline-flex; align-items: center; gap: 1.6rem;
  font-family: var(--font-mono); font-size: 0.84rem; color: var(--muted-fg);
  animation: scroll 38s linear infinite;
}
.marquee__track .dot { color: var(--ember); font-size: 0.5rem; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- How it works ---------- */
.how { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 9vw, 7rem) clamp(1.1rem, 4vw, 2.5rem); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.steps {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.8rem);
}
.step {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 1.8rem 1.6rem 2rem; position: relative; overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.step::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.step:hover { transform: translateY(-4px); border-color: var(--line-2); }
.step:hover::before { transform: scaleX(1); }
.step__num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold); letter-spacing: 0.1em; }
.step__title { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin: 0.7rem 0 0.6rem; letter-spacing: -0.01em; }
.step__body { color: var(--muted-fg); font-size: 0.98rem; }
.step__body em { color: var(--gold-2); font-style: normal; }

/* ---------- Features ---------- */
.features {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem) clamp(4rem, 9vw, 7rem);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.5rem);
}
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 2rem 1.9rem; transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.feature:hover { border-color: var(--line-2); background: var(--surface-2); }
.feature--wide { grid-column: span 2; }
.feature__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.3rem; color: var(--gold-2);
  background: rgba(243,177,74,0.10); border: 1px solid rgba(243,177,74,0.25);
  margin-bottom: 1.1rem;
}
.feature__title { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.feature__body { color: var(--muted-fg); max-width: 52ch; }
.feature__body em { color: var(--gold-2); font-style: normal; }
.feature__foot { margin-top: 1.2rem; }
.badge {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted-fg);
  display: inline-flex; align-items: center; gap: 0.5em;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #635bff; box-shadow: 0 0 10px #635bff; }

/* ---------- CTA / waitlist ---------- */
.cta {
  max-width: var(--maxw); margin: 0 auto clamp(4rem, 8vw, 6rem);
  padding: clamp(2.8rem, 6vw, 4.5rem) clamp(1.4rem, 5vw, 3rem);
}
.cta__inner {
  position: relative; overflow: hidden;
  background:
    radial-gradient(80% 130% at 50% 0%, rgba(243,177,74,0.16), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--line-2); border-radius: 28px;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.4rem, 5vw, 3rem);
  text-align: center;
}
.cta__title { margin-bottom: 0.9rem; }
.cta__lede { color: var(--muted-fg); max-width: 42ch; margin: 0 auto 2rem; }
.waitlist {
  display: flex; gap: 0.6rem; max-width: 480px; margin: 0 auto; flex-wrap: wrap;
  justify-content: center;
}
.waitlist__input {
  flex: 1; min-width: 240px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 0.95rem 1.3rem; color: var(--text); font-family: var(--font-ui); font-size: 1rem;
  transition: border-color 0.2s var(--ease);
}
.waitlist__input::placeholder { color: var(--faint); }
.waitlist__input:focus { border-color: var(--gold); outline: none; }
.waitlist__btn { flex: none; }
.waitlist__msg {
  flex-basis: 100%; min-height: 1.2em; margin-top: 0.4rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold-2);
}
.waitlist__msg.is-error { color: var(--rose); }
.cta__fineprint { margin-top: 1.4rem; font-size: 0.82rem; color: var(--faint); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.5rem clamp(1.1rem, 4vw, 2.5rem) 3.5rem;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.6rem; align-items: center; text-align: center;
}
.footer__brand { display: inline-flex; align-items: baseline; gap: 0.7rem; }
.footer__domain { font-family: var(--font-mono); font-size: 0.82rem; color: var(--faint); letter-spacing: 0.04em; }
.footer__tag { color: var(--muted-fg); font-size: 0.95rem; }
.footer__legal { font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); letter-spacing: 0.03em; }

/* ---------- Reveal on load ---------- */
.reveal { opacity: 0; transform: translateY(18px); animation: rise 0.9s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* scroll-reveal (added by JS via IntersectionObserver) */
.io { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.io.is-in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero__stage { order: -1; margin-bottom: 1rem; }
  .nav__links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .feature--wide { grid-column: span 1; }
}
@media (max-width: 480px) {
  .hero__trust { gap: 0.6rem 1.2rem; }
  .waitlist { flex-direction: column; }
  .waitlist__btn { width: 100%; justify-content: center; }
}
