/* =========================================================
   Moving parts, sign in or join: one screen, split in two.
   The library's own recordings on one side, the form on the other.
   ========================================================= */

.auth-page {
  --wall-in: clamp(6px, .6vw, 10px);
  --wall-r: clamp(14px, 1.4vw, 22px);
  --wall-gap: clamp(8px, .8vw, 12px);
  --col-w: 400px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(500px, 1fr); min-height: 100svh;
}

/* ---------- the nav of a passage: the logo home, and a way back ---------- */
.auth-nav { grid-template-columns: 1fr auto; }
.auth-exit { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 500; font-size: 15px; letter-spacing: -.015em; line-height: 1.4; color: var(--muted); transition: color var(--mi-fast); }
.auth-exit svg { width: 14px; height: 14px; flex: none; transition: transform var(--mi-dur) var(--mi-ease); }
/* the trace of the nav's words, the same line as base.css draws */
.auth-exit span { background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 100% 100%; background-size: 0 1px; transition: background-size var(--mi-dur) var(--mi-ease); }
@media (hover: hover) {
  .auth-exit:hover { color: var(--text); }
  .auth-exit:hover span { background-size: 100% 1px; }
  .auth-exit:hover svg { transform: translateX(calc(var(--mi-glide) * -1)); }
}

/* ---------- the form side ---------- */
.auth-side { grid-column: 2; grid-row: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; min-height: 100svh; padding: 72px var(--gut) clamp(16px, 2.6vh, 28px); }
.auth-card { align-self: center; width: 100%; max-width: var(--col-w); padding: clamp(8px, 2vh, 24px) 0; }
.auth-step[hidden] { display: none; }
.auth-step:focus { outline: none; }

/* above the title: a word on where the link leads, or the plan picked on the pricing page */
.auth-top { display: flex; align-items: center; min-height: 30px; }
.auth-eyebrow { color: var(--label); }
.auth-eyebrow[hidden], .auth-pill[hidden] { display: none; }
.auth-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; }
.auth-pill::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.auth-pill b { color: var(--text); font-weight: 500; }
.auth-pill [data-plan-price] { overflow: hidden; text-overflow: ellipsis; }
.auth-pill .u { color: var(--text); margin-left: 2px; }

.auth-card h1 { font-weight: 430; font-size: clamp(38px, 3.3vw, 52px); line-height: .96; letter-spacing: -.055em; margin-top: 14px; }
.auth-card h1 .m { color: var(--muted); }
.auth-card .sub { margin-top: 14px; font-size: 16px; line-height: 1.45; max-width: 38ch; }
.auth-head.is-in { animation: auth-in .6s var(--mi-ease) both; }

.auth-google, .auth-submit { width: 100%; height: 48px; }
.auth-google { margin-top: clamp(22px, 3.4vh, 32px); }
.auth-google .g { width: 17px; height: 17px; flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--label); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.auth-input { display: block; width: 100%; height: 50px; padding: 0 16px; border-radius: 12px; background: color-mix(in srgb, var(--text) 3.5%, transparent); border: 1px solid var(--line-strong); font-size: 16px; color: var(--text); transition: border-color var(--mi-fast), box-shadow var(--mi-fast), background-color var(--mi-fast); }
.auth-input::placeholder { color: var(--label); }
/* the field's frame is its focus ring: brighter, with a soft halo */
.auth-input:focus { outline: none; border-color: rgba(255, 255, 255, .6); background: color-mix(in srgb, var(--text) 5.5%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent); }
.auth-input[aria-invalid="true"] { border-color: var(--text); border-width: 1.5px; }
.auth-err { font-size: 14px; line-height: 1.4; color: var(--text); }
.auth-err:not(:empty) { display: flex; gap: 8px; align-items: baseline; margin-top: 10px; }
.auth-err:not(:empty)::before { content: "!"; flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--text); color: var(--bg); font: 600 11px/1 "Instrument Sans", sans-serif; transform: translateY(2px); }
.auth-submit { margin-top: 12px; }
/* the robot check, when the site has its key (AB-122) */
.auth-turnstile { margin-top: 12px; }
.auth-turnstile:empty { display: none; }
.auth-legal { margin-top: 14px; color: var(--label); font-size: 13px; line-height: 1.45; }
.auth-note { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.auth-note:empty { display: none; }
.auth-switch { margin-top: clamp(20px, 3vh, 28px); padding-top: clamp(16px, 2.4vh, 22px); border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.auth-switch .u { color: var(--text); }

/* the next state: the link is on its way */
.auth-mail { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); }
.auth-mail svg { width: 22px; height: 22px; }
.auth-kick { color: var(--label); margin-top: 22px; }
.auth-h2 { font-weight: 430; font-size: clamp(38px, 3.3vw, 52px); line-height: .96; letter-spacing: -.055em; margin-top: 10px; }
.auth-p { color: var(--muted); font-size: 16px; line-height: 1.5; margin-top: 14px; overflow-wrap: anywhere; }
.auth-p b { color: var(--text); font-weight: 500; }
.auth-dim { color: var(--label); font-size: 15px; }
.auth-row { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 24px; }
.auth-back { font-size: 15px; color: var(--text); }
/* a state settles in rather than snapping */
.auth-step.is-in { animation: auth-in .6s var(--mi-ease) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(10px); } }

/* under the form, the free account in one quiet line */
.auth-foot { width: 100%; max-width: var(--col-w); color: var(--label); font-size: 13px; line-height: 1.45; }
.auth-foot[hidden] { display: none; }
.auth-foot .u { color: var(--muted); white-space: nowrap; }

/* ---------- the wall: the library's recordings, slow columns running both ways ---------- */
.auth-wall { grid-column: 1; grid-row: 1; position: sticky; top: 0; height: 100svh; padding: var(--wall-in) 0 var(--wall-in) var(--wall-in); }
.wall-box { position: relative; height: 100%; border-radius: var(--wall-r); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.wall-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--wall-gap); padding: 0 var(--wall-gap); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 6%, #000 24%, #000 76%, transparent 94%); mask-image: linear-gradient(to bottom, transparent 6%, #000 24%, #000 76%, transparent 94%); }
.wall-col { position: relative; min-width: 0; }
.wall-track { display: flex; flex-direction: column; will-change: transform; animation: wall-y var(--wall-dur, 90s) linear var(--wall-delay, 0s) infinite; }
.wall-col:nth-child(2) .wall-track { animation-direction: reverse; }
@keyframes wall-y { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -50%, 0); } }
@keyframes wall-x { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
/* a card of the library, as its page shows it: the recording, its name, its family */
.wall-tile { flex: none; margin-bottom: var(--wall-gap); padding: 6px 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.wall-clip { position: relative; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background: var(--preview); }
.wall-clip img, .wall-clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wall-clip video { opacity: 0; transition: opacity var(--mi-dur) var(--mi-ease); }
/* the cards at rest sit a little back, the ones playing come forward */
.wall-clip::after { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--bg); opacity: .3; transition: opacity var(--mi-dur) var(--mi-ease); }
.wall-tile.is-live video { opacity: 1; }
.wall-tile.is-live .wall-clip::after { opacity: 0; }
.wall-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 4px 10px; font-size: 13.5px; letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; }
.wall-meta b { font-weight: 440; overflow: hidden; text-overflow: ellipsis; }
.wall-meta .mono { flex: none; color: var(--label); font-size: 10px; }
.wall-cap { position: absolute; z-index: 1; left: calc(var(--gut) - var(--wall-in)); right: calc(var(--gut) - var(--wall-in)); bottom: clamp(14px, 2.2vh, 22px); display: flex; justify-content: space-between; gap: 16px; color: var(--label); }
.wall-cap b { color: var(--text); font-weight: 500; }

@media (max-width: 1180px) {
  .wall-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-col:nth-child(3) { display: none; }
}

/* ---------- a phone: the form first, the wall a band above it ---------- */
@media (max-width: 820px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-wall { grid-column: 1; grid-row: 1; position: relative; height: auto; padding: 64px 0 0; }
  .wall-box { height: clamp(92px, 27vw, 124px); border: 0; border-radius: 0; background: none; }
  .wall-cols { display: block; padding: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent); }
  .wall-col { height: 100%; }
  .wall-col + .wall-col { display: none; }
  .wall-track { flex-direction: row; width: max-content; height: 100%; animation-name: wall-x; }
  .wall-tile { height: 100%; margin: 0 var(--wall-gap) 0 0; padding: 4px; border-radius: 10px; }
  .wall-clip { height: 100%; border-radius: 6px; }
  .wall-meta, .wall-cap { display: none; }
  .auth-side { grid-column: 1; grid-row: 2; min-height: 0; padding: 20px var(--gut) 28px; row-gap: 28px; }
  .auth-card { padding: 0; }
  .auth-card h1, .auth-h2 { font-size: clamp(36px, 10.4vw, 46px); }
}

@media (prefers-reduced-motion: reduce) {
  .wall-track { animation: none; }
  .auth-step.is-in, .auth-head.is-in { animation: none; }
  .auth-input, .auth-exit, .auth-exit svg, .auth-exit span, .wall-clip video, .wall-clip::after { transition: none; }
  .wall-clip::after { opacity: .18; }
  .auth-exit:hover svg { transform: none; }
}
