/* RSVP, password and admin screens. Same paper, ink, Jost and one Gloock
   moment as the homepage (tokens.css is the homepage's own file). Square
   corners, no colour, emphasis from size and weight only. */

*, *::before, *::after { box-sizing: border-box; }
:root { color-scheme: light; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--font-sans); font-weight: 400; font-size: var(--t-body);
  line-height: var(--lh-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.amp { font-family: var(--font-serif); font-weight: 400; letter-spacing: 0; }
a { color: inherit; }

/* ---- Primitives, as on the homepage -------------------------------- */
.label { font-weight: 500; font-size: var(--t-eyebrow); letter-spacing: 0.14em;
         text-transform: uppercase; color: var(--ink-3); margin: 0; }
.word  { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em;
         font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.02; margin: var(--s-3) 0 var(--s-6); }
.lede  { color: var(--ink-2); font-size: var(--t-body-l); line-height: 1.5; margin: 0 0 var(--s-8); }
.small { color: var(--ink-3); font-size: var(--t-small); line-height: 1.5; }
.btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 500; font-size: var(--t-eyebrow);
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--white); border: 1px solid var(--ink); border-radius: 0;
  padding: 1rem 2.25rem; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--white); }
.mono { font-family: var(--font-display); font-weight: 200; letter-spacing: 0.16em; text-transform: uppercase;
        line-height: 1.05; margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer;
        text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--ink); }

/* ---- Fields --------------------------------------------------------- */
.field { display: block; margin: 0 0 var(--s-6); }
.field > span { display: block; margin-bottom: var(--s-2); }
.input, .textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--sand); border-radius: 0; padding: .6rem 0; outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.textarea { border: 1px solid var(--sand); padding: .75rem .875rem; min-height: 6.5rem; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.error { color: var(--ink); font-size: var(--t-small); border-left: 2px solid var(--ink);
         padding: .25rem 0 .25rem .75rem; margin: 0 0 var(--s-6); }

/* ---- Page frame ----------------------------------------------------- */
/* Mirrors the homepage .nav exactly (64px, same column, same type) so the
   header doesn't shift when you move between the two pages. */
.top { height: 64px; border-bottom: 1px solid transparent; font-size: 1.0625rem;
       view-transition-name: site-header; }
.top__in { max-width: var(--max-wide); margin-inline: auto; height: 100%; padding-inline: var(--margin);
           display: flex; justify-content: space-between; align-items: center; }
.top__mark { font-weight: 700; font-size: 1em; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.top__back { font-size: var(--t-small); color: var(--ink-2); text-decoration: none;
             padding: 12px 0 12px 16px; margin: -12px 0 -12px -16px; }
.top__back:hover { color: var(--ink); }
/* Header plus page fill exactly one screen: the page takes the height the
   header leaves, so a step that fits never scrolls. */
.frame { min-height: 100svh; display: flex; flex-direction: column; }
.frame > .page { flex: 1; width: 100%; }
.page { max-width: 38rem; margin: 0 auto; padding: clamp(1.25rem, 5vw, 4rem) var(--margin) var(--s-8); }
.hint { margin: 0 0 var(--s-8); }

/* ---- Enter: a formal card on the dark band --------------------------
   Black tie stationery: 5 x 7, centred, a double rule inset from the edge
   (one weighted line, one hairline), engraved-card style. */
.room { min-height: 100svh; display: grid; place-items: center; background: var(--ink);
        padding: 5svh var(--margin); overflow: hidden; }
.walk { width: min(26rem, 100%); transform-origin: center; will-change: transform;
        opacity: 0; translate: 0 14px;
        transition: transform 1.15s cubic-bezier(.7, 0, .2, 1), opacity .9s var(--ease), translate 1.2s var(--ease); }
.room.is-ready .walk { opacity: 1; translate: 0 0; }
.invite { position: relative; width: 100%; aspect-ratio: 5 / 7; max-height: 90svh;
          display: flex; background: var(--white); color: var(--ink); text-align: center;
          box-shadow: 0 30px 80px rgba(0, 0, 0, .45); transition: box-shadow .4s ease; }
.invite::before, .invite::after { content: ''; position: absolute; pointer-events: none; transition: opacity .35s ease; }
.invite::before { inset: 14px; border: 2px solid var(--ink); }
.invite::after  { inset: 20px; border: 1px solid var(--ink); }
.invite__in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
              padding: clamp(2.5rem, 9vw, 3.5rem) clamp(2.25rem, 9vw, 3.5rem); transition: opacity .35s ease; }
/* The lockup keeps its shared left edge; the block itself is centred. */
.invite__mono { margin: 0; font-weight: inherit; }
.invite__mono .mono { display: inline-block; text-align: left; font-size: clamp(2rem, 8.5vw, 2.9rem); }
.invite__form { width: 100%; margin-top: var(--s-16); }
.invite__form .field > span { text-align: center; }
.invite__form .input { text-align: center; letter-spacing: .08em; }
.pw { position: relative; display: block; }
.pw .input { padding-inline: 3rem; letter-spacing: .03em; height: 2.875rem; }
.pw .input[type="password"] { font-size: .8125rem; letter-spacing: .32em; }
.pw__toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: none; border: 0;
              padding: .5rem 0 .5rem .5rem; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.pw__toggle:hover, .pw__toggle:focus-visible { color: var(--ink); }
.invite__form .error { text-align: center; border-left: 0; padding: 0; }
.invite__form .btn { width: 100%; margin-top: var(--s-4); }
.room.is-open .walk { transform: var(--walk); }
.room.is-open .invite { box-shadow: none; }
.room.is-open .invite__in, .room.is-open .invite::before, .room.is-open .invite::after { opacity: 0; }
@media (max-width: 520px) {
  .room { padding: 4svh 1.5rem; }
  .walk { width: min(26rem, 100%, calc(88svh * 5 / 7)); }
  .invite::before { inset: 10px; } .invite::after { inset: 15px; }
  .invite__in { padding: 2.25rem 2rem; }
  .invite__form { margin-top: var(--s-12); }
}
@media (prefers-reduced-motion: reduce) { .walk { transition: opacity .4s linear; translate: none; } }

/* Admin sign-in: a plain centred column on paper. */
.enter { min-height: 100svh; display: grid; place-items: center; padding: var(--s-16) var(--margin); }
.enter__in { width: 100%; max-width: 22rem; }
.enter form .btn { width: 100%; margin-top: var(--s-2); }

/* Page to page: the browser's own cross-document transition. The old page
   fades out, the new one rises in. Browsers without it just navigate. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .32s ease both; }
::view-transition-new(root) { animation: vt-in .7s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 14px; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; translate: none; }
}

/* Step to step inside the RSVP: each screen settles in the same way. */
.step { animation: step-in .7s var(--ease) both; }
@keyframes step-in { from { opacity: 0; translate: 0 14px; } }
@media (prefers-reduced-motion: reduce) { .step { animation: step-in .2s linear both; } }

/* ---- RSVP steps ----------------------------------------------------- */
.matches { list-style: none; padding: 0; margin: 0 0 var(--s-8); border-top: 1px solid var(--rule); }
.matches li { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
              padding: var(--s-6) 0; border-bottom: 1px solid var(--rule); }
.matches li span { font-size: 1.125rem; }
.matches .btn { padding: .75rem 1.5rem; flex: none; }

.event { border-top: 1px solid var(--ink); padding-top: var(--s-6); margin: 0 0 var(--s-12); }
.event h2 { font-weight: 300; font-size: var(--t-display-m); letter-spacing: var(--tr-display-m);
            line-height: 1.15; margin: 0 0 var(--s-4); }
.event dl { margin: 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s-2) var(--s-4); }
.event dt { font-weight: 500; font-size: var(--t-eyebrow); letter-spacing: 0.14em; text-transform: uppercase;
            color: var(--ink-3); padding-top: .2rem; }
.event dd { margin: 0; color: var(--ink-2); }

.person { padding: var(--s-6) 0; border-bottom: 1px solid var(--rule); }
.person:first-of-type { border-top: 1px solid var(--rule); }
.person__name { font-size: 1.25rem; font-weight: 400; margin: 0 0 var(--s-4); }
.choice { display: grid; grid-template-columns: 1fr 1fr; }
.choice button { font: inherit; font-size: var(--t-small); letter-spacing: .02em; cursor: pointer;
                 background: transparent; color: var(--ink-2); border: 1px solid var(--sand);
                 border-radius: 0; padding: .9rem .75rem; transition: all var(--dur-fast) var(--ease); }
.choice button + button { border-left: 0; }
.choice button:hover { color: var(--ink); border-color: var(--ink); }
.choice button + button:hover { border-left: 1px solid var(--ink); margin-left: -1px; }
.choice button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

.plus { padding: var(--s-6) 0; border-bottom: 1px solid var(--rule); }
.plus .choice { margin-bottom: var(--s-6); }
.qs { margin: var(--s-12) 0 var(--s-8); }
.qs h3 { font-weight: 300; font-size: var(--t-title); margin: 0 0 var(--s-6); }
.actions { display: flex; gap: var(--s-6); align-items: center; flex-wrap: wrap; }

.summary { list-style: none; padding: 0; margin: 0 0 var(--s-8); border-top: 1px solid var(--rule); }
.summary li { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0;
              border-bottom: 1px solid var(--rule); }
.summary li b { font-weight: 400; }
.summary li span { color: var(--ink-2); text-align: right; }
.summary__extra { margin: 0 0 var(--s-8); }
.summary__extra p { margin: 0 0 var(--s-2); color: var(--ink-2); }
.test-note { margin-top: var(--s-16); padding-top: var(--s-4); border-top: 1px dashed var(--sand); }

@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .row2--keep { grid-template-columns: 1fr 1fr; gap: var(--s-4); }
  .word { font-size: 2.5rem; margin: var(--s-2) 0 var(--s-4); }
  .lede { font-size: 1.0625rem; margin-bottom: var(--s-6); }
  .hint { margin-bottom: var(--s-6); }
  .event dl { grid-template-columns: 1fr; gap: 0; }
  .event dd { margin-bottom: var(--s-3); }
  .matches li { flex-direction: column; align-items: flex-start; }
  .actions .btn { width: 100%; text-align: center; }
}

/* ---- Admin ---------------------------------------------------------- */
.admin { max-width: 72rem; margin: 0 auto; padding: var(--s-8) var(--margin) var(--s-24); font-size: .9375rem; }
.admin h1 { font-weight: 300; font-size: var(--t-display-m); margin: 0 0 var(--s-6); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1px;
         background: var(--rule); border: 1px solid var(--rule); margin: 0 0 var(--s-8); }
.stats div { background: var(--white); padding: var(--s-4); }
.stats b { display: block; font-weight: 300; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; margin: 0 0 var(--s-6); }
.toolbar .btn { padding: .7rem 1.25rem; }
.toolbar .input { max-width: 16rem; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: var(--t-eyebrow); letter-spacing: .12em;
          text-transform: uppercase; color: var(--ink-3); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--ink); }
.tbl td { padding: var(--s-3); border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr.is-test td { color: var(--ink-3); }
.tbl .st { white-space: nowrap; }
.tbl .muted { color: var(--ink-3); }
.tbl-wrap { overflow-x: auto; }
.editor { border: 1px solid var(--ink); padding: var(--s-6); margin: 0 0 var(--s-8); background: var(--white); }
.editor .grow { display: grid; grid-template-columns: 1fr 1fr 1.4fr 9rem 2rem; gap: var(--s-3); align-items: end; margin-bottom: var(--s-2); }
.editor select { font: inherit; border: 1px solid var(--sand); background: transparent; padding: .5rem; border-radius: 0; }
.editor .x { background: none; border: 0; font-size: 1.25rem; cursor: pointer; color: var(--ink-3); }
.check { display: inline-flex; gap: var(--s-2); align-items: center; }
@media (max-width: 760px) { .editor .grow { grid-template-columns: 1fr 1fr; } }
