/* ============================================================
   Positioned — an inclusive sex-position guide + matcher
   Palette (from the provided swatch), mapped to the 5 categories:
     Missionary  -> pink     #F86FDF
     Cowgirl/boy -> lavender #E4B6F6
     Doggystyle  -> cyan     #57E1FB
     Spooning    -> sky      #4FA6E0
     Misc        -> royal    #4166D9
   Mobile-first. Light + dark theme aware.
   ============================================================ */

:root {
  --pink:      #F86FDF;
  --lavender:  #E4B6F6;
  --cyan:      #57E1FB;
  --sky:       #4FA6E0;
  --royal:     #4166D9;

  /* category accents */
  --cat-missionary: #F86FDF;
  --cat-cowgirl:    #C864E8; /* deepened lavender for contrast on white */
  --cat-doggystyle: #16B9DE; /* deepened cyan for contrast on white */
  --cat-spooning:   #4FA6E0;
  --cat-foreplay:   #FF6F9C; /* warm rose — the one warm hue, distinct from the cool set */
  --cat-misc:       #4166D9;

  --brand-grad: linear-gradient(115deg, #F86FDF 0%, #E4B6F6 26%, #57E1FB 55%, #4FA6E0 78%, #4166D9 100%);

  --ink:        #2b2440;
  --ink-soft:   #574f6e;
  --muted:      #8a83a0;
  --bg:         #fdfbff;
  --bg-tint:    #f6f1fb;
  --card:       #ffffff;
  --card-line:  #efe8f6;
  --shadow-sm:  0 2px 10px rgba(65, 40, 110, 0.07);
  --shadow-md:  0 10px 30px rgba(65, 40, 110, 0.13);
  --shadow-lg:  0 20px 50px rgba(65, 40, 110, 0.20);

  --radius:     20px;
  --radius-sm:  13px;
  --radius-pill: 999px;

  --font: "SF Pro Rounded", ui-rounded, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #f3eefb;
    --ink-soft:  #c9c1de;
    --muted:     #928aa8;
    --bg:        #16121f;
    --bg-tint:   #1f1830;
    --card:      #221b33;
    --card-line: #342a4c;
    --cat-cowgirl:    #D9A6F5;
    --cat-doggystyle: #57E1FB;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.45);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.55);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--card-line);
}
.nav .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; font-size: 1.16rem; text-decoration: none; white-space: nowrap; }
@media (max-width: 400px) { .brand { font-size: 1.02rem; } .brand .dot { width: 19px; height: 19px; } }
.brand .dot {
  width: 22px; height: 22px; border-radius: 8px; background: var(--brand-grad);
  box-shadow: var(--shadow-sm);
}
.nav .spacer { flex: 1; }
.nav a.navlink {
  text-decoration: none; color: var(--ink-soft); font-weight: 650; font-size: .96rem;
  padding: 8px 14px; border-radius: var(--radius-pill); transition: background .18s, color .18s;
  white-space: nowrap;
}
@media (max-width: 430px) { .nav a.navlink.plain { display: none; } .nav .wrap { gap: 8px; } }
.nav a.navlink:hover { background: var(--bg-tint); color: var(--ink); }
.nav a.navlink.cta {
  color: #fff; background: var(--royal);
  background-image: linear-gradient(120deg, var(--pink), var(--royal));
  box-shadow: var(--shadow-sm);
}
.nav a.navlink.cta:hover { filter: brightness(1.05); color: #fff; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 54px 0 30px; overflow: hidden; }
.hero .blob {
  position: absolute; inset: -40% -20% auto -20%; height: 520px;
  background: var(--brand-grad); filter: blur(70px) saturate(1.2); opacity: .32; z-index: 0;
  border-radius: 50%;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 8vw, 3.6rem); line-height: 1.02; letter-spacing: -.03em;
  margin: 8px 0 14px; font-weight: 850;
}
.hero h1 .grad {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: clamp(1.02rem, 3.4vw, 1.22rem); color: var(--ink-soft); max-width: 34ch; margin: 0 0 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--cat-misc);
  background: color-mix(in srgb, var(--royal) 12%, var(--bg));
  padding: 6px 13px; border-radius: var(--radius-pill);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 750; font-size: 1.02rem; text-decoration: none;
  padding: 15px 24px; border-radius: var(--radius-pill); border: 0;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { color: #fff; background-image: linear-gradient(120deg, var(--pink), var(--royal)); box-shadow: var(--shadow-md); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: var(--shadow-lg); }
.btn-ghost { color: var(--ink); background: var(--card); border: 1.5px solid var(--card-line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--pink); }
.btn.big { font-size: 1.1rem; padding: 17px 28px; }

/* ---------- section headers ---------- */
.section { padding: 26px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.section-head h2 { font-size: clamp(1.4rem, 5vw, 2rem); letter-spacing: -.02em; margin: 0; font-weight: 820; }
.section-head .count { color: var(--muted); font-weight: 650; font-size: .95rem; white-space: nowrap; }

/* ---------- category chips / filter ---------- */
.filter-scroll { margin: 0 -18px; padding: 4px 18px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.chips { display: flex; gap: 9px; width: max-content; }
.chip {
  --c: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-weight: 700; font-size: .92rem; color: var(--ink-soft);
  background: var(--card); border: 1.5px solid var(--card-line);
  padding: 9px 15px; border-radius: var(--radius-pill);
  transition: border-color .16s, background .16s, color .16s, transform .12s;
}
.chip .swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.chip[aria-pressed="true"] {
  color: #fff; background: var(--c); border-color: var(--c);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 40%, transparent);
}
.chip[aria-pressed="true"] .swatch { background: rgba(255,255,255,.85); }
.chip:not([aria-pressed="true"]):hover { border-color: var(--c); transform: translateY(-1px); }

/* category color hooks */
.c-Missionary  { --c: var(--cat-missionary); }
.c-Cowgirlboy  { --c: var(--cat-cowgirl); }
.c-Doggystyle  { --c: var(--cat-doggystyle); }
.c-Spooning    { --c: var(--cat-spooning); }
.c-Foreplay    { --c: var(--cat-foreplay); }
.c-Misc        { --c: var(--cat-misc); }
.c-all         { --c: #9b8bd6; }

/* ---------- card grid ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  --c: var(--muted);
  position: relative; text-align: left; width: 100%; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); overflow: hidden; padding: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .22s, border-color .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 55%, var(--card-line)); }
.card .thumb { position: relative; aspect-ratio: 5 / 4; background: var(--bg-tint); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.05); }
.card .cat-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: .74rem; font-weight: 800; letter-spacing: .01em; color: #fff;
  background: var(--c); padding: 5px 11px; border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(0,0,0,.18); text-transform: uppercase;
}
.card .cbody { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cbody h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; font-weight: 800; }
.card .cbody .aka { font-size: .82rem; color: var(--muted); font-weight: 600; margin-top: -2px; }
.card .cbody p { margin: 2px 0 0; font-size: .92rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .mini-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.mini { font-size: .72rem; font-weight: 700; color: var(--ink-soft); background: var(--bg-tint); padding: 3px 9px; border-radius: var(--radius-pill); }

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-weight: 600; }

/* category description (--c comes from the category class, e.g. .c-Missionary) */
.cat-desc {
  display: flex; gap: 11px; align-items: flex-start;
  background: color-mix(in srgb, var(--c) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-left: 4px solid var(--c);
  border-radius: var(--radius-sm); padding: 13px 16px; margin: 2px 0 20px;
  font-size: .95rem; line-height: 1.55; color: var(--ink-soft);
  animation: fade .3s both;
}
.cat-desc .cd-emoji { font-size: 1.25rem; line-height: 1.2; flex-shrink: 0; }

/* ---------- modal / detail ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(30, 18, 55, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
@media (min-width: 700px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal {
  background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(28px); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  border: 1px solid var(--card-line);
}
@media (min-width: 700px) { .modal { border-radius: 26px; transform: scale(.96); } }
.modal-backdrop.open .modal { transform: translateY(0); }
@media (min-width: 700px) { .modal-backdrop.open .modal { transform: scale(1); } }

.modal .hero-img { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--bg-tint); }
.modal .hero-img img { width: 100%; height: 100%; object-fit: cover; }
.modal .grab { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.8); z-index: 3; }
@media (min-width: 700px) { .modal .grab { display: none; } }
.modal .close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; color: #fff; font-size: 1.2rem; line-height: 1;
  background: rgba(20,12,35,.5); backdrop-filter: blur(6px); display: grid; place-items: center;
}
.modal .close:hover { background: rgba(20,12,35,.75); }
.modal .cat-tag { position: absolute; bottom: 12px; left: 16px; z-index: 3; }

.modal-body { padding: 18px 20px 26px; }
.modal-body h2 { margin: 2px 0 2px; font-size: clamp(1.5rem, 6vw, 2rem); letter-spacing: -.02em; font-weight: 850; }
.modal-body .aka { color: var(--muted); font-weight: 650; font-size: .95rem; margin-bottom: 14px; }

.tagrow { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 18px; }
.tagpill {
  --c: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700;
  color: color-mix(in srgb, var(--c) 78%, var(--ink)); background: color-mix(in srgb, var(--c) 13%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  padding: 5px 11px; border-radius: var(--radius-pill);
}

.field { margin: 0 0 16px; }
.field .label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--c, var(--cat-misc)); margin-bottom: 5px;
}
.field .label .ic { font-size: 1rem; }
.field p { margin: 0; color: var(--ink-soft); font-size: .99rem; line-height: 1.6; }
.field.tip { background: var(--bg-tint); border-radius: var(--radius-sm); padding: 13px 15px; border-left: 3px solid var(--c, var(--pink)); }
.field.tip p { color: var(--ink); }

.modal .altbtn { margin-top: 6px; }

/* more like this */
.sim-block { margin-top: 22px; border-top: 1px solid var(--card-line); padding-top: 16px; }
.sim-head { font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 12px; }
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim {
  --c: var(--muted);
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-sm);
  padding: 8px; cursor: pointer; transition: border-color .16s, transform .12s, box-shadow .16s;
}
.sim:hover { border-color: var(--c); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sim-thumb { width: 52px; height: 48px; flex-shrink: 0; border-radius: 9px; overflow: hidden; background: var(--bg-tint); }
.sim-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sim-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sim-txt b { font-size: .9rem; font-weight: 750; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-txt span { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* ---------- quiz ---------- */
.quiz-shell { max-width: 640px; margin: 0 auto; padding: 20px 0 60px; }
.progress { height: 7px; background: var(--card-line); border-radius: 4px; overflow: hidden; margin: 10px 0 26px; }
.progress .bar { height: 100%; width: 0; background: var(--brand-grad); border-radius: 4px; transition: width .35s cubic-bezier(.2,.8,.2,1); }

.step { display: none; animation: fade .4s both; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.step .qnum { font-weight: 750; color: var(--muted); font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; }
.step h2 { font-size: clamp(1.45rem, 5.5vw, 2.05rem); letter-spacing: -.02em; margin: 6px 0 4px; font-weight: 840; }
.step .sub { color: var(--ink-soft); margin: 0 0 20px; font-size: 1rem; }

.opts { display: grid; gap: 12px; grid-template-columns: 1fr; }
.opts.two { grid-template-columns: 1fr 1fr; }
@media (min-width: 520px) { .opts.two { grid-template-columns: 1fr 1fr; } .opts.three { grid-template-columns: repeat(3,1fr); } }

.opt {
  position: relative; text-align: left; background: var(--card); border: 2px solid var(--card-line);
  border-radius: var(--radius); padding: 16px 16px; display: flex; align-items: center; gap: 13px;
  transition: border-color .16s, background .16s, transform .12s, box-shadow .18s; color: var(--ink);
}
.opt:hover { border-color: color-mix(in srgb, var(--pink) 55%, var(--card-line)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.opt .emoji { font-size: 1.7rem; line-height: 1; filter: saturate(1.1); }
.opt .otext { display: flex; flex-direction: column; gap: 1px; }
.opt .otext b { font-weight: 780; font-size: 1.02rem; }
.opt .otext span { font-size: .85rem; color: var(--muted); }
.opt .tick {
  margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card-line);
  display: grid; place-items: center; color: #fff; font-size: .8rem; flex-shrink: 0; transition: all .16s;
}
.opt[aria-pressed="true"] {
  border-color: var(--royal);
  background: color-mix(in srgb, var(--royal) 9%, var(--card));
}
.opt[aria-pressed="true"] .tick { background: var(--royal); border-color: var(--royal); }
.opt.pink[aria-pressed="true"] { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 11%, var(--card)); }
.opt.pink[aria-pressed="true"] .tick { background: var(--pink); border-color: var(--pink); }

.quiz-nav { display: flex; gap: 12px; margin-top: 28px; align-items: center; }
.quiz-nav .spacer { flex: 1; }
.linkback { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: .95rem; padding: 10px; }
.linkback:hover { color: var(--ink); }
.hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; }

/* ---------- results ---------- */
.results-head { text-align: center; padding: 12px 0 6px; }
.results-head .big-emoji { font-size: 3rem; }
.results-head h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 6px 0 6px; letter-spacing: -.02em; font-weight: 850; }
.results-head p { color: var(--ink-soft); margin: 0 auto 8px; max-width: 42ch; }
.match-badge { display:inline-flex; align-items:center; gap:7px; font-weight:800; font-size:.82rem; color:#fff; padding:5px 13px; border-radius: var(--radius-pill); background: var(--brand-grad); }
.result-card { display:flex; gap:14px; align-items:center; }
.result-card .thumb { width: 92px; height: 82px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-tint); }
.result-card .thumb img { width:100%; height:100%; object-fit: cover; }
.result-card .score { margin-left:auto; text-align:center; flex-shrink:0; }
.result-card .score .pct { font-weight: 850; font-size: 1.15rem; background: var(--brand-grad); -webkit-background-clip:text; background-clip:text; color: transparent; }
.result-card .score .lbl { font-size:.68rem; color: var(--muted); text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-list .card { flex-direction: row; padding: 12px 14px; }
.why { font-size:.8rem; color: var(--muted); margin-top:3px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--card-line); margin-top: 30px; padding: 26px 0 40px; color: var(--muted); font-size: .86rem; }
footer .wrap { display:flex; flex-wrap: wrap; gap: 8px 18px; align-items:center; }
footer a { color: var(--ink-soft); }
footer .disc { max-width: 60ch; line-height: 1.5; }

/* utilities */
.hide { display: none !important; }
.center { text-align: center; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
