/* assets/two-ways.css: the ONE stylesheet of the "Two ways" chooser, the
   switch between "Explore yourself" and "Personalised matchmaking".
   Markup: scripts/lib-v5.mjs twoWays(); used by /join (scripts/gen-join.mjs),
   routes() on every page that carries it, and the "Get started" dialog
   (scripts/join-content.mjs chooserDialog()). Linked once per page from the
   dialog fragment, with its ?v= token in scripts/lib-asset-versions.mjs.
   Base rules are the no-:has layout (both panes stacked, the default first);
   the switch and the sliding pill are an enhancement under
   @supports selector(:has(*)). Theme timing 360ms cubic-bezier(.2,.8,.2,1). */
.tw {
  --tw-ink: var(--v5-ink, #1A0D2E);
  --tw-sub: var(--v5-body, #4A3D5C);
  --tw-acc: var(--v5-am, #5D2D8A);
  --tw-deep: var(--v5-am, #5D2D8A);
  --tw-gold: var(--v5-gold, #826738);
  --tw-ease: cubic-bezier(.2,.8,.2,1);
  --tw-dur: 360ms;
  position: relative;
  box-sizing: border-box;
  color: var(--tw-ink);
  text-align: left;
}
/* The card is the portal's glass card: tint, 1px hairline, specular edge, soft
   shadow, blur and saturation; the solid tint where backdrop-filter is missing or
   transparency is reduced. The tokens come from the theme where it is on the page,
   the portal's own numbers where this sheet loads without it. */
.tw--card {
  width: min(640px, 100%);
  border: 1px solid var(--v5-line, rgba(61,26,92,.15));
  border-radius: var(--r-card, 26px);
  padding: clamp(24px, 4vw, 40px);
  background: var(--g-solid, #FFFFFF);
  box-shadow: var(--g-hl, inset 0 1px 0 rgba(255,255,255,.85), inset 0 0 0 1px rgba(255,255,255,.35)), var(--g-shadow, 0 12px 32px -16px rgba(61,26,92,.28), 0 1px 2px rgba(61,26,92,.06));
}
.tw--compact { padding: clamp(20px, 2.4vw, 30px); border-radius: var(--r-card, 26px); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tw--card { background: var(--g-tint, rgba(255,255,255,.82)); -webkit-backdrop-filter: blur(var(--g-blur, 24px)) saturate(var(--g-sat, 180%)); backdrop-filter: blur(var(--g-blur, 24px)) saturate(var(--g-sat, 180%)); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tw--card { background: var(--g-solid, #FFFFFF); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tw--card { background: var(--g-solid, #FFFFFF); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* In dark the accent and the pill lift to the portal's dark values, so they read on the glass. */
html[data-theme="dark"] .tw { --tw-acc: var(--v5-am-ll, #B08FCC); --tw-deep: var(--v5-am-l, #7B4FA6); }
/* In the dialog the panel is already the frosted card; the words take the theme's ink. */
.tw--dialog { --tw-ink: var(--ink, #1A0D2E); --tw-sub: var(--sub, #5E5270); padding: 4px 8px 8px; }

/* The switch. Hidden until :has can drive it (see the @supports block below). */
.tw .tw-tabs { display: none; position: relative; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border: 0; margin: 0 0 22px; min-inline-size: 0; border-radius: 999px; background: rgba(93,45,138,.08); box-shadow: inset 0 0 0 1px rgba(93,45,138,.1); }
.tw .tw-tab { position: relative; z-index: 1; cursor: pointer; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.tw .tw-tab input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.tw .tw-tab-in { display: grid; gap: 1px; text-align: center; padding: 10px 8px; border-radius: 999px; transition: color var(--tw-dur) var(--tw-ease), background-color var(--tw-dur) var(--tw-ease); }
.tw .tw-tab-n { font-weight: 600; font-size: var(--fs-small); line-height: 1.25; color: var(--tw-ink); }
.tw .tw-tab-s { font-size: var(--fs-fine); line-height: 1.3; color: var(--tw-sub); }
.tw .tw-tab input:checked[value=self] + .tw-tab-in .tw-tab-n { color: #1A0D2E; }
.tw .tw-tab input:checked[value=self] + .tw-tab-in .tw-tab-s { color: #5E5270; }
.tw .tw-tab input:checked[value=match] + .tw-tab-in .tw-tab-n { color: #fff; }
.tw .tw-tab input:checked[value=match] + .tw-tab-in .tw-tab-s { color: #E2C99A; }
.tw .tw-tab input:focus-visible + .tw-tab-in { outline: 2px solid #B8914F; outline-offset: 2px; }

/* The panes: stacked by default, each named. */
.tw .tw-panes { display: grid; gap: 22px; }
.tw .tw-pane-n { margin: 0 0 8px; font-weight: var(--fw-label); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--tw-acc); }
.tw .tw-pane-lead { margin: 0 0 16px; font-family: var(--serif, 'Cormorant Garamond', serif); font-weight: 400; font-size: var(--fs-lead); line-height: 1.25; color: var(--tw-ink); }
.tw .tw-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.tw .tw-step { display: flex; gap: 14px; align-items: center; margin: 0; }
.tw .tw-n { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; font-family: var(--serif, 'Cormorant Garamond', serif); font-size: var(--fs-body); color: var(--tw-acc); background: rgba(93,45,138,.08); box-shadow: inset 0 0 0 1px rgba(93,45,138,.14); }
.tw .tw-pane--match .tw-n { color: var(--tw-gold); background: rgba(201,169,110,.14); box-shadow: inset 0 0 0 1px rgba(184,145,79,.3); }
.tw .tw-st { display: grid; line-height: 1.3; }
.tw .tw-st strong { font-weight: 600; font-size: var(--fs-body); color: var(--tw-ink); }
.tw .tw-st span { font-size: var(--fs-small); color: var(--tw-sub); }
.tw .tw-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding-top: 18px; border-top: 1px solid var(--v5-line, rgba(61,26,92,.15)); }
.tw .tw-price { margin: 0; font-size: var(--fs-small); line-height: 1.4; color: var(--tw-sub); max-width: 32ch; font-variant-numeric: lining-nums tabular-nums; }
.tw .tw-price strong, .tw .tw-price .tv-fig { font-weight: 600; color: var(--tw-ink); }
.tw .tw-price .tv-fig { display: block; font-size: var(--fs-body); }
.tw .tw-price .tv-meta { display: block; font-size: var(--fs-small); color: var(--tw-sub); }
.tw .tw-price [data-price] { color: var(--tw-gold); font-weight: 600; }
/* The primary pill, the portal's recipe: amethyst gradient, ivory ink, 1px edge, specular inset, 48px. */
.tw .tw-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 var(--g-s5, 24px); border: 1px solid var(--g-btn-edge, rgba(255,255,255,.16)); border-radius: var(--r-pill, 999px); font-weight: var(--fw-button); font-size: var(--fs-button); letter-spacing: .01em; line-height: 1.2; color: var(--g-btn-ink, #FBF8F2); background: var(--g-btn, linear-gradient(to bottom, #7A4CB0, #5D2D8A)); text-decoration: none; box-shadow: var(--g-btn-shadow, inset 0 1px 0 rgba(255,255,255,.22), 0 10px 22px -10px rgba(93,45,138,.7)); touch-action: manipulation; transition: transform var(--g-dur-fast, .22s) var(--g-ease, cubic-bezier(.25,.8,.25,1)), box-shadow var(--g-dur-fast, .22s) var(--g-ease, cubic-bezier(.25,.8,.25,1)), background var(--g-dur-fast, .22s) var(--g-ease, cubic-bezier(.25,.8,.25,1)); }
.tw .tw-cta:hover { background: var(--g-btn-hover, linear-gradient(to bottom, #8658BD, #6A3699)); transform: translateY(-1px); }
.tw .tw-cta:active { background: var(--g-btn-press, linear-gradient(to bottom, #6C419F, #52277A)); transform: scale(.985); }
.tw .tw-cta:focus-visible { outline: 2px solid var(--v5-focus, #E5BF73); outline-offset: 3px; }
.tw .tw-arr { transition: transform var(--tw-dur) var(--tw-ease); }
.tw .tw-cta:hover .tw-arr { transform: translateX(3px); }
.tw .tw-fine { margin: 14px 0 0; font-size: var(--fs-caption); line-height: 1.45; color: var(--tw-sub); }
.tw .tw-fine a { color: var(--tw-acc); text-underline-offset: 3px; }
.tw--dialog .tw-fine a { color: inherit; }
.tw--compact .tw-pane-lead { font-size: var(--fs-lead); margin-bottom: 14px; }
.tw--compact .tw-steps { gap: 9px; margin-bottom: 16px; }
.tw--compact .tw-tabs { margin-bottom: 18px; }
.tw--compact .tw-foot { padding-top: 14px; }

/* The enhancement: one pane at a time, switched by the radios. */
@supports selector(:has(*)) {
  .tw .tw-tabs { display: grid; }
  .tw .tw-tabs::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 7px); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(26,13,46,.08), 0 8px 20px -10px rgba(26,13,46,.35); transition: transform var(--tw-dur) var(--tw-ease), background-color var(--tw-dur) var(--tw-ease); }
  .tw .tw-tabs:has([value=match]:checked)::before { transform: translateX(calc(100% + 4px)); background: var(--tw-deep); }
  .tw .tw-pane-n { display: none; }
  .tw .tw-panes { gap: 0; }
  .tw .tw-pane { grid-area: 1 / 1; transition: opacity var(--tw-dur) var(--tw-ease), transform var(--tw-dur) var(--tw-ease), visibility 0s; }
  .tw:has(.tw-tabs [value=self]:checked) .tw-pane--match,
  .tw:has(.tw-tabs [value=match]:checked) .tw-pane--self { opacity: 0; transform: translateY(6px); visibility: hidden; pointer-events: none; transition: opacity var(--tw-dur) var(--tw-ease), transform var(--tw-dur) var(--tw-ease), visibility 0s var(--tw-dur); }
}
@media (prefers-reduced-motion: reduce) {
  .tw .tw-tabs::before, .tw .tw-pane, .tw .tw-tab-in, .tw .tw-cta, .tw .tw-arr { transition: none; }
  .tw .tw-cta:hover, .tw .tw-cta:hover .tw-arr { transform: none; }
}

/* routes(): the compact card over one couple photograph. */
.tw-stage { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; margin-top: clamp(14px, 2.4vh, 26px); }
.tw-stage .tw-photo { position: relative; grid-column: 1 / 9; grid-row: 1; height: clamp(380px, 60vh, 540px); border-radius: 28px; overflow: hidden; }
.tw-stage .tw-photo .tv-pic { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; aspect-ratio: auto; border-radius: 0; }
.tw-stage .tw-photo picture, .tw-stage .tw-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--hv-pos, 50% 40%); }
.tw-stage .tw { grid-column: 7 / 13; grid-row: 1; z-index: 1; width: auto; }
@media (max-width: 1023px) {
  .tw-stage .tw-photo { grid-column: 1 / 11; }
  .tw-stage .tw { grid-column: 5 / 13; }
}
@media (max-width: 767px) {
  .tw-stage { display: block; }
  .tw-stage .tw-photo { height: 190px; border-radius: 22px; }
  .tw-stage .tw { margin: -44px 8px 0; }
  .tw .tw-foot { flex-direction: column; align-items: stretch; }
  .tw .tw-cta { justify-content: center; }
  .tw--compact .tw-pane-lead { font-size: var(--fs-lead); }
  .tw .tw-st strong { font-size: var(--fs-small); }
  .tw .tw-st span { font-size: var(--fs-caption); }
}
