/* ==========================================================================
   QuickMem — brand design system
   Signature palette: purple (#6C1ECB / #421974) + yellow (#FFAE24 / #C98715)
   on the app's dark canvas (#0C0B11 / cards #1C1B25).
   Display: Fraunces (serif) · Body: Hanken Grotesk
   ========================================================================== */

:root {
  --bg:           #0c0b11;
  --bg-2:         #131019;
  --surface:      #1c1b25;
  --surface-2:    #242231;
  --ink:          #f6f3fb;
  --ink-soft:     rgba(246, 243, 251, 0.74);
  --muted:        rgba(246, 243, 251, 0.52);
  --line:         rgba(255, 255, 255, 0.10);
  --line-strong:  rgba(255, 255, 255, 0.20);

  --purple:       #6c1ecb;
  --purple-bright:#a672f2;
  --purple-deep:  #421974;
  --purple-tint:  rgba(108, 30, 203, 0.18);

  --yellow:       #ffae24;
  --yellow-deep:  #c98715;
  --yellow-tint:  rgba(255, 174, 36, 0.16);

  --btn-dark:     #161320;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 44px -16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 50px 110px -38px rgba(50, 12, 96, 0.9);
  --glow:      0 18px 50px -16px rgba(108, 30, 203, 0.7);

  --radius:   20px;
  --radius-sm: 12px;
  --maxw:     1080px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1150px 620px at 84% -12%, rgba(108, 30, 203, 0.40), transparent 60%),
    radial-gradient(820px 520px at -8% 8%, rgba(66, 25, 116, 0.45), transparent 58%),
    radial-gradient(900px 520px at 50% 116%, rgba(255, 174, 36, 0.10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fine grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  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='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--purple); color: #fff; }

a { color: var(--purple-bright); }

/* ---- Layout ---------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---- Header ---------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 14px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.site-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.site-nav a:hover { color: #fff; border-color: var(--yellow); }

/* ---- Store buttons (Android + iOS share one box -> identical size) --------- */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: 210px;
  height: 56px;
  padding: 0 20px;
  border-radius: 13px;
  background: var(--btn-dark);
  border: 1px solid var(--line-strong);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--purple-bright); }
.store-btn .icon { flex: 0 0 auto; }
.store-btn .label small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  opacity: 1;
}
.store-btn .label span {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

/* Pill CTA */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--glow);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translateY(-2px); background: #7d35e0; }
.cta.ghost { background: transparent; color: var(--purple-bright); border: 1.5px solid var(--line-strong); box-shadow: none; }
.cta.ghost:hover { border-color: var(--purple-bright); background: var(--purple-tint); }

/* ---- Hero ------------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
  padding: 40px 0 72px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-bright);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--yellow);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: #fff;
}
.hero h1 em {
  font-style: italic;
  color: var(--yellow);
}
.hero .tagline {
  font-size: 1.22rem;
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 0 0 34px;
}
.hero .fineprint { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---- Flip card (hero visual) ---------------------------------------------- */
.card-scene {
  perspective: 1400px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 360px;
}
.deck { position: relative; width: 300px; height: 380px; }
.deck::before,
.deck::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.deck::before { transform: rotate(-6deg) translateY(10px); }
.deck::after  { transform: rotate(4deg) translateY(4px); }

.flipcard {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
}
.deck:hover .flipcard,
.flipcard.is-flipped { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
}
.face .tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
}
.face .word {
  font-family: var(--font-display);
  font-weight: 500;
  margin-top: auto;
  color: #fff;
}
.face.front .word { font-size: 2.6rem; line-height: 1.05; letter-spacing: -0.02em; }
.face.back {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, var(--purple), var(--purple-deep));
  border-color: rgba(255, 255, 255, 0.16);
}
.face.back .tag { color: rgba(255, 255, 255, 0.78); }
.face.back .word { font-size: 1.7rem; }
.face .hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.face.back .hint { color: rgba(255, 255, 255, 0.8); }

/* ---- Section heading ------------------------------------------------------- */
.section { padding: 18px 0 40px; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #fff;
}
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* ---- Feature grid ---------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--purple); }
.feature .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--purple-tint);
  color: var(--purple-bright);
  margin-bottom: 16px;
}
.feature h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: #fff;
}
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---- Chips ----------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.chip:hover { border-color: var(--purple); color: #fff; background: var(--purple-tint); }

/* ---- Closing band ---------------------------------------------------------- */
.closer {
  margin: 24px 0 56px;
  padding: 56px 40px;
  border-radius: 28px;
  background:
    radial-gradient(820px 300px at 50% -40%, rgba(255, 174, 36, 0.30), transparent 70%),
    linear-gradient(150deg, var(--purple), var(--purple-deep));
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.closer h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 12px;
}
.closer p { color: rgba(255, 255, 255, 0.82); margin: 0 auto 28px; max-width: 46ch; }
.closer .stores { justify-content: center; }
.closer .store-btn { background: #1a1326; border-color: rgba(255, 255, 255, 0.22); }

/* ---- Article (content pages) ---------------------------------------------- */
.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 56px clamp(26px, 5vw, 60px);
  box-shadow: var(--shadow-md);
  margin: 14px auto 40px;
}
.article h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: #fff;
}
.article .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.article h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 34px 0 10px;
  padding-left: 16px;
  position: relative;
  color: #fff;
}
.article h2::before {
  content: "";
  position: absolute;
  left: 0; top: 0.18em;
  width: 4px; height: 1.05em;
  border-radius: 2px;
  background: var(--yellow);
}
.article p { margin: 0 0 16px; color: var(--ink-soft); }
.article a { color: var(--purple-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--yellow); }
.article a:hover { color: #fff; }
.article .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.pagenav {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 40px; padding-top: 26px;
  border-top: 1px solid var(--line);
}
.pagenav a {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft); text-decoration: none;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  transition: border-color 0.16s ease, color 0.16s ease;
}
.pagenav a:hover { border-color: var(--purple); color: #fff; }

/* ---- Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--purple-bright); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---- Entrance animation ---------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { opacity: 0; animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.14s; }
.d3 { animation-delay: 0.23s; }
.d4 { animation-delay: 0.32s; }
.d5 { animation-delay: 0.41s; }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 24px 0 48px; text-align: center; }
  .eyebrow { justify-content: center; }
  .hero .tagline { margin-left: auto; margin-right: auto; }
  .hero .stores { justify-content: center; }
  .card-scene { order: -1; min-height: 320px; }
  .features { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .deck { width: 264px; height: 340px; }
  .closer { padding: 40px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
  .deck:hover .flipcard { transform: none; }
}
