/* Self-hosted, subset to Latin. No third-party request on page load, which
   also means no font call leaking who visits an invite link. */
@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("fonts/karla.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("fonts/caveat.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* =========================================================================
   A Secret Crush
   Palette is drawn from the object the whole site is about: a sealed letter.
   Ink, wax, foil, and the blush of the paper underneath.
   ========================================================================= */

:root {
  --ink:      #160E1E;   /* the page: ink at night */
  --ink-2:    #1F1429;   /* a raised surface */
  --ink-3:    #291836;   /* a pressed one */
  --velvet:   #35203F;   /* hairlines */
  --wax:      #C6304A;
  --wax-hi:   #E4657A;
  --wax-lo:   #87182E;
  --blush:    #F3D7DC;   /* body text */
  --muted:    #A48FA8;
  --foil:     #D9B36C;
  --good:     #6FBF9B;

  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --body:    "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand:    "Caveat", "Segoe Script", cursive;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 78% -12%, rgba(198, 48, 74, .16), transparent 62%),
    radial-gradient(760px 520px at 8% 108%, rgba(217, 179, 108, .07), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  color: var(--blush);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--wax-hi); text-decoration-color: rgba(228, 101, 122, .4); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--foil);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip {
  position: absolute; left: -9999px;
  background: var(--wax); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip:focus { left: 12px; top: 12px; z-index: 100; }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---- type -------------------------------------------------------------- */

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }

.eyebrow {
  font-family: var(--body);
  font-size: .69rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}

/* The pseudonym is the one thing a crush ever sees of you, so it is set in a
   hand rather than in the interface face. It reads as a signature. */
.hand { font-family: var(--hand); font-size: 1.45em; line-height: 1; color: var(--foil); }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--velvet);
  background: rgba(22, 14, 30, .82);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--blush); }
.brand img { display: block; }
.brand-wordmark { display: block; height: 34px; width: auto; }

.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.navlink {
  font-size: .9rem; padding: 8px 13px; border-radius: 999px;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.navlink:hover { color: var(--blush); background: var(--ink-2); }
.navlink.on { color: var(--blush); background: var(--ink-3); }
.navlink .count {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  background: var(--wax); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}

.app { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px); }

.foot {
  border-top: 1px solid var(--velvet);
  padding: 28px clamp(16px, 4vw, 40px);
  font-size: .84rem;
}
.foot p { margin: 0 0 4px; }

.booting { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--wax);
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---- buttons ----------------------------------------------------------- */

.btn {
  font-family: var(--body); font-size: .93rem; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; background: none; color: var(--blush);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--wax); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--wax-hi); }
.btn-ghost { border-color: var(--velvet); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); background: var(--ink-2); }
.btn-quiet { color: var(--muted); padding: 8px 12px; }
.btn-quiet:hover:not(:disabled) { color: var(--blush); }
.btn-sm { padding: 8px 15px; font-size: .85rem; }

/* ---- landing ----------------------------------------------------------- */

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center; min-height: 62vh; }
.hero h1 { margin-bottom: 22px; }
.hero .lede { font-size: 1.14rem; color: var(--muted); max-width: 46ch; margin: 0 0 32px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* The signature moment: the seal presses down once, on load. */
.seal-stage { display: grid; place-items: center; }
.seal-stage img { width: min(320px, 68vw); height: auto; animation: press .9s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes press {
  0%   { transform: scale(1.9) rotate(-14deg); opacity: 0; }
  62%  { transform: scale(.94) rotate(2deg);   opacity: 1; }
  100% { transform: scale(1) rotate(0);        opacity: 1; }
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(48px, 8vw, 96px); }
.step { border-top: 1px solid var(--velvet); padding-top: 20px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
/* The numbering is real: these happen in this order and cannot be reordered. */
.step .n { font-family: var(--display); font-size: .8rem; color: var(--wax); letter-spacing: .2em; display: block; margin-bottom: 12px; }

.assurance {
  margin-top: clamp(48px, 8vw, 88px);
  border: 1px solid var(--velvet); border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(180deg, var(--ink-2), transparent);
}
.assurance ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.assurance li { padding-left: 26px; position: relative; color: var(--muted); font-size: .95rem; }
.assurance li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 9px; height: 9px; border-radius: 50%; background: var(--wax);
}

/* ---- panels and forms -------------------------------------------------- */

.panel {
  background: var(--ink-2);
  border: 1px solid var(--velvet);
  border-radius: var(--r-lg);
  padding: clamp(22px, 4vw, 36px);
}
.panel + .panel { margin-top: 20px; }
.panel-narrow { max-width: 560px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 7px; letter-spacing: .01em; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 3px; }

.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: var(--ink); color: var(--blush);
  border: 1px solid var(--velvet); border-radius: var(--r-md);
  font-family: var(--body); font-size: .97rem;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6E5C74; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--wax); }

.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--wax); }
.field .err { color: var(--wax-hi); font-size: .82rem; margin-top: 6px; display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 16px; }

.form-note { color: var(--muted); font-size: .87rem; margin: 0 0 22px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 26px; flex-wrap: wrap; }

fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend {
  font-size: .69rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); padding: 0; margin-bottom: 16px;
}

.banner { border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 22px; font-size: .92rem; }
.banner-bad  { background: rgba(198, 48, 74, .14); border: 1px solid rgba(198, 48, 74, .45); }
.banner-good { background: rgba(111, 191, 155, .12); border: 1px solid rgba(111, 191, 155, .4); }

/* ---- the degree meter: five wax dots ----------------------------------- */

.degree { display: flex; gap: 6px; align-items: center; }
.degree .dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink-3); border: 1px solid var(--velvet);
}
.degree .dot.lit {
  background: radial-gradient(circle at 34% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo));
  border-color: transparent;
}

.degree-picker { display: flex; gap: 8px; }
.degree-picker button {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--velvet); background: var(--ink);
  cursor: pointer; color: var(--muted); font-family: var(--body); font-weight: 600;
  transition: transform .14s ease, background .14s ease;
}
.degree-picker button:hover { transform: translateY(-2px); }
.degree-picker button.on {
  background: radial-gradient(circle at 34% 30%, var(--wax-hi), var(--wax) 58%, var(--wax-lo));
  border-color: transparent; color: #fff;
}
.degree-caption { color: var(--muted); font-size: .85rem; margin-top: 10px; min-height: 1.3em; }

/* ---- crush cards: sealed envelopes -------------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }

.crush {
  position: relative;
  background: linear-gradient(158deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--velvet);
  border-radius: var(--r-md);
  padding: 22px 22px 18px;
  text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit;
  transition: transform .16s ease, border-color .16s ease;
}
.crush:hover { transform: translateY(-3px); border-color: var(--wax); }

/* the envelope flap */
.crush::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 46px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent);
  clip-path: polygon(0 0, 100% 0, 100% 34%, 50% 100%, 0 34%);
  pointer-events: none;
}

.crush h3 { margin: 14px 0 4px; font-size: 1.28rem; }
.crush .meta { color: var(--muted); font-size: .84rem; margin: 0 0 16px; }
.crush .foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }

.tag {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--velvet);
  padding: 3px 9px; border-radius: 999px;
}
.tag-sent { color: var(--foil); border-color: rgba(217, 179, 108, .4); }

/* a matched card has had its seal broken */
.crush.matched { border-color: var(--foil); background: linear-gradient(158deg, #2A1A2E, var(--ink-3)); }
.crush.matched::after {
  content: "It's mutual";
  position: absolute; top: 14px; right: 14px;
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: var(--foil);
  padding: 3px 10px; border-radius: 999px; font-weight: 600;
}

.empty {
  border: 1px dashed var(--velvet); border-radius: var(--r-lg);
  padding: clamp(32px, 6vw, 60px); text-align: center;
}
.empty h2 { margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 44ch; margin: 0 auto 24px; }

/* ---- gift catalogue ---------------------------------------------------- */

.gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.gift {
  border: 1px solid var(--velvet); border-radius: var(--r-md);
  background: var(--ink); padding: 18px; text-align: left;
  cursor: pointer; color: inherit; font: inherit;
  transition: border-color .16s ease;
}
.gift:hover:not(:disabled) { border-color: var(--wax); }
.gift.on { border-color: var(--wax); background: var(--ink-3); }
.gift:disabled { opacity: .42; cursor: not-allowed; }
.gift .kind { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--wax-hi); }
.gift h4 { font-family: var(--display); font-size: 1.06rem; font-weight: 400; margin: 8px 0 6px; }
.gift p { font-size: .84rem; color: var(--muted); margin: 0 0 12px; }
.gift .price { font-weight: 600; font-size: .92rem; }
.gift .soon { font-size: .74rem; color: var(--muted); display: block; margin-top: 6px; }

/* ---- the human check ---------------------------------------------------- */

.human-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.human-img {
  display: block; border: 1px solid var(--velvet); border-radius: var(--r-sm);
  background: var(--ink); width: 220px; height: 68px;
}

/* The honeypot. Off-screen rather than display:none, because some form-fillers
   skip anything that is not rendered. */
.nope {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---- the invite link ---------------------------------------------------- */

.invite-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ink); border: 1px solid var(--velvet);
  border-radius: var(--r-md); padding: 12px 14px;
}
.invite-url {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .88rem; color: var(--foil);
  word-break: break-all; flex: 1 1 240px;
}

/* ---- lists ------------------------------------------------------------- */

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--velvet); font-size: .93rem;
}
.rows li:last-child { border-bottom: 0; }
.rows .when { color: var(--muted); font-size: .82rem; white-space: nowrap; }

.status { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.status-submitted, .status-delivered { color: var(--good); }
.status-queued { color: var(--foil); }
.status-failed, .status-blocked, .status-cancelled { color: var(--wax-hi); }

/* ---- match reveal ------------------------------------------------------ */

.match {
  border: 1px solid var(--foil); border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(217, 179, 108, .12), transparent 60%), var(--ink-2);
  padding: clamp(22px, 4vw, 32px);
}
.match + .match { margin-top: 16px; }
.match h3 { font-size: 1.7rem; margin-bottom: 4px; }
.match .who { color: var(--muted); margin: 0 0 18px; }
.match .degrees { display: flex; gap: 32px; flex-wrap: wrap; }
.match .degrees div span { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }

/* ---- the mailbox -------------------------------------------------------- */

.mail-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.mail-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mail-search input {
  padding: 9px 14px; min-width: 240px;
  background: var(--ink); color: var(--blush);
  border: 1px solid var(--velvet); border-radius: 999px;
  font-family: var(--body); font-size: .9rem;
}
.mail-search input:focus { border-color: var(--wax); }

.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-row {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 18px 4px 4px;
  border-bottom: 1px solid var(--velvet);
}
.mail-row:last-child { border-bottom: 0; }
.mail-row:hover { background: var(--ink-3); }

.mail-open {
  flex: 1; display: grid; gap: 2px;
  grid-template-columns: minmax(120px, 190px) minmax(140px, 260px) 1fr;
  align-items: baseline;
  background: none; border: 0; cursor: pointer; color: inherit;
  font: inherit; text-align: left; padding: 16px;
}
.mail-who     { color: var(--muted); font-size: .88rem; }
.mail-subject { font-weight: 600; font-size: .95rem; }
.mail-preview { color: var(--muted); font-size: .88rem;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* An unread one is marked in wax down the edge, not by shouting in bold. */
.mail-row.unread { box-shadow: inset 3px 0 0 var(--wax); }
.mail-row.unread .mail-who { color: var(--blush); }

.mail-side { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.mail-body { font-size: 1.02rem; line-height: 1.7; white-space: normal; }

@media (max-width: 720px) {
  .mail-open { grid-template-columns: 1fr; gap: 4px; }
  .mail-preview { white-space: normal; }
  .mail-search input { min-width: 0; flex: 1; }
}

/* ---- toasts ------------------------------------------------------------ */

.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 60; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  background: var(--ink-3); border: 1px solid var(--velvet);
  border-left: 3px solid var(--wax);
  padding: 13px 17px; border-radius: var(--r-md); box-shadow: var(--shadow);
  font-size: .92rem; animation: slide .22s ease both;
}
.toast.good { border-left-color: var(--good); }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* ---- plain pages (opt-out) --------------------------------------------- */

body.plain { display: block; padding: clamp(28px, 8vh, 80px) 20px; }
.plain-card {
  max-width: 520px; margin: 0 auto;
  background: var(--ink-2); border: 1px solid var(--velvet);
  border-radius: var(--r-lg); padding: clamp(28px, 5vw, 44px);
}
.plain-card h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 22px 0 16px; }
.plain-card p { margin: 0 0 14px; }
.plain-card form { margin: 26px 0 18px; }

/* ---- responsive -------------------------------------------------------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .seal-stage { order: -1; }
  .seal-stage img { width: min(190px, 44vw); }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .brand-wordmark { height: 27px; }
  .topbar { padding: 14px 16px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
