/* cosign.link pages (W1–W5). Colors and type match lib/theme/. */

@font-face { font-family: 'DM Sans'; src: url(fonts/DMSans-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(fonts/DMSans-Italic.ttf) format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(fonts/DMSans-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(fonts/DMSans-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(fonts/DMSans-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url(fonts/DMMono-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --bg-app: #ffffff;
  --bg-surface: #ffffff;
  --bg-tint: #efe8fe;
  --bg-tint-soft: #f7f4fd;
  --bg-brand: #7941f4;
  --bg-brand-deep: #533bc1;
  --bg-dark: #0d0327;
  --bg-pass: #ecebf0;
  --bg-input: rgba(118, 118, 128, 0.08);
  --text-primary: #0d0327;
  --text-secondary: rgba(13, 3, 39, 0.85);
  --text-tertiary: rgba(13, 3, 39, 0.7);
  --text-caption: rgba(13, 3, 39, 0.6);
  --text-brand: #5b2fd6;
  --text-pass: #2e2b38;
  --border-subtle: rgba(13, 3, 39, 0.06);
  --border-strong: rgba(13, 3, 39, 0.12);
  --wash: #c56eff;
  --sans: 'DM Sans', -apple-system, system-ui, sans-serif;
  --mono: 'DM Sans', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* Classes like .field set display, which would beat the hidden attribute (the paste field hides once a song is picked). */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg-app);
  color: var(--text-primary);
  font: 400 15px/20px var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }

/* clip, not just hidden: a hidden box can still be scrolled sideways (by focus or a badge popping in), which slid the page under the wider cover wash. */
.page { max-width: 430px; margin: 0 auto; padding: 12px 16px 40px; position: relative; overflow: hidden; overflow: clip; min-height: 100vh; }
.wash { position: absolute; left: -100px; right: -100px; top: 40px; height: 480px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--wash) 45%, transparent), transparent); pointer-events: none; z-index: 0; }
.page > *:not(.wash) { position: relative; z-index: 1; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; height: 32px; margin: 0 4px 20px; }
.header img { height: 23px; display: block; }
.chip-link { background: var(--bg-tint); color: var(--text-brand); font-weight: 600; font-size: 14px; line-height: 18px; padding: 7px 12px; border-radius: 999px; text-decoration: none; }

/* Icons are the app's SVGs used as masks so they take the text color. */
.icon { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.i-link { --src: url(icons/link.svg); }
.i-search { --src: url(icons/search.svg); }
.i-check { --src: url(icons/check.svg); }
.i-clock { --src: url(icons/clock.svg); }
.i-ear { --src: url(icons/ear.svg); }
.i-out { --src: url(icons/out.svg); }
.i-close { --src: url(icons/close.svg); }

/* People */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; background: linear-gradient(135deg, #c56eff, #7941f4 55%, #533bc1); }
.avatar.s { width: 28px; height: 28px; font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; margin: 0 4px; font-weight: 600; font-size: 17px; line-height: 22px; }
.who.center { justify-content: center; font-size: 15px; font-weight: 400; gap: 8px; }
.who.center b { font-weight: 600; }

h1 { font-size: 30px; line-height: 34px; letter-spacing: -0.6px; font-weight: 700; margin: 12px 4px 22px; overflow-wrap: anywhere; }
/* Headings (and the put-on title) wrap evenly, so a short one ("No one has that username yet", "Coming soon to the App Store") never leaves one word on its own line. */
h1, h2, .title { text-wrap: balance; }
/* Body text avoids a lone last word too ("You hear every / one."), where the browser can. */
p, li { text-wrap: pretty; }
.label { font-weight: 600; font-size: 16px; line-height: 22px; margin: 0 4px 8px; }

/* Fields */
.field { display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 16px; min-height: 48px; padding: 0 14px; margin-bottom: 12px; }
.field.tall { min-height: 52px; }
.field .icon { color: var(--text-tertiary); }
.field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; padding: 13px 0; text-overflow: ellipsis; }
.field input::placeholder { color: var(--text-caption); }
/* "Paste a Spotify, Apple Music or YouTube link" fits the paste field at full width; narrower phones get it a size down. */
@media (max-width: 429px) { .field.tall input::placeholder { font-size: 14px; } }
.field:focus-within { border-color: var(--bg-brand); background: #fff; }

.results { list-style: none; margin: -4px 0 12px; padding: 6px; background: #fff; border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 10px 28px -12px rgba(83, 59, 193, 0.22); }
.results li button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px; border: 0; background: none; text-align: left; border-radius: 10px; cursor: pointer; }
.results li button:active, .results li button:hover { background: var(--bg-tint-soft); }
.results .empty { padding: 12px; color: var(--text-caption); font-size: 14px; }

.cover { border-radius: 10px; object-fit: cover; background: var(--bg-tint); flex: none; display: block; }
.t { font-weight: 600; font-size: 16px; line-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s { color: var(--text-tertiary); font-size: 14px; line-height: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s i { font-style: italic; }
.stack { min-width: 0; flex: 1; }

.picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-tint-soft); border: 1.5px solid var(--bg-brand); border-radius: 16px; margin-bottom: 12px; }
.picked .clear { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-tint); color: var(--text-brand); display: grid; place-items: center; cursor: pointer; }
.picked .clear .icon { width: 14px; height: 14px; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border: 0; border-radius: 999px; font-weight: 600; font-size: 17px; cursor: pointer; text-decoration: none; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--bg-brand); color: #fff; box-shadow: 0 10px 24px rgba(121, 65, 244, 0.36); }
.btn.pass { background: var(--bg-pass); color: var(--text-pass); }
.btn.out { background: #fff; border: 1px solid var(--border-strong); height: 48px; font-size: 16px; color: var(--text-primary); margin-bottom: 8px; }
.btn.out .icon { width: 14px; height: 14px; color: var(--text-tertiary); }
.btn[aria-disabled='true'] { opacity: 0.4; box-shadow: none; cursor: default; }
.verdict { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.verdict .pass { flex: 0 0 92px; height: 48px; }
.verdict .primary { height: 60px; }
.verdict .primary .icon { width: 20px; height: 20px; }

.fine { text-align: center; font: 400 11px/14px var(--mono); color: var(--text-caption); margin: 14px 0 0; }
.small { text-align: center; font-size: 13px; line-height: 17px; color: var(--text-tertiary); margin: 12px 0; }
.fine a { color: var(--text-tertiary); font-weight: 600; }
.fine + .fine { margin-top: 6px; }
/* Privacy policy · Terms, at the foot of the link and invite pages. */
.legal { text-align: center; font-size: 12px; line-height: 16px; color: var(--text-caption); margin: 22px 0 0; }
.legal a { color: var(--text-tertiary); font-weight: 600; }
.error { color: #b3261e; font-size: 14px; line-height: 18px; margin: -4px 4px 12px; }

/* Put-on (W3, W4) */
.hero { position: relative; width: 210px; height: 210px; margin: 16px auto 20px; }
.hero::before { content: ''; position: absolute; inset: 40px 16px -8px; border-radius: 40px; background: var(--wash); filter: blur(24px); opacity: 0.7; }
.hero img, .hero .cover { position: relative; width: 210px; height: 210px; border-radius: 22px; }
.badge { position: absolute; right: -14px; bottom: -14px; width: 52px; height: 52px; border-radius: 50%; background: var(--bg-brand); border: 4px solid #fff; display: grid; place-items: center; color: #fff; animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.badge .icon { width: 24px; height: 24px; }
/* "Album · 2016 · 17 tracks" or "A lyric from" over the title, like the app's cards. Songs have none. */
.eyebrow { text-align: center; color: var(--text-brand); font-weight: 600; font-size: 14px; line-height: 18px; margin: 0 0 4px; overflow-wrap: anywhere; }
.title { text-align: center; font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -0.4px; margin: 0; overflow-wrap: anywhere; }
.sub { text-align: center; color: var(--text-tertiary); font-size: 15px; margin: 4px 0 14px; }
.note { display: flex; align-items: center; gap: 10px; background: var(--bg-tint); border-radius: 16px; padding: 14px; margin-bottom: 14px; font-style: italic; font-size: 16px; line-height: 21px; color: var(--text-secondary); overflow-wrap: anywhere; }
.done { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-brand); font-weight: 600; font-size: 15px; min-height: 40px; margin: 14px 0 12px; }
.done .icon { width: 14px; height: 14px; }
.done.big { min-height: 56px; margin: 0; font-size: 16px; }
.done.quiet { color: var(--text-tertiary); }

/* Sent (W2) and closed (W5) */
.check { width: 60px; height: 60px; border-radius: 50%; background: var(--bg-brand); color: #fff; display: grid; place-items: center; margin: 24px auto 18px; animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.check .icon { width: 30px; height: 30px; }
.sent-title { text-align: center; font-size: 22px; line-height: 27px; font-weight: 600; margin: 0; }
.sent-sub { text-align: center; color: var(--text-secondary); font-size: 16px; margin: 8px 0 30px; }
.echo { display: flex; gap: 12px; align-items: center; background: var(--bg-tint-soft); border-radius: 16px; padding: 10px 12px; margin-bottom: 32px; }
.closed { background: var(--bg-tint-soft); border-radius: 16px; padding: 16px; margin: 4px 0 20px; }
.closed .pill { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-input); border-radius: 999px; padding: 5px 10px; font: 400 12px/15px var(--mono); color: var(--text-secondary); }
.closed .pill .icon { width: 14px; height: 14px; }
.closed h2 { font-size: 17px; line-height: 22px; margin: 14px 0 6px; }
.closed p { margin: 0; color: var(--text-secondary); font-size: 15px; }
.closed h2:first-child { margin-top: 0; }

/* Get Cosign */
.get { background: var(--bg-dark); color: #fff; border-radius: 24px; padding: 22px 20px 20px; position: relative; overflow: hidden; box-shadow: 0 18px 36px -18px rgba(83, 59, 193, 0.7); }
.get::after { content: ''; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(closest-side, rgba(121, 65, 244, 0.75), transparent); pointer-events: none; }
.get > * { position: relative; z-index: 1; }
.get img { height: 21px; display: block; }
.get h2 { font-size: 24px; line-height: 29px; margin: 16px 0 6px; }
.get p { margin: 0 0 18px; color: rgba(255, 255, 255, 0.78); font-size: 15px; }
.get.spring { animation: rise 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.get.compact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 20px; margin-top: 18px; }
.get.compact strong { font-size: 18px; line-height: 22px; font-weight: 600; }
.get.compact .btn { flex: none; width: auto; height: 44px; padding: 0 18px; font-size: 15px; white-space: nowrap; }
/* No App Store link yet: "Coming soon to the App Store" in place of the button, on the dark card. */
.get .soon { margin: 0; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.8); font-size: 16px; }
.get.compact.wrap { flex-wrap: wrap; }
.get.compact.wrap .soon { flex: 1 1 100%; height: 44px; font-size: 15px; }

/* Invite (cosign.link/{handle}) */
.person { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 20px 0 0; }
.person .ring { position: relative; width: 104px; height: 104px; margin-bottom: 14px; }
.person .ring::before { content: ''; position: absolute; inset: 22px 6px -8px; border-radius: 50%; background: var(--wash); filter: blur(22px); opacity: 0.75; }
.avatar.xl { position: relative; width: 104px; height: 104px; font-size: 42px; font-weight: 700; border: 4px solid #fff; box-shadow: 0 12px 28px -14px rgba(83, 59, 193, 0.55); }
img.avatar { object-fit: cover; background: var(--bg-tint); }
.person .name { font-size: 22px; line-height: 27px; font-weight: 700; letter-spacing: -0.2px; margin: 0; max-width: 100%; overflow-wrap: anywhere; }
.person .handle { color: var(--text-tertiary); font-size: 15px; line-height: 20px; margin: 2px 0 0; max-width: 100%; overflow-wrap: anywhere; }
.invite-h { text-align: center; font-size: 28px; line-height: 32px; margin: 28px 4px 8px; }
.lede { text-align: center; color: var(--text-secondary); font-size: 16px; line-height: 22px; margin: 0 8px 26px; overflow-wrap: anywhere; }
.soon { display: flex; align-items: center; justify-content: center; height: 56px; margin: 0; border-radius: 999px; background: var(--bg-tint-soft); border: 1px solid var(--border-subtle); color: var(--text-tertiary); font-weight: 600; font-size: 16px; }
.missing + .btn.out { margin-top: 8px; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--text-caption); font-size: 14px; }
.missing { text-align: center; padding: 40px 12px 28px; }
.missing h1 { margin: 0 0 8px; font-size: 26px; line-height: 30px; }
.missing p { margin: 0; color: var(--text-secondary); }

@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Terms, Privacy and Help */
.doc h1 { margin-bottom: 6px; }
.doc .updated { margin: 0 4px 22px; color: var(--text-caption); font-size: 14px; line-height: 19px; }
.doc h2 { font-size: 19px; line-height: 24px; font-weight: 700; margin: 30px 4px 8px; }
.doc p, .doc li { font-size: 16px; line-height: 24px; color: var(--text-secondary); }
.doc p { margin: 0 4px 12px; }
.doc ul { margin: 0 4px 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--text-brand); font-weight: 600; }
.doc .draft { background: #fff3c4; color: #5c4400; border-radius: 12px; padding: 10px 14px; margin: 0 4px 20px; font-size: 14px; line-height: 20px; }
.doc .todo { background: #fff3c4; color: #5c4400; border-radius: 4px; padding: 0 4px; font-weight: 600; }
.docs { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 4px 0; }
