/* xyx.me — the one master stylesheet.
   Shared tokens and site shell first; page-specific rules are scoped under a
   body.page-* selector at the bottom. Do not add a second stylesheet.
   Bump the ?v= query in every page (and in waitlist-appsscript.gs) on change. */

:root{
  color-scheme:light;
  --bg:#fdf1f6;
  --bg2:#fff9fb;
  --ink:#2c2230;
  --ink-soft:#6b5c72;
  --line:#e8d3de;
  --x:#e0567a;
  --y:#3f8fbf;
  --accent:#f7c948;
  --card:#ffffff;
}

:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#17131a;
  --bg2:#211a24;
  --ink:#fff8fb;
  --ink-soft:#d8cad7;
  --line:#493a49;
  --x:#ff8eaf;
  --y:#76c6f0;
  --accent:#f8d765;
  --card:#251e29;
}

*{box-sizing:border-box}
/* display:flex on .signup would otherwise beat the UA [hidden] rule */
[hidden]{display:none!important}
html{scroll-behavior:smooth}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:17px/1.65 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

/* soft blobs in the background — opt in with .page-glow */
body.page-glow::before,body.page-glow::after{
  content:"";position:fixed;z-index:-1;border-radius:50%;
  filter:blur(70px);opacity:.35;pointer-events:none;
}
body.page-glow::before{width:420px;height:420px;background:#ffc9d9;top:-140px;left:-120px}
body.page-glow::after{width:460px;height:460px;background:#bfe2f5;bottom:-180px;right:-140px}
html[data-theme="dark"] body.page-glow::before{background:#742c4d;opacity:.32}
html[data-theme="dark"] body.page-glow::after{background:#1f5674;opacity:.28}

a{color:var(--x)}

.wrap{max-width:940px;margin:0 auto;padding:0 22px}

/* ---------- header ---------- */
header{padding:26px 0 0}
.bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.logo{
  display:inline-flex;align-items:baseline;gap:2px;
  font-weight:800;font-size:24px;letter-spacing:-.02em;
  text-decoration:none;color:var(--ink);
}
.logo .lx{color:var(--x)}
.logo .ly{color:var(--y)}
.logo .dot{color:var(--ink-soft);font-weight:600}
.tag{
  font-size:13px;color:var(--ink-soft);
  background:var(--card);border:1px solid var(--line);
  padding:5px 12px;border-radius:999px;
}

.theme-toggle{
  position:fixed;top:calc(16px + env(safe-area-inset-top));right:calc(16px + env(safe-area-inset-right));z-index:60;
  margin:0;appearance:none;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);
  padding:7px 19px 9px 11px;font:600 13px/1 inherit;cursor:pointer;box-shadow:0 2px 0 rgba(44,34,48,.08);
}
.theme-toggle .theme-suffix{display:block;position:absolute;right:6px;bottom:4px;font-size:.55em;line-height:1}
.theme-toggle:hover{border-color:var(--x)}

/* ---------- shared form controls ---------- */
.field{
  font:inherit;font-size:16px;               /* 16px or iOS zooms on focus */
  padding:13px 16px;width:min(330px,100%);
  border:1px solid var(--line);border-radius:12px;
  background:var(--card);color:var(--ink);outline:none;
  transition:border-color .15s,box-shadow .15s;
}
.field:focus{border-color:var(--x);box-shadow:0 0 0 3px rgba(224,86,122,.16)}
.btn{
  font:inherit;font-weight:700;font-size:16px;
  padding:13px 24px;border:none;border-radius:12px;
  background:var(--ink);color:#fff;cursor:pointer;
  box-shadow:0 3px 0 rgba(44,34,48,.28);
  transition:transform .1s,box-shadow .1s,background .15s;
}
.btn:hover{background:var(--x)}
.btn:active{transform:translateY(3px);box-shadow:0 0 0 rgba(0,0,0,0)}
.btn[disabled]{opacity:.6;cursor:default}
html[data-theme="dark"] .btn{background:var(--x);color:#251a24;box-shadow:0 3px 0 rgba(0,0,0,.35)}
html[data-theme="dark"] .btn:hover{background:var(--accent);color:#251a24}
.btn.ghost{
  background:var(--card);color:var(--ink);
  border:1px solid var(--line);box-shadow:0 3px 0 rgba(44,34,48,.08);
}
.btn.ghost:hover{background:var(--bg2);color:var(--ink);border-color:var(--x)}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.note{font-size:13.5px;color:var(--ink-soft);text-align:center;margin:0 0 8px}
.ok{
  text-align:center;font-weight:650;color:var(--y);
  min-height:24px;font-size:15px;margin:2px 0 0;
}
.ok.bad{color:var(--x)}
/* Shown only while a signup is in flight. A cold Apps Script container can take
   25s+, and a status line that only changes every few seconds still reads as a
   frozen page — the bar keeps something visibly moving in between. */
.progress{
  height:6px;margin:2px 0 6px;overflow:hidden;
  border:1px solid var(--line);border-radius:999px;background:var(--bg2);
}
.progress-fill{
  display:block;height:100%;width:0;border-radius:999px;
  background:linear-gradient(90deg,var(--x),var(--y));
  transition:width .25s linear;
}
@media (prefers-reduced-motion:reduce){
  .progress-fill{transition:none}
}

/* ---------- footer ---------- */
footer{
  margin:72px 0 40px;padding-top:24px;
  border-top:1px solid var(--line);
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
  font-size:14px;color:var(--ink-soft);
}
footer a{color:var(--ink-soft)}
footer a:hover{color:var(--x)}
footer .early{
  display:inline-block;background:var(--card);border:1px solid var(--line);
  border-radius:999px;padding:4px 12px;
}

/* ================= home ================= */
body.page-home .hero{padding:64px 0 10px;text-align:center}
body.page-home h1{
  font-size:clamp(34px,6vw,58px);
  line-height:1.08;letter-spacing:-.03em;
  margin:0 0 22px;font-weight:800;
}
body.page-home h1 .hl{
  background:linear-gradient(transparent 62%,#f7b3c8 62%);
  padding:0 .06em;
}
html[data-theme="dark"] body.page-home h1 .hl{background:linear-gradient(transparent 62%,#71364f 62%)}
.lede{
  font-size:clamp(17px,2.3vw,20px);
  color:var(--ink-soft);max-width:620px;margin:0 auto 14px;
}
.lede strong{color:var(--ink)}

.shake{
  display:flex;align-items:center;justify-content:center;gap:14px;
  margin:38px 0 30px;flex-wrap:wrap;
}
.pill{
  background:var(--card);border:1px solid var(--line);
  border-radius:16px;padding:14px 20px;
  box-shadow:0 3px 0 rgba(44,34,48,.06);
  text-align:left;min-width:190px;
}
.pill .who{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--ink-soft)}
.pill .say{font-weight:650;font-size:15px;margin-top:3px}
.pill.a{border-color:#f3c3d1}
.pill.a .who{color:var(--x)}
.pill.b{border-color:#bfdcee}
.pill.b .who{color:var(--y)}
.plus{font-size:28px;animation:bob 2.6s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0) rotate(-6deg)}50%{transform:translateY(-7px) rotate(6deg)}}

/* Fixed waitlist: a compact card on desktop, a bottom bar on mobile. */
body.page-home{padding-bottom:132px}
.waitlist{
  position:fixed;right:20px;bottom:20px;z-index:50;
  width:min(390px,calc(100vw - 40px));
}
.waitlist-panel{
  padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--card);
  box-shadow:0 3px 0 rgba(44,34,48,.06),0 12px 34px rgba(44,34,48,.12);
}
.waitlist-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 9px}
.waitlist-title{margin:0;color:var(--ink-soft);font-size:13px;font-weight:700}
.waitlist-close{width:26px;height:26px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:transparent;color:var(--ink-soft);cursor:pointer;transition:background .15s,color .15s}
.waitlist-close svg{display:block;width:12px;height:12px}
.waitlist-close:hover{background:rgba(44,34,48,.07);color:var(--ink)}
.waitlist-close:focus-visible{outline:2px solid var(--x);outline-offset:1px}
html[data-theme="dark"] .waitlist-close:hover{background:rgba(255,248,251,.09)}
.signup{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:0 0 12px}
.waitlist .note{margin:0;text-align:center}
.waitlist .ok{min-height:0;margin:2px 0 0;text-align:center}
.waitlist .ok:empty{display:none}
html[data-theme="dark"] .waitlist-panel{box-shadow:0 3px 0 rgba(0,0,0,.28),0 12px 34px rgba(0,0,0,.34)}

.kicker{
  text-align:center;margin:78px 0 26px;
  font-weight:700;font-size:14px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--ink-soft);
}

.grid{display:grid;gap:16px;grid-template-columns:repeat(3,1fr)}
.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:18px;padding:24px 22px;
  box-shadow:0 3px 0 rgba(44,34,48,.05);
  transition:transform .16s ease,box-shadow .16s ease;
}
.card:hover{transform:translateY(-4px);box-shadow:0 9px 0 rgba(44,34,48,.05)}
.card .ico{font-size:30px;line-height:1;display:block;margin-bottom:12px}
.card h3{margin:0 0 8px;font-size:18px;letter-spacing:-.01em}
.card p{margin:0;color:var(--ink-soft);font-size:15.5px;line-height:1.6}

.steps{display:grid;gap:14px;grid-template-columns:repeat(3,1fr);counter-reset:s}
.step{
  background:var(--bg2);border:1px dashed var(--line);
  border-radius:16px;padding:22px;position:relative;
}
.step::before{
  counter-increment:s;content:counter(s);
  position:absolute;top:-13px;left:20px;
  width:28px;height:28px;border-radius:50%;
  background:var(--accent);color:var(--ink);
  font-weight:800;font-size:14px;
  display:grid;place-items:center;
  border:1px solid rgba(44,34,48,.12);
}
.step h4{margin:6px 0 6px;font-size:16.5px}
.step p{margin:0;color:var(--ink-soft);font-size:15px}

.panel{
  margin-top:26px;background:var(--card);
  border:1px solid var(--line);border-radius:20px;
  padding:30px 26px;text-align:center;
}
.panel h2{margin:0 0 12px;font-size:clamp(21px,3.4vw,27px);letter-spacing:-.02em}
.panel p{margin:0 auto;max-width:620px;color:var(--ink-soft);font-size:16px}
.panel .chrom{font-weight:800;letter-spacing:.02em}
.panel .chrom .cx{color:var(--x)}
.panel .chrom .cy{color:var(--y)}

/* ================= document pages (privacy) ================= */
body.page-document .doc{max-width:680px;margin:0 auto;padding:52px 0 0}
body.page-document .doc h1{
  font-size:clamp(28px,5vw,42px);line-height:1.12;
  letter-spacing:-.03em;margin:0 0 10px;font-weight:800;
}
body.page-document .doc .updated{
  color:var(--ink-soft);font-size:14px;margin:0 0 34px;
}
body.page-document .doc h2{
  font-size:20px;letter-spacing:-.01em;margin:38px 0 10px;
}
body.page-document .doc p{margin:0 0 14px;color:var(--ink-soft)}
body.page-document .doc p.lead{color:var(--ink);font-size:18px}
body.page-document .doc ul{margin:0 0 16px;padding-left:22px;color:var(--ink-soft)}
body.page-document .doc li{margin:0 0 8px}
body.page-document .doc strong{color:var(--ink)}
body.page-document .doc table{
  width:100%;border-collapse:collapse;margin:0 0 18px;font-size:15px;
}
body.page-document .doc th,body.page-document .doc td{
  text-align:left;padding:10px 12px;border:1px solid var(--line);
  vertical-align:top;color:var(--ink-soft);
}
body.page-document .doc th{background:var(--bg2);color:var(--ink);font-weight:700}
body.page-document .doc .box{
  background:var(--card);border:1px solid var(--line);
  border-radius:16px;padding:20px 22px;margin:0 0 18px;
}
body.page-document .doc .box p:last-child{margin:0}
body.page-privacy .technical-details{display:none}

/* ================= unsubscribe ================= */
body.page-unsubscribe{display:flex;min-height:100vh;align-items:center}
body.page-unsubscribe .unsub{
  max-width:560px;margin:0 auto;padding:40px 0;width:100%;
}
body.page-unsubscribe .unsub-card{
  background:var(--card);border:1px solid var(--line);
  border-radius:20px;padding:32px 28px;text-align:center;
  box-shadow:0 3px 0 rgba(44,34,48,.05);
}
body.page-unsubscribe .unsub-card h1{
  font-size:clamp(23px,4.4vw,30px);letter-spacing:-.02em;
  margin:0 0 12px;font-weight:800;
}
body.page-unsubscribe .unsub-card p{margin:0 0 18px;color:var(--ink-soft);font-size:16px}
body.page-unsubscribe .unsub-card .who{
  font-weight:700;color:var(--ink);word-break:break-all;
}
body.page-unsubscribe .actions{
  display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:0 0 6px;
}
/* was an inline style attribute; style-src 'self' blocks those */
body.page-unsubscribe .actions-tight{margin-top:12px}
body.page-unsubscribe .reason{margin:22px 0 0;text-align:left}
body.page-unsubscribe .reason label{
  display:block;font-size:13px;text-transform:uppercase;
  letter-spacing:.09em;color:var(--ink-soft);margin:0 0 8px;
}
body.page-unsubscribe textarea.field{
  width:100%;min-height:88px;resize:vertical;line-height:1.5;
}
body.page-unsubscribe .mark{font-size:34px;line-height:1;margin:0 0 10px}
body.page-unsubscribe .home{
  display:block;text-align:center;margin:22px 0 0;
  font-size:14px;color:var(--ink-soft);text-decoration:none;
}
body.page-unsubscribe .home:hover{color:var(--x)}

@media (max-width:760px){
  /* Keep the home and privacy headers aligned with cup.pm on phones: the
     wordmark and tagline share the left edge while the fixed theme control
     owns the right. */
  body.page-home header,body.page-privacy header{padding:calc(10px + env(safe-area-inset-top)) 0 0}
  body.page-home .bar,body.page-privacy .bar{align-items:center;justify-content:flex-start;gap:4px;flex-wrap:nowrap}
  body.page-home .logo,body.page-privacy .logo{margin-left:-6px}
  body.page-home .tag,body.page-privacy .tag{padding:4px 8px;font-size:11px;white-space:nowrap}
  .grid,.steps{grid-template-columns:1fr}
  body.page-home .hero{padding:44px 0 6px}
  .plus{transform:rotate(90deg)}
  .pill{width:100%;min-width:0}
  footer{flex-direction:column;gap:8px}
}

@media (max-width:350px){
  /* Preserve room for the top-right theme control on the narrowest phones. */
  body.page-home .bar,body.page-privacy .bar{padding-right:78px;flex-wrap:wrap;gap:4px 10px}
}

@media (max-height:500px) and (orientation:landscape) and (max-width:900px){
  body.page-home .bar,body.page-privacy .bar{display:grid;grid-template-columns:1fr auto 1fr}
  body.page-home .bar .logo,body.page-privacy .bar .logo{grid-column:1;justify-self:start}
  body.page-home .bar .tag,body.page-privacy .bar .tag{grid-column:2;justify-self:center}
}

@media (max-width:640px){
  .theme-toggle{
    top:env(safe-area-inset-top);right:calc(10px + env(safe-area-inset-right));width:40px;height:40px;padding:6px 6px 0 0;
    border:0;border-radius:0;display:flex;align-items:flex-start;justify-content:flex-end;font-size:12px;line-height:1;
    clip-path:polygon(0 0,100% 0,100% 100%);background:linear-gradient(135deg,rgba(255,255,255,.86),rgba(255,255,255,.58));
    -webkit-backdrop-filter:blur(16px) saturate(150%);backdrop-filter:blur(16px) saturate(150%);box-shadow:none;filter:drop-shadow(-2px 3px 5px rgba(44,34,48,.18));
  }
  .theme-toggle .theme-label{display:none}
  .theme-toggle .theme-suffix{right:7px;top:17px;bottom:auto;font-size:.4em}
  html[data-theme="dark"] .theme-toggle{background:linear-gradient(135deg,rgba(53,41,59,.9),rgba(31,24,35,.68));filter:drop-shadow(-2px 3px 5px rgba(0,0,0,.36))}
  body.page-home{padding-bottom:146px}
  .waitlist{right:0;bottom:0;left:0;width:auto;padding:10px 12px calc(20px + env(safe-area-inset-bottom,0px));background:rgba(253,241,246,.88);border-top:1px solid var(--line);box-shadow:0 -10px 28px rgba(44,34,48,.1);-webkit-backdrop-filter:blur(16px) saturate(150%);backdrop-filter:blur(16px) saturate(150%)}
  .waitlist-panel{padding:0;border:0;border-radius:0;background:none;box-shadow:none}
  .waitlist-head{margin-bottom:6px}
  .signup{gap:6px;flex-wrap:nowrap;padding:5px 5px 5px 8px;border:1px solid var(--line);border-radius:14px;background:var(--card);box-shadow:0 2px 8px rgba(44,34,48,.1)}
  .signup .field{flex:1 1 auto;min-width:0;width:auto;padding:11px 6px;border:0;background:transparent;box-shadow:none}
  .signup .btn{flex:0 0 auto;padding:11px 14px;border-radius:11px;font-size:15px}
  .waitlist .ok{margin-bottom:5px}
  html[data-theme="dark"] .waitlist{background:rgba(23,19,26,.9);box-shadow:0 -10px 28px rgba(0,0,0,.32)}
}

/* Keep the waitlist call to action legible even when a breakpoint overrides
   the shared button geometry. */
html[data-theme="dark"] body.page-home .waitlist .btn{
  background:var(--x);color:#251a24;box-shadow:0 3px 0 rgba(0,0,0,.35);
}
html[data-theme="dark"] body.page-home .waitlist .btn:hover{
  background:var(--accent);color:#251a24;
}

@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
