/* ---------------------------------------------------------------- base */

:root {
  --ink: #16161a;
  --ink-soft: #5c6068;
  --line: rgba(20, 24, 32, 0.09);
  --accent: #e8503a;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(18, 24, 40, .05), 0 4px 14px rgba(18, 24, 40, .06);
  --shadow-md: 0 2px 6px rgba(18, 24, 40, .07), 0 18px 44px rgba(18, 24, 40, .11);
  --shadow-cover: 0 3px 8px rgba(20, 26, 44, .13), 0 14px 34px rgba(20, 26, 44, .16);
  /* System stacks — no third-party font requests. Self-host if you add one. */
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* A class-level display rule beats the UA stylesheet's [hidden] rule, so the
   modals below need this or they render on page load. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: #f2f6f9;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------- the sky */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 6% 0%,   rgba(226, 232, 176, .60), transparent 60%),
    radial-gradient(55% 50% at 94% 12%, rgba(173, 208, 234, .62), transparent 62%),
    radial-gradient(70% 45% at 50% 104%, rgba(255, 252, 244, .95), transparent 64%),
    radial-gradient(90% 70% at 50% 30%,  rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(176deg, #e9f1f6 0%, #f6fafc 46%, #ffffff 100%);
}

/* -------------------------------------------------- floating cover art */

/* The stage clips the cover field so nothing drifts into the section below. */
.stage {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  max-height: 1180px;
  display: flex;
  flex-direction: column;
}

.field { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* Outer element: position in the field, and react to the pointer.
   Inner element: idle drift. Split so the two transforms don't overwrite
   each other — one is driven by CSS animation, the other by rAF. */
.cover {
  position: absolute;
  will-change: transform;
}
.cover-inner {
  width: 100%; height: 100%;
  border-radius: 22%;
  overflow: hidden;
  background: #dfe5ea;
  box-shadow: var(--shadow-cover);
  animation: drift var(--dur, 15s) ease-in-out var(--delay, 0s) infinite alternate;
  transition: box-shadow .3s ease;
  will-change: transform;
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  user-select: none; -webkit-user-drag: none;
}

.cover.near .cover-inner {
  box-shadow: 0 6px 14px rgba(20, 26, 44, .18), 0 26px 54px rgba(20, 26, 44, .24);
}

@keyframes drift {
  from { transform: rotate(var(--rot)) translateY(0)      scale(1); }
  to   { transform: rotate(var(--rot2)) translateY(-18px) scale(1.015); }
}
@media (prefers-reduced-motion: reduce) {
  .cover-inner { animation: none; transform: rotate(var(--rot)); }
}

/* --------------------------------------------------------------- chrome */

.topbar {
  position: relative; z-index: 3;
  padding: 26px 34px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 27px; height: 27px; display: block; }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-word { font-family: var(--serif); font-size: 27px; letter-spacing: .1px; }

/* ----------------------------------------------------------------- hero */

.hero {
  position: relative; z-index: 3;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px 70px;
  text-align: center;
}

.badge {
  display: inline-flex; align-items: center; gap: 11px;
  align-self: center;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  padding: 7px 18px 7px 9px;
  box-shadow: var(--shadow-sm);
  font-size: 15px; color: #2c3038;
}
.badge-stack { display: inline-flex; }
.badge-stack span {
  width: 27px; height: 27px; border-radius: 50%;
  border: 2px solid #fff; margin-left: -9px;
  background-size: cover; background-position: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
.badge-stack span:first-child { margin-left: 0; }
.badge-text strong { font-weight: 600; }

.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 100px);
  line-height: .98;
  text-wrap: balance;
  letter-spacing: -.012em;
  margin: 30px 0 0;
  color: #111216;
}

/* ------------------------------------------------------------ searchbar */

.searchbar {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: min(640px, 100%);
  margin: 44px auto 0;
  background: #fff;
  border-radius: 999px;
  padding: 9px 9px 9px 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,.8);
}
.searchbar-icon { width: 26px; height: 26px; flex: 0 0 26px; }
.searchbar-icon svg { width: 100%; height: 100%; display: block; }
.searchbar input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: var(--sans); font-size: 17px; color: var(--ink);
  padding: 15px 4px;
}
.searchbar input::placeholder { color: #9aa0a9; }
.searchbar-btn {
  flex: 0 0 auto;
  border: 0; cursor: pointer;
  background: #121317; color: #fff;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  padding: 15px 26px; border-radius: 999px;
  transition: transform .15s ease, background .15s ease;
}
.searchbar-btn:hover { background: #000; transform: translateY(-1px); }
.searchbar-btn span { opacity: .75; margin-left: 3px; }

.helper { margin: 18px auto 0; font-size: 15px; color: var(--ink-soft); }
/* The one word people need to find in their own app, so it reads as a link. */
.helper .slide-link {
  color: var(--accent); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1.5px;
  text-underline-offset: 3px; text-decoration-color: rgba(232, 80, 58, .45);
  border-radius: 4px; padding: 0 1px;
  transition: text-decoration-color .15s ease, background-color .15s ease;
}
.helper .slide-link:hover { text-decoration-color: var(--accent); background: rgba(232, 80, 58, .07); }
.helper .slide-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.secondary { margin: 13px auto 0; font-size: 15px; color: var(--ink-soft); }
.secondary a { color: #1f6f4a; text-decoration: underline; text-underline-offset: 3px; }

.pills {
  list-style: none; display: flex; justify-content: center; flex-wrap: wrap;
  gap: 12px; padding: 0; margin: 30px 0 0;
}
.pills li {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px; padding: 11px 20px;
  font-size: 15px; font-weight: 500; color: #2c3038;
  box-shadow: var(--shadow-sm);
}
.tick {
  width: 20px; height: 20px; border-radius: 50%;
  background: #1f9d55; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* ------------------------------------------------------------ goal meter */

.goal { width: min(420px, 100%); margin: 26px auto 0; align-self: center; }
.goal-track {
  height: 8px; border-radius: 999px;
  background: rgba(18, 24, 40, .09); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(18, 24, 40, .06);
}
.goal-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #1f9d55, #1db954);
  transition: width .7s cubic-bezier(.2, .8, .3, 1);
}
.goal-label { margin: 11px 0 0; font-size: 14.5px; color: var(--ink-soft); text-align: center; }
.goal-label b { font-weight: 600; color: var(--ink); }
.goal.is-full .goal-fill { background: linear-gradient(90deg, #1db954, #15833c); }

.goal-sm { margin: 20px auto 24px; width: 100%; }
.goal-sm .goal-track { height: 6px; }
.goal-sm .goal-label { font-size: 13.5px; margin-top: 9px; }

/* -------------------------------------------------------------- explain */

.explain {
  position: relative; z-index: 3;
  max-width: 1000px; margin: 0 auto; padding: 40px 20px 20px;
  text-align: center;
}
.explain-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5.4vw, 68px); line-height: 1.02;
  letter-spacing: -.01em; margin: 0;
}
.explain-sub {
  max-width: 560px; margin: 22px auto 0;
  font-size: 18px; line-height: 1.6; color: var(--ink-soft);
}

.steps {
  list-style: none; padding: 0;
  margin: 62px auto 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  text-align: left;
}
.steps li {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 26px 24px 28px;
  box-shadow: var(--shadow-sm);
}
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #121317; color: #fff; font-size: 14px; font-weight: 600;
}
.steps h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 16px 0 8px; }
.steps p  { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

.slide-hint {
  display: flex; align-items: center; gap: 13px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.slide-hint svg { flex: 0 0 auto; border-radius: 10px; box-shadow: 0 4px 14px rgba(18,24,40,.14); }
.slide-hint-cap { font-size: 13px; line-height: 1.5; color: #9aa0a9; }

.foot {
  position: relative; z-index: 3;
  text-align: center; padding: 70px 20px 44px;
  font-size: 13.5px; color: #8b9099;
}
.foot p { margin: 0; }

/* ------------------------------------------------------- sheet / step 2 */

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 20, 28, .42);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.sheet-card {
  position: relative;
  width: min(480px, 100%);
  background: #fff; border-radius: 26px;
  padding: 38px 34px 34px;
  box-shadow: 0 30px 80px rgba(10, 14, 24, .3);
  animation: rise .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: .6 } to { transform: none; opacity: 1 } }

.sheet-x {
  position: absolute; top: 14px; right: 16px;
  border: 0; background: transparent; cursor: pointer;
  font-size: 27px; line-height: 1; color: #b4b9c1;
}
.sheet-card h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0; }
.sheet-sub { margin: 9px 0 24px; font-size: 15px; color: var(--ink-soft); line-height: 1.5; }

#step2 label { display: block; margin-bottom: 16px; }
#step2 label > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
#step2 label > span em { font-style: normal; font-weight: 400; color: #9aa0a9; }
#step2 input[type="text"], #step2 input[type="url"] {
  width: 100%; border: 1px solid #dde1e7; border-radius: 13px;
  padding: 13px 15px; font-family: var(--sans); font-size: 15.5px; color: var(--ink);
  outline: 0; transition: border-color .15s ease, box-shadow .15s ease;
}
#step2 input[type="text"]:focus, #step2 input[type="url"]:focus {
  border-color: #121317; box-shadow: 0 0 0 3px rgba(18,19,23,.08);
}
#step2 small { display: block; margin-top: 6px; font-size: 13px; color: #9aa0a9; }


.plat { display: flex; gap: 7px; margin-bottom: 9px; }
.plat-opt { margin: 0 !important; }
.plat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plat-opt span {
  display: inline-block; cursor: pointer;
  border: 1px solid #dde1e7; border-radius: 999px;
  padding: 7px 15px; font-size: 13.5px; color: #3a3f47;
  transition: all .14s ease;
}
.plat-opt input:checked + span { background: #121317; border-color: #121317; color: #fff; }

.check { display: flex !important; gap: 10px; align-items: flex-start; margin: 4px 0 20px !important; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #121317; flex: 0 0 16px; }
.check span { font-size: 14px; line-height: 1.5; color: #3a3f47; font-weight: 400 !important; margin: 0 !important; }

.err {
  background: #fdeceb; color: #a32a1c; border-radius: 11px;
  padding: 11px 14px; font-size: 14px; margin: 0 0 14px;
}

.submit {
  width: 100%; border: 0; cursor: pointer;
  background: #121317; color: #fff;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  padding: 16px; border-radius: 999px;
  transition: background .15s ease;
}
.submit:hover { background: #000; }
.submit[disabled] { opacity: .55; cursor: default; }

/* ----------------------------------------------------------------- done */

.done {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16, 20, 28, .42); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease;
}
.done-card {
  width: min(420px, 100%); background: #fff; border-radius: 26px;
  padding: 44px 34px 38px; text-align: center;
  box-shadow: 0 30px 80px rgba(10, 14, 24, .3);
  animation: rise .22s cubic-bezier(.2,.8,.3,1);
}
.done-mark {
  width: 54px; height: 54px; border-radius: 50%;
  background: #1f9d55; color: #fff; font-size: 27px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.done-card h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; margin: 0 0 10px; }
.done-card p  { margin: 0 0 24px; font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }
.done-ask {
  margin: 0 0 18px; font-size: 15px; line-height: 1.6; color: var(--ink-soft);
}
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.done-wa { background: #25D366 !important; color: #06351a !important; font-weight: 600; }
.done-wa:hover { background: #1ebe5b !important; }

.done-share {
  display: inline-block; background: #121317; color: #fff; text-decoration: none;
  padding: 14px 26px; border-radius: 999px; font-size: 15px; font-weight: 500;
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 820px) {
  .topbar { padding: 20px 20px; }
  .hero { padding: 18px 18px 70px; }
  .headline { font-size: clamp(38px, 11vw, 56px); margin-top: 24px; }
  .searchbar { flex-wrap: wrap; border-radius: 26px; padding: 14px; gap: 10px; margin-top: 32px; }
  .searchbar-icon { display: none; }
  .searchbar input { flex: 1 1 100%; padding: 10px 6px; font-size: 16px; }
  .searchbar-btn { flex: 1 1 100%; padding: 15px; }
  .badge { font-size: 13.5px; padding: 6px 15px 6px 7px; }
  .badge-stack span { width: 23px; height: 23px; }
  .cover.hide-sm { display: none; }
  .sheet-card { padding: 30px 22px 26px; border-radius: 22px; }
  .explain { padding-top: 10px; }
  .steps { margin-top: 38px; }
}

/* ------------------------------------------------------------ your match
   Shown only to someone already in the pool. Rescored on every visit, so the
   copy says "right now" rather than implying anything settled. */

.mine-wrap { position: relative; z-index: 3; padding: 0 22px; }
.mine {
  max-width: 560px; margin: 0 auto 10px;
  background: var(--card); border-radius: 22px;
  padding: 26px 28px 24px; box-shadow: var(--shadow-md);
  text-align: left;
}
.mine-eyebrow {
  margin: 0 0 14px; font-size: 11.5px; letter-spacing: 1.6px;
  color: var(--ink-soft); font-weight: 600;
}
.mine-head { font-family: var(--serif); font-weight: 400; font-size: 38px; margin: 0 0 8px; }
.mine-sub { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }

.mine-card { display: flex; align-items: center; gap: 20px; }
.mine-score {
  font-size: 54px; font-weight: 700; letter-spacing: -2px;
  line-height: 1; color: var(--accent); flex: 0 0 auto;
}
.mine-score span { font-size: 26px; font-weight: 600; letter-spacing: 0; }
.mine-who { min-width: 0; }
.mine-handle {
  font-family: var(--serif); font-size: 34px; color: var(--ink);
  text-decoration: none; border-bottom: 2px solid rgba(232, 80, 58, .35);
  word-break: break-all;
}
.mine-handle:hover { border-bottom-color: var(--accent); }
.mine-name { margin: 5px 0 0; font-size: 14px; color: var(--ink-soft); }

.mine-label {
  margin: 22px 0 8px; font-size: 11.5px; letter-spacing: 1.6px;
  color: var(--ink-soft); font-weight: 600;
}
.mine-shared { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.mine-shared li {
  font-size: 14px; padding: 6px 12px; border-radius: 999px;
  background: #f1f4f7; color: #2b3038;
}
.mine-line { margin: 16px 0 0; font-size: 15px; line-height: 1.55; color: #2b3038; }
.mine-blend { margin: 14px 0 0; font-size: 15px; }
.mine-blend a { color: #1f6f4a; text-decoration: underline; text-underline-offset: 3px; }
.mine-foot {
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.5; color: var(--ink-soft);
}

@media (max-width: 520px) {
  .mine { padding: 22px 20px 20px; }
  .mine-card { gap: 14px; }
  .mine-score { font-size: 44px; }
  .mine-handle { font-size: 27px; }
}

/* --------------------------------------------------- "already in?" lookup
   Everyone who signed up before the match panel existed has nothing stored in
   their browser, so there has to be a way to say who you are. */

.already { margin-top: 8px; }
.already a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.lookup { width: min(430px, 100%); margin: 14px auto 0; }
.lookup-row {
  display: flex; gap: 8px; background: var(--card);
  border-radius: 999px; padding: 7px 7px 7px 14px; box-shadow: var(--shadow-sm);
}
.lookup select {
  border: 0; background: transparent; font-family: var(--sans);
  font-size: 14.5px; color: var(--ink-soft); cursor: pointer; outline: none;
}
.lookup input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.lookup button {
  border: 0; cursor: pointer; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-family: var(--sans); font-size: 14.5px; font-weight: 500; padding: 9px 17px;
}
.lookup button:disabled { opacity: .55; cursor: default; }
.lookup-err { margin: 9px 0 0; font-size: 14px; color: #a32a1c; }

/* ------------------------------------------------ "already entered" section
   The hero link is easy to miss, and most traffic now is people coming back. */

.back-wrap { position: relative; z-index: 3; padding: 0 22px 70px; }
.back-in {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--card); border-radius: 24px;
  padding: 38px 30px 32px; box-shadow: var(--shadow-sm);
}
.back-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 5vw, 36px);
  margin: 0 0 12px;
}
.back-sub {
  margin: 0 auto 22px; max-width: 42ch;
  font-size: 15.5px; line-height: 1.6; color: var(--ink-soft);
}
.back-in .lookup { margin-top: 0; }
.back-in .lookup-row { box-shadow: none; border: 1px solid #e3e8ee; }
.back-foot { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-soft); }

/* "See my match" is a wide button, and inside the card on a phone it leaves
   the handle field too narrow to read what you typed. Stack it instead. */
@media (max-width: 560px) {
  .back-in .lookup-row {
    flex-wrap: wrap; border-radius: 20px; padding: 10px 12px;
  }
  .back-in .lookup-row input { flex: 1 1 110px; font-size: 16px; }
  .back-in .lookup-row button { flex: 1 0 100%; margin-top: 9px; padding: 12px 17px; }
}

/* ------------------------------------------------------- share your match */
.mine-share { margin: 18px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mine-share button {
  border: 0; cursor: pointer; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 11px 22px;
}
.mine-share button:disabled { opacity: .6; cursor: default; }
.mine-share-note { font-size: 13.5px; color: var(--ink-soft); }
