/* NEXUS VAUD — swipe / match page. Mobile-first. */

.match-page { min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; }

/* the WebGL line-field sits behind everything, never intercepts input */
#field {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  pointer-events: none;
}

.match-main {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column;
  padding: clamp(.8rem, 3vw, 1.6rem) var(--gut) clamp(1.2rem, 3vw, 2rem);
  max-width: var(--measure); margin-inline: auto; width: 100%;
}

.match-head { text-align: center; margin-bottom: clamp(.8rem, 2.5vw, 1.4rem); }
.match-head .eyebrow { margin-bottom: .5rem; }
.match-head h1 { font-size: clamp(1.5rem, 5vw, 2.4rem); }
.match-head p { font-size: .85rem; color: var(--ink-muted); margin: .7rem auto 0; max-width: 40ch; }

/* ---------- card stack ---------- */
.stack {
  position: relative; flex: 1;
  width: 100%; max-width: 380px; margin: 0 auto;
  min-height: 430px;
  touch-action: none;
}

.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: clamp(1.2rem, 3.4vw, 1.7rem);
  will-change: transform;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.card:active { cursor: grabbing; }
.card.gone { transition: transform .42s cubic-bezier(.4,0,.6,1), opacity .42s ease; opacity: 0; }
.card.settle { transition: transform .34s var(--ease); }

.card .c-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.card .c-sector { font-family: var(--mono); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); border: 1px solid var(--rule); padding: .26rem .42rem; }
.card .icon { margin: clamp(1rem,3vw,1.6rem) 0 clamp(.9rem,2.5vw,1.3rem); }
.card h2 { font-size: clamp(1.35rem, 5vw, 1.85rem); letter-spacing: -.025em; }
.card .c-one { font-size: .92rem; line-height: 1.5; margin-top: .7rem; color: var(--ink-body); }
.card .c-sub { font-family: var(--mono); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin-top: .5rem; }
.card .c-facts { margin-top: auto; padding-top: 1.2rem; display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; border-top: 1px solid var(--rule); }
.card .c-facts .k { font-family: var(--mono); font-size: .5rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.card .c-facts .v { font-size: .88rem; font-weight: 700; color: var(--ink); margin-top: .25rem; letter-spacing: -.01em; }

/* drag stamps */
.stamp {
  position: absolute; top: 1.1rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  border: 2px solid var(--ink); color: var(--ink);
  padding: .34rem .6rem; opacity: 0; pointer-events: none;
  background: var(--paper);
}
.stamp-yes { right: 1.1rem; transform: rotate(9deg); }
.stamp-no  { left: 1.1rem;  transform: rotate(-9deg); }

/* ---------- controls ---------- */
.controls { display: flex; justify-content: center; gap: clamp(.8rem,3vw,1.4rem); margin-top: clamp(1.1rem,3vw,1.8rem); }
.ctrl {
  appearance: none; background: var(--paper); cursor: pointer;
  width: 60px; height: 60px; border: 1px solid var(--ink);
  display: grid; place-items: center; color: var(--ink);
  transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.ctrl:hover { background: var(--ink); color: var(--paper); }
.ctrl:active { transform: scale(.94); }
.ctrl:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.ctrl .icon { width: 26px; height: 26px; stroke-width: 2.2; color: currentColor; stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
.ctrl-lg { width: 68px; height: 68px; }
.hint { text-align: center; margin-top: 1rem; font-family: var(--mono); font-size: .55rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- deck exhausted ---------- */
.done { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--rule); padding: 2rem; }
.done.show { display: flex; }
.done h2 { font-size: 1.4rem; margin-bottom: .8rem; }
.done p { font-size: .9rem; color: var(--ink-muted); max-width: 30ch; margin-bottom: 1.6rem; }

/* ---------- match reveal ---------- */
.reveal-lay {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding: var(--gut);
}
.reveal-lay.show { display: flex; }
.reveal-in { text-align: center; max-width: 30rem; width: 100%; }
.reveal-in svg.link { width: min(300px, 78vw); height: auto; display: block; margin: 0 auto 2rem; overflow: visible; }
.reveal-in svg.link * { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.reveal-in svg.link .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.reveal-lay.show .draw { animation: draw .9s var(--ease) forwards; }
.reveal-lay.show .d2 { animation-delay: .18s; }
.reveal-lay.show .d3 { animation-delay: .34s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.reveal-in .eyebrow { animation: fade .5s var(--ease) .5s both; }
.reveal-in h2 { font-size: clamp(1.6rem,6vw,2.4rem); animation: fade .5s var(--ease) .62s both; }
.reveal-in .r-body { animation: fade .5s var(--ease) .74s both; }
.reveal-in .btns { justify-content: center; animation: fade .5s var(--ease) .86s both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal-in p { font-size: .92rem; color: var(--ink-body); margin: 1rem auto 0; max-width: 34ch; }
.reveal-in .r-meta { font-family: var(--mono); font-size: .58rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-muted); margin-top: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  .reveal-lay.show .draw { animation: none; stroke-dashoffset: 0; }
  .reveal-in .eyebrow, .reveal-in h2, .reveal-in .r-body, .reveal-in .btns { animation: none; }
  .card.gone, .card.settle { transition: none; }
}

@media (max-height: 720px) {
  .stack { min-height: 360px; }
  .match-head p { display: none; }
}
