/* memirror.app: one stylesheet for every page. The homepage keeps the coral
   gradient; test pages take their test's colour, like the app's detail screen. */

:root {
  --coral-1: #FF928A;
  --coral-2: #FB8077;
  --coral-deep: #E8655B;
  --ink: #0b0b0b;
  --ink-2: rgba(11, 11, 11, 0.72);
  --ink-3: rgba(11, 11, 11, 0.55);
  --paper: #FFF8F6;
  --card-radius: 22px;
  --panel-radius: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1140px;
  --serif: 'Libre Caslon Text', 'New York', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

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

.topbar {
  position: relative;
  z-index: 10;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.topbar .brand img { height: 30px; width: auto; filter: brightness(0); }
.on-color .topbar .brand img { filter: brightness(0) invert(1); }
.topbar nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.topbar nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  opacity: 0.82;
}
.topbar nav a:hover, .topbar nav a[aria-current="page"] { opacity: 1; }
.topbar nav a.nav-cta {
  opacity: 1;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}
.on-color .topbar { color: #fff; }
.on-color .topbar nav a.nav-cta { background: #fff; color: var(--ink); }
@media (max-width: 520px) {
  .topbar nav .nav-hide-sm { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18); }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); }
.btn-ghost { background: rgba(255, 255, 255, 0.22); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7); }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: clamp(12px, 2vw, 20px);
}
.card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--card-radius);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: var(--c, #555);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  isolation: isolate;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 38%, var(--c, #555) 82%);
}
.card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title { font-family: var(--serif); font-weight: 700; font-size: 1.28rem; line-height: 1.15; }
.card-meta { font-size: 0.86rem; font-weight: 600; opacity: 0.85; }

/* ---------- Section heads ---------- */

.section { padding: clamp(40px, 7vw, 80px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; margin: 0; }
.section-head p { margin: 8px 0 0; color: var(--ink-2); font-size: 1.05rem; max-width: 620px; line-height: 1.5; }
.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.06);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
}
.chip:hover { background: rgba(11, 11, 11, 0.1); }

/* ---------- Footer ---------- */

.sitefoot { padding: 48px 0 40px; color: var(--ink-2); font-size: 0.95rem; }
.sitefoot .foot-grid { display: grid; grid-template-columns: 1.2fr repeat(2, 1fr); gap: 28px; }
.sitefoot h3 { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.sitefoot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sitefoot a { text-decoration: none; }
.sitefoot a:hover { text-decoration: underline; }
.sitefoot .brand img { height: 26px; width: auto; filter: brightness(0); opacity: 0.85; margin-bottom: 12px; }
.sitefoot .fine { margin-top: 32px; font-size: 0.85rem; color: var(--ink-3); }
.on-color .sitefoot { color: rgba(255, 255, 255, 0.82); }
.on-color .sitefoot h3, .on-color .sitefoot .fine { color: rgba(255, 255, 255, 0.6); }
.on-color .sitefoot .brand img { filter: brightness(0) invert(1); }
@media (max-width: 720px) { .sitefoot .foot-grid { grid-template-columns: 1fr 1fr; } .sitefoot .foot-brand { grid-column: 1 / -1; } }

/* ---------- Home ---------- */

.page-home { background: linear-gradient(135deg, var(--coral-1) 0%, var(--coral-2) 100%); }
.page-home .hero-wrap { position: relative; }
.home-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
  padding: clamp(16px, 4vw, 40px) 0 clamp(40px, 6vw, 72px);
}
.home-hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: #fff;
  margin: 0 0 20px;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.home-hero .tagline { font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.55; margin: 0 0 32px; color: rgba(11, 11, 11, 0.78); max-width: 500px; }
.home-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-hero .art { position: relative; animation: float 6s ease-in-out infinite; }
.home-hero .mockup {
  width: 100%;
  transform: perspective(1400px) rotateY(-15deg) rotateX(5deg) scale(1.05);
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.2)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (max-width: 920px) {
  .home-hero { grid-template-columns: 1fr; text-align: center; }
  .home-hero .tagline { margin-left: auto; margin-right: auto; }
  .home-hero .actions { justify-content: center; }
  .home-hero .art { max-width: 360px; margin: 0 auto; }
}
.home-tests { background: var(--paper); border-radius: 36px 36px 0 0; color: var(--ink); }
/* The homepage footer sits on the light section, not on the coral. */
.page-home .home-tests .sitefoot { color: var(--ink-2); }
.page-home .home-tests .sitefoot h3, .page-home .home-tests .sitefoot .fine { color: var(--ink-3); }
.page-home .home-tests .sitefoot .brand img { filter: brightness(0); }
.sprinkles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.sprinkle {
  position: absolute; top: 0; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75); opacity: 0;
  animation: sprinkleFall linear infinite;
}
@keyframes sprinkleFall {
  0% { transform: translateY(-10vh); opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}

/* ---------- Tests index & categories ---------- */

.page-intro { padding: clamp(24px, 5vw, 56px) 0 8px; }
.page-intro h1 { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; margin: 0 0 16px; }
.page-intro p { font-size: clamp(1.05rem, 2.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 680px; margin: 0 0 24px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.92rem; font-weight: 600; margin-bottom: 18px; opacity: 0.75; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.category-block { scroll-margin-top: 24px; }

/* ---------- Test page ---------- */

.page-test {
  background: var(--tc);
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18) 60%, rgba(0, 0, 0, 0.26));
  background-attachment: fixed;
  color: #fff;
}
.test-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) 1.15fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding: clamp(8px, 2vw, 24px) 0 clamp(32px, 5vw, 56px);
}
.test-art {
  position: sticky;
  top: 24px;
  aspect-ratio: 3 / 4;
  border-radius: var(--panel-radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  background: rgba(0, 0, 0, 0.15);
}
.test-art img { width: 100%; height: 100%; object-fit: cover; }
.test-intro h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.04;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.facts li {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  font-size: 0.92rem;
}
.lede { font-size: clamp(1.1rem, 2.4vw, 1.32rem); line-height: 1.6; margin: 0 0 28px; color: rgba(255, 255, 255, 0.92); }
.cta-block { display: grid; gap: 14px; justify-items: start; }
.open-app { font-weight: 600; color: #fff; opacity: 0.9; text-underline-offset: 4px; }
.qr { display: none; align-items: center; gap: 16px; margin-top: 10px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.12); }
.qr svg { width: 120px; height: 120px; border-radius: 10px; flex: none; display: block; }
.qr p { margin: 0; font-size: 0.95rem; line-height: 1.45; max-width: 220px; }
@media (hover: hover) and (pointer: fine) { html:not(.is-ios) .qr { display: flex; } }
.only-ios { display: none; }
html.is-ios .only-ios { display: inline; }

.panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--panel-radius);
  padding: clamp(22px, 4vw, 40px);
  margin-bottom: 20px;
}
.panel h2 { font-family: var(--serif); font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0 0 20px; line-height: 1.15; }
.discover { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.discover li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; font-size: 1.1rem; line-height: 1.5; }
.discover li svg { width: 24px; height: 24px; margin-top: 2px; fill: #fff; opacity: 0.9; }
.dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 0; }
.dims div { background: rgba(0, 0, 0, 0.12); border-radius: 18px; padding: 18px; }
.dims dt { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.dims dd { margin: 0; font-size: 0.98rem; line-height: 1.5; color: rgba(255, 255, 255, 0.84); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.steps li { background: rgba(0, 0, 0, 0.12); border-radius: 18px; padding: 20px; counter-increment: step; line-height: 1.5; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--tc); font-weight: 800; margin-bottom: 12px;
}
.steps strong { display: block; font-size: 1.08rem; margin-bottom: 4px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.disclaimer { font-size: 0.86rem; line-height: 1.5; color: rgba(255, 255, 255, 0.66); max-width: 720px; margin: 28px 0 0; }
.related { padding-top: 36px; }
.related .section-head h2 { color: #fff; }
.related .link-arrow { color: #fff; }
.related .card { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); }

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
  display: none;
  transform: translateY(110%);
  transition: transform 0.3s ease;
}
.sticky-cta .btn { width: 100%; }
.sticky-cta.is-shown { transform: translateY(0); }

@media (max-width: 820px) {
  .test-hero { grid-template-columns: 1fr; }
  .test-art {
    position: relative;
    top: 0;
    margin: 0 calc(-1 * var(--gutter));
    border-radius: 0;
    aspect-ratio: 4 / 4.2;
    box-shadow: none;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
            mask-image: linear-gradient(180deg, #000 62%, transparent);
  }
  .page-test .topbar { position: absolute; left: 0; right: 0; top: 0; }
  .page-test main { padding-top: 0; }
  .test-intro { margin-top: -64px; position: relative; }
  .cta-block, .cta-block .btn { width: 100%; justify-items: stretch; }
  .sticky-cta { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sprinkles { display: none; }
}

/* ---------- 404 ---------- */

.notfound { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 16px; padding: 60px 0; }
.notfound h1 { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0; }
.notfound p { color: var(--ink-2); font-size: 1.1rem; margin: 0 0 12px; }
