@import url("tokens.css");

/* TapReact landing — lean, professional, clean */

@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}

@font-face {
  font-family: InterVariable;
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  --bg: var(--color-bg-canvas-white);
  --bg-elevated: var(--color-bg-surface);
  --bg-muted: var(--gray-800);
  --text: var(--color-text-heading);
  --text-secondary: var(--color-text-secondary);
  --text-tertiary: var(--color-text-muted);
  --border: rgba(248, 250, 251, 0.08);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --shadow-color-soft: rgba(0, 0, 0, 0.25);
  --header-frost: color-mix(in srgb, var(--bg) 72%, transparent);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --nav-h: 64px;
  --content: 1120px;
  --font-heading: "General Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: InterVariable, "Inter", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--color-accent-subtle);
  color: var(--color-text-heading);
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ——— Header / Nav ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
}

/* Frosted bar that soft-fades at the bottom (no hard border) */
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--nav-h) + 2.75rem);
  z-index: -1;
  pointer-events: none;
  background: var(--header-frost);
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
  backdrop-filter: saturate(1.35) blur(18px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 calc(var(--nav-h) - 4px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 calc(var(--nav-h) - 4px),
    transparent 100%
  );
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before {
    background: linear-gradient(
      to bottom,
      color-mix(in srgb, var(--bg) 96%, transparent) 0%,
      color-mix(in srgb, var(--bg) 88%, transparent) calc(var(--nav-h) - 4px),
      transparent 100%
    );
  }
}

.nav {
  position: relative;
  z-index: 1;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo img {
  width: 36px;
  height: 36px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

.wordmark {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
}

/* ——— Buttons ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-action-primary);
  color: var(--color-action-primary-text);
  padding: 14px 22px;
  border-radius: var(--radius-pill);
}

.btn-primary:hover {
  background: var(--color-action-primary-hover);
}

.btn-primary:active {
  background: var(--color-action-primary-active);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  gap: 8px;
  padding: 0 28px 0 24px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    var(--color-action-primary);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(26, 19, 161, 0.5);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn-download-logo {
  display: block;
  width: 17px;
  height: 22px;
  max-width: none;
  flex-shrink: 0;
}

.btn-download:focus {
  outline: none;
}

.btn-download:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-download:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-download:active {
  transform: scale(0.98);
  opacity: 0.88;
}

.btn-appstore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: 8px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 1px 2px var(--shadow-color-soft);
}

.btn-appstore img {
  display: block;
  height: 52px;
  width: auto;
  border-radius: 8px;
  pointer-events: none;
}

.btn-appstore:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-appstore:active {
  transform: scale(0.98);
  opacity: 0.85;
  box-shadow: 0 1px 2px var(--shadow-color-soft);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.875rem;
}

.btn-text {
  color: var(--text-secondary);
  padding: 14px 4px;
  font-weight: 400;
  gap: 6px;
}

.btn-text::after {
  content: "→";
  transition: transform 0.2s var(--ease);
}

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

.btn-text:hover::after {
  transform: translateX(3px);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 22px;
  padding: 3px;
}

/* ——— Hero ——— */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: var(--content);
  margin: 0 auto;
  padding: 28px 20px 32px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 22.5em;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.625rem, calc(8.6vw + 0.5rem), 3.25rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.lede {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 34em;
  margin: 0 auto;
  line-height: 1.5;
}

.hero-visual {
  width: 100%;
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.hero-mockup {
  position: relative;
  width: min(280px, 82vw);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 12px 32px 0;
}

/* ——— Floating meme stickers ——— */

.sticker {
  position: absolute;
  z-index: 3;
  width: 72px;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  border: 2.5px solid var(--gray-0);
  box-shadow:
    0 8px 24px var(--shadow-color),
    0 2px 6px var(--shadow-color-soft);
  pointer-events: none;
  user-select: none;
}

.sticker-1 {
  top: 8%;
  left: -4%;
  width: 76px;
  transform: rotate(-11deg);
  animation: sticker-float-a 5.5s ease-in-out infinite;
}

.sticker-2 {
  top: 22%;
  right: -6%;
  width: 82px;
  transform: rotate(8deg);
  animation: sticker-float-b 6.2s ease-in-out infinite;
  animation-delay: -1.4s;
}

.sticker-3 {
  bottom: 18%;
  left: -8%;
  width: 62px;
  border-radius: 14px;
  transform: rotate(13deg);
  animation: sticker-float-c 5.8s ease-in-out infinite;
  animation-delay: -2.6s;
}

@keyframes sticker-float-a {
  0%,
  100% {
    transform: rotate(-11deg) translateY(0);
  }
  50% {
    transform: rotate(-9deg) translateY(-8px);
  }
}

@keyframes sticker-float-b {
  0%,
  100% {
    transform: rotate(8deg) translateY(0);
  }
  50% {
    transform: rotate(10deg) translateY(-10px);
  }
}

@keyframes sticker-float-c {
  0%,
  100% {
    transform: rotate(13deg) translateY(0);
  }
  50% {
    transform: rotate(11deg) translateY(-7px);
  }
}

/* ——— Phone mockup ——— */

.hero-device {
  width: min(200px, 54vw);
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 32px var(--shadow-color));
}

/* ——— Feature sections ——— */

.feature {
  max-width: var(--content);
  margin: 0 auto;
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.feature-copy h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.625rem, 4.5vw, 2.25rem);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 12px;
}

.feature-how .feature-copy h2 {
  display: flex;
  align-items: center;
  gap: 0.55em;
}

.feature-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-accent-surface);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.feature-copy p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 32em;
  line-height: 1.55;
}

.feature-visual {
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-visual--shot {
  padding: 36px 24px;
  min-height: 280px;
  overflow: hidden;
}

.feature-shot {
  width: min(200px, 56vw);
  height: auto;
  border-radius: 22px;
  box-shadow:
    0 18px 40px var(--shadow-color),
    0 2px 8px var(--shadow-color-soft);
}

/* Phone rising from the bottom — top stays inset, bottom clips */
.feature-visual--peek {
  position: relative;
  padding: 0;
  min-height: 320px;
  height: clamp(320px, 78vw, 400px);
}

.feature-visual--peek .feature-shot {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  width: min(240px, 64vw);
  height: calc(100% - 24px);
  object-fit: cover;
  object-position: top center;
  border-radius: 24px;
  box-shadow:
    0 12px 36px var(--shadow-color),
    0 2px 8px var(--shadow-color-soft);
}

/* ——— Closing ——— */

.closing {
  max-width: var(--content);
  margin: 24px auto 0;
  padding: 64px 20px;
  text-align: center;
}

.closing h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 500;
  margin-bottom: 12px;
}

.closing p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 28px;
}

/* ——— Legal pages ——— */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.legal-content h1 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 4px;
}

.legal-updated {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legal-content h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.25rem;
  margin-top: 28px;
  color: var(--text);
}

.legal-content h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.0625rem;
  margin-top: 12px;
  color: var(--text);
}

.legal-content p,
.legal-content ul,
.legal-content li {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-content ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--color-text-link);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:not(.btn):hover {
  opacity: 0.85;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0 8px;
}

.legal-content em {
  color: var(--text-secondary);
}

.contact-content .contact-cta {
  align-self: flex-start;
  margin-top: 8px;
  text-decoration: none;
  color: var(--color-action-primary-text);
  font-weight: 600;
}

.contact-content .contact-cta:hover {
  color: var(--color-action-primary-text);
  text-decoration: none;
}

/* ——— Footer ——— */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 20px 48px;
}

.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-logo {
  display: inline-flex;
  line-height: 0;
}

.footer-logo img {
  width: 40px;
  height: 40px;
  display: block;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--text);
}

.credit {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.credit a {
  color: inherit;
  transition: color 0.2s var(--ease);
}

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

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 8px;
}

/* ——— Reveal motion ——— */

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-mockup.reveal {
  transition-delay: 0.12s;
}

.hero-mockup.reveal .sticker {
  opacity: 0;
  transition: opacity 0.65s var(--ease);
}

.hero-mockup.reveal.is-visible .sticker-1 {
  opacity: 1;
  transition-delay: 0.28s;
}

.hero-mockup.reveal.is-visible .sticker-2 {
  opacity: 1;
  transition-delay: 0.4s;
}

.hero-mockup.reveal.is-visible .sticker-3 {
  opacity: 1;
  transition-delay: 0.52s;
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .sticker {
    animation: none;
  }

  .hero-mockup.reveal .sticker {
    opacity: 1;
  }
}

/* ——— Tablet+ ——— */

@media (min-width: 640px) {
  .nav,
  .hero,
  .feature,
  .closing,
  .legal-page,
  .site-footer {
    padding-left: 32px;
    padding-right: 32px;
  }

  .hero {
    padding-top: 16px;
  }

  .legal-content h2 {
    font-size: 1.375rem;
    margin-top: 36px;
  }

  .legal-content p,
  .legal-content ul,
  .legal-content li {
    font-size: 1.0625rem;
  }

  .hero-copy {
    max-width: 28em;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 6vw, 3.5rem);
  }

  .hero-mockup {
    width: 340px;
    padding: 16px 44px 0;
  }

  .hero-device {
    width: 230px;
  }

  .sticker {
    width: 88px;
  }

  .sticker-1 {
    left: 0;
    width: 96px;
  }

  .sticker-2 {
    right: 0;
    width: 102px;
  }

  .sticker-3 {
    left: -4%;
    width: 78px;
  }

  .feature-shot {
    width: 220px;
  }

  .feature-visual--peek {
    height: 420px;
    min-height: 420px;
    padding: 0;
  }

  .feature-visual--peek .feature-shot {
    top: 56px;
    width: 260px;
    height: calc(100% - 28px);
  }
}

/* ——— Desktop ——— */

@media (min-width: 900px) {
  :root {
    --nav-h: 72px;
  }

  .btn-appstore img {
    height: 56px;
  }

  .hero {
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .hero-copy {
    max-width: 640px;
  }

  .lede {
    margin: 0 auto;
  }

  .cta-group {
    justify-content: center;
  }

  .hero-visual {
    margin-top: 28px;
  }

  .hero-mockup {
    width: 380px;
    padding: 16px 52px 0;
  }

  .hero-device {
    width: 210px;
  }

  .sticker {
    width: 104px;
  }

  .sticker-1 {
    width: 116px;
  }

  .sticker-2 {
    width: 124px;
  }

  .sticker-3 {
    width: 92px;
  }

  .feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 56px;
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .feature-how-alt .feature-visual {
    order: -1;
  }

  .feature-visual {
    min-height: 240px;
    padding: 40px;
  }

  .feature-visual--shot {
    min-height: 420px;
    padding: 48px 40px;
  }

  .feature-shot {
    width: 240px;
  }

  .feature-visual--peek {
    height: 480px;
    min-height: 480px;
    padding: 0;
  }

  .feature-visual--peek .feature-shot {
    top: 64px;
    width: 280px;
    height: calc(100% - 32px);
  }

  .closing {
    padding: 96px 32px;
  }
}

@media (min-width: 1100px) {
  .hero h1 {
    font-size: 3.5rem;
  }

  .lede {
    font-size: 1.125rem;
  }
}
