/* ============================================================================
   Add Chad — "sketch edition": black marker ink on paper, hand-lettered, every
   box drawn a little crooked. Built to compare side-by-side with the polished
   neon version at "/". Reuses /demo.js and /app.js (same element IDs).
   ============================================================================ */
:root {
  --ink: #1c1c22;            /* marker black */
  --ink-soft: #3a3a44;
  --paper: #fbf7ec;          /* warm sketchpad paper */
  --paper-2: #f3eddb;        /* a slightly toastier panel fill */
  --hl: #ffe14a;             /* highlighter yellow — the only color, used sparingly */
  --hl-soft: #fff3b0;
  --line: rgba(28,28,34,0.16);
  --ok: #1f7a3f;
  --err: #b3361f;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --hand: "Caveat", "Comic Sans MS", cursive;            /* loose script — captions, tagline */
  --print: "Kalam", "Comic Sans MS", "Segoe Print", sans-serif;  /* legible hand-print — body */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--print);
  font-size: 17px;          /* hand-print + hand-script both want a touch more size to read easily */
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: var(--paper);
  /* faint engineer's-pad grid so the page feels like a sketchbook */
  background-image:
    repeating-linear-gradient(to right,  var(--line) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 30px);
  background-attachment: fixed;
}
::selection { background: var(--hl); color: var(--ink); }

/* the "drawn box" — irregular corner radii + a hard offset ink shadow, no blur */
.sk  { border: 2.6px solid var(--ink); background: #fff;
       border-radius: 16px 200px 18px 220px / 210px 18px 200px 16px;
       box-shadow: 5px 6px 0 var(--ink); }
.sk2 { border-radius: 220px 18px 200px 16px / 16px 210px 18px 200px; }
.sk3 { border-radius: 200px 16px 220px 18px / 18px 200px 16px 210px; }

h1, h2, h3, h4 { font-family: var(--marker); font-weight: 400; letter-spacing: 0; line-height: 1.05; }

.wrap { max-width: 720px; margin: 0 auto; padding: 26px 20px 70px; position: relative; z-index: 1; }

/* ───── scattered hand-drawn doodles ───── */
.doodles { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.doodle  { position: absolute; animation: jitter 6s ease-in-out infinite; }
@keyframes jitter {
  0%,100% { transform: translateY(0)    rotate(var(--r,0deg)); }
  50%     { transform: translateY(-9px) rotate(calc(var(--r,0deg) + 3deg)); }
}
.d-plus1  { top: 70px;   right: 5%;   width: 40px; --r: 10deg;  animation-duration: 5.6s; }
.d-star1  { top: 24px;   left: 6%;    width: 42px; --r: -12deg; animation-duration: 6.8s; animation-delay: -1.4s; }
.d-arrow1 { top: 250px;  left: 2%;    width: 120px; --r: -6deg; animation-duration: 7.4s; animation-delay: -2s; }
.d-plane  { top: 760px;  right: -1%;  width: 78px; --r: 8deg;   animation-duration: 8.2s; }
.d-plus2  { top: 1300px; left: 4%;    width: 34px; --r: -8deg;  animation-duration: 6.2s; animation-delay: -2.6s; }
.d-bag    { top: 1720px; left: -8px;  width: 92px; --r: -5deg;  animation-duration: 9s; }
.d-star2  { top: 2140px; right: 5%;   width: 40px; --r: 14deg;  animation-duration: 7s; animation-delay: -1.1s; }
@media (max-width: 640px) {
  .d-arrow1 { width: 90px; left: -8px; }
  .d-plane  { width: 60px; right: -3%; }
  .d-bag    { width: 70px; left: -16px; }
}

/* ───── hero ───── */
.hero { text-align: center; margin: 8px 0 26px; }
.wordmark-row { display: inline-flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 20px); margin-bottom: 6px; }
.wordmark {
  font-family: var(--marker); margin: 0; color: var(--ink);
  font-size: clamp(54px, 15vw, 116px); line-height: 0.9; text-align: left;
  transform: rotate(-2deg); position: relative;
}
.wordmark .hl { position: relative; display: inline-block; }
.wordmark .hl::before {  /* highlighter swipe behind "Add" */
  content: ""; position: absolute; left: -6px; right: -10px; top: 22%; bottom: 8%;
  background: var(--hl); transform: rotate(-2.5deg) skewX(-8deg); z-index: -1; border-radius: 40% 60% 55% 45%;
}
.chad-sketch {
  height: clamp(96px, 21vw, 170px); width: auto;
  transform: rotate(3deg);
  animation: chadWobble 5s ease-in-out infinite;
}
@keyframes chadWobble {
  0%,100% { transform: rotate(3deg)  translateY(0); }
  50%     { transform: rotate(-1deg) translateY(-6px); }
}
.tag {
  font-family: var(--hand); font-size: clamp(20px, 4.4vw, 28px); font-weight: 600; color: var(--ink);
  max-width: 560px; margin: 6px auto 0; line-height: 1.25;
}
.tag .big { font-size: 1.35em; font-weight: 700; text-decoration: underline; text-decoration-style: wavy; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ───── the sketched phone ───── */
.stage { width: min(330px, 84vw); margin: 26px auto 4px; position: relative; }
.phone {
  position: relative; width: 100%; aspect-ratio: 9 / 19;
  background: #fff; border: 3.4px solid var(--ink);
  border-radius: 44px 64px 46px 62px / 62px 46px 64px 44px;
  box-shadow: 8px 10px 0 var(--ink);
  transform: rotate(-1.4deg);
  padding: 11px 9px;
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%) rotate(1deg);
  width: 80px; height: 18px; background: var(--ink);
  border-radius: 12px 30px 14px 28px / 28px 14px 30px 12px;
}
.phone-home {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%) rotate(-1deg);
  width: 36%; height: 5px; background: var(--ink); border-radius: 4px;
}
.phone-screen {
  position: relative; height: 100%; background: #fff; overflow: hidden;
  border-radius: 34px 40px 36px 38px / 38px 36px 40px 34px;
  display: flex; flex-direction: column; text-align: left;
  font-family: var(--print);
}
.ios-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 4px; font-family: var(--print); font-weight: 700; font-size: 13px; color: var(--ink); flex: 0 0 auto;
}
.ios-status .batt { width: 22px; height: 11px; border: 2px solid var(--ink); border-radius: 3px; position: relative; }
.ios-status .batt::before { content: ""; position: absolute; inset: 1.5px; width: 65%; background: var(--ink); }
.ios-status .batt::after  { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 5px; background: var(--ink); }
.chat-header {
  display: flex; align-items: center; gap: 8px; padding: 2px 14px 8px; flex: 0 0 auto;
  border-bottom: 2px solid var(--ink);
}
.chat-header .back { font-family: var(--marker); font-size: 24px; line-height: 1; }
.chat-header .chat-title { flex: 1; text-align: center; font-family: var(--hand); font-weight: 700; font-size: 17px; white-space: nowrap; }
.chat-header .hd-cam { width: 18px; height: 13px; border: 2px solid var(--ink); border-radius: 4px 9px 4px 8px / 8px 4px 9px 4px; }

.thread {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 11px 8px; background: #fff;
  display: flex; flex-direction: column; scroll-behavior: smooth; transition: opacity .5s ease;
}
.thread-pad { flex: 1 1 0; min-height: 0; }
.thread.fading { opacity: 0; }
.thread::-webkit-scrollbar { width: 0; height: 0; }

.msg-row { display: flex; flex-direction: column; margin-top: 10px; max-width: 100%; }
.msg-row.tight { margin-top: 3px; }
.msg-row.me   { align-items: flex-end; }
.msg-row.them { align-items: flex-start; }
.msg-name { font-family: var(--print); font-size: 11px; color: var(--ink-soft); margin: 0 0 2px 13px; }
.msg-name.chad { font-family: var(--marker); font-size: 12.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.bubble {
  max-width: 80%; padding: 7px 12px 8px; font-family: var(--print); font-size: 15.5px; line-height: 1.32;
  white-space: pre-wrap; overflow-wrap: anywhere; border: 2.2px solid var(--ink); color: var(--ink);
  border-radius: 16px 130px 14px 120px / 120px 14px 130px 16px;
  animation: drawIn .26s cubic-bezier(.2,.9,.3,1.2) both;
}
.bubble.them { background: #fff; }
.bubble.me   { background: var(--hl-soft); border-radius: 130px 16px 120px 14px / 14px 120px 16px 130px; }
.bubble.chad { background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 16px 120px 16px 130px / 130px 16px 120px 16px; }
.bubble .mention { font-family: var(--marker); }
.bubble.them .mention, .bubble.me .mention { background: var(--hl); padding: 0 3px; }
.bubble.chad .mention { color: var(--hl); background: transparent; }
@keyframes drawIn { 0% { transform: scale(.6) rotate(-3deg); opacity: 0; } 60% { transform: scale(1.03) rotate(1deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }

.sys-msg { text-align: center; font-family: var(--hand); font-size: 13px; color: var(--ink-soft); margin: 14px 8px 4px; line-height: 1.25; animation: drawIn .3s ease both; }

.bubble.typing { display: inline-flex; gap: 4px; align-items: center; padding: 10px 13px; background: #fff; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: block; animation: typingDot 1.2s infinite ease-in-out; }
.bubble.typing i:nth-child(2) { animation-delay: .18s; }
.bubble.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typingDot { 0%,70%,100% { transform: translateY(0); opacity: .4; } 35% { transform: translateY(-4px); opacity: 1; } }

.composer {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px; flex: 0 0 auto;
  border-top: 2px solid var(--ink);
}
.composer .plus { font-family: var(--marker); width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50% 60% 55% 45%; font-size: 16px; }
.composer .field { flex: 1; border: 2px solid var(--ink); border-radius: 14px 80px 12px 70px / 70px 12px 80px 14px; padding: 5px 12px; font-family: var(--hand); font-size: 14px; color: var(--ink-soft); }
.composer .send { font-family: var(--marker); width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; transform: rotate(90deg); }

/* the on-screen overlay (title card / "a week later" / "but not anymore") */
.phone-screen .chat-header, .phone-screen .thread, .phone-screen .composer { transition: filter .5s ease; }
.phone-screen.timeskip .chat-header, .phone-screen.timeskip .thread, .phone-screen.timeskip .composer { filter: blur(5.5px) saturate(.7); }
.phone-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 70% at 50% 46%, rgba(251,247,236,.92) 0%, rgba(251,247,236,.5) 50%, transparent 78%);
  opacity: 0; transition: opacity .45s ease;
}
.phone-screen.timeskip::after { opacity: 1; }
.timeskip-cap {
  position: absolute; z-index: 7; left: 0; right: 0; top: 50%; transform: translateY(-50%) rotate(-1.5deg);
  padding: 0 20px; text-align: center; font-family: var(--marker);
  font-size: clamp(22px, 7vw, 28px); line-height: 1.15; color: var(--ink);
  white-space: pre-line; opacity: 0; pointer-events: none; transition: opacity .45s ease;
}
.phone-screen.timeskip .timeskip-cap { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .doodle, .chad-sketch { animation: none !important; }
  .bubble, .sys-msg { animation: none !important; }
  .bubble.typing i { animation: none; opacity: .5; }
  html { scroll-behavior: auto; }
}
@media (max-width: 560px) { .stage { width: min(300px, 80vw); } .bubble { font-size: 15px; } }

.phone-line { font-family: var(--hand); font-size: clamp(17px, 3.8vw, 22px); font-weight: 700; color: var(--ink); margin: 18px 0 0; }
/* white "torn-page" panel behind the blurb so it reads cleanly over the grid */
.sub {
  font-family: var(--print); font-size: 18.5px; line-height: 1.55; color: var(--ink);
  max-width: 540px; margin: 18px auto 0; padding: 16px 22px; text-align: center;
  background: #fff; border: 2.6px solid var(--ink); box-shadow: 5px 6px 0 var(--ink);
  border-radius: 18px 200px 16px 220px / 210px 16px 200px 18px; transform: rotate(-0.5deg);
}
.sub strong { font-family: var(--marker); background: var(--hl); padding: 0 4px; }
.beta-pill {
  display: inline-block; margin-top: 18px; padding: 6px 16px; font-family: var(--hand); font-weight: 700; font-size: 16px;
  background: var(--hl); color: var(--ink); border: 2.4px solid var(--ink);
  border-radius: 16px 140px 14px 120px / 120px 14px 140px 16px; box-shadow: 3px 4px 0 var(--ink); transform: rotate(-1.5deg);
}

/* ───── card / form ───── */
.card { background: #fff; border: 2.8px solid var(--ink); border-radius: 18px 60px 20px 56px / 56px 20px 60px 18px; box-shadow: 7px 9px 0 var(--ink); padding: 26px 24px; margin: 30px 0; transform: rotate(-0.5deg); }
.card h2 { font-size: clamp(26px, 6vw, 34px); margin: 0 0 16px; color: var(--ink); transform: rotate(-1deg); }
label { display: block; font-family: var(--print); font-weight: 700; font-size: 16.5px; margin-bottom: 14px; }
label .opt { font-family: var(--hand); font-weight: 600; font-size: 16px; color: var(--ink-soft); }
input, select {
  display: block; width: 100%; margin-top: 5px; padding: 11px 13px; font-family: var(--print); font-size: 16px; color: var(--ink);
  background: var(--paper); border: 2.4px solid var(--ink);
  border-radius: 14px 70px 12px 64px / 64px 12px 70px 14px;
}
input:nth-of-type(even) { border-radius: 70px 14px 64px 12px / 12px 64px 14px 70px; }
input:focus, select:focus { outline: none; background: var(--hl-soft); box-shadow: 3px 3px 0 var(--ink); }
input::placeholder { color: var(--ink-soft); font-family: var(--hand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dates { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.dates input { margin-top: 0; }
.dates .to { font-family: var(--marker); }

fieldset.block { border: 2.4px solid var(--ink); border-radius: 16px 50px 18px 44px / 44px 18px 50px 16px; padding: 16px 16px 6px; margin: 18px 0; background: var(--paper); }
fieldset.block legend { font-family: var(--marker); font-size: 17px; padding: 0 8px; background: var(--hl); border: 2px solid var(--ink); border-radius: 10px 40px 8px 36px / 36px 8px 40px 10px; }
.hint, .finehint { font-family: var(--hand); font-size: 18px; color: var(--ink-soft); margin: -2px 0 12px; line-height: 1.3; }
.finehint { text-align: center; margin: 10px 0 0; }

.member { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 8px; margin-bottom: 9px; }
.member input { margin-top: 0; }
.member .rm { font-family: var(--marker); border: 2.2px solid var(--ink); background: #fff; border-radius: 50% 60% 45% 55%; cursor: pointer; font-size: 13px; color: var(--ink); padding: 0 11px; }
.member .rm:hover { background: var(--hl); }
button.ghost {
  font-family: var(--marker); background: #fff; border: 2.4px dashed var(--ink); color: var(--ink);
  border-radius: 14px 60px 12px 54px / 54px 12px 60px 14px; padding: 8px 16px; cursor: pointer; font-size: 15px; box-shadow: 3px 4px 0 var(--ink);
}
button.ghost:hover { background: var(--hl-soft); transform: translate(1px,1px); box-shadow: 2px 3px 0 var(--ink); }

.agree { display: flex; align-items: flex-start; gap: 10px; font-family: var(--print); font-size: 16px; line-height: 1.4; margin: 18px 0 0; cursor: pointer; }
.agree input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; cursor: pointer; position: relative;
  width: 22px; height: 22px; margin: 1px 0 0; background: #fff; border: 2.4px solid var(--ink);
  border-radius: 6px 14px 5px 12px / 12px 5px 14px 6px;
}
.agree input[type="checkbox"]:checked { background: var(--hl); }
/* hand-drawn check, built from two borders so it sits dead-centre in the box */
.agree input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 50%; top: 47%;
  width: 5.5px; height: 11px; border: solid var(--ink); border-width: 0 2.6px 2.6px 0;
  transform: translate(-50%, -58%) rotate(42deg);
}
.agree a { color: var(--ink); text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 2px; }
.pricebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 2.4px solid var(--ink); }
.pricebig { font-family: var(--marker); font-size: 32px; }
.pricesub { display: block; font-family: var(--hand); font-size: 17.5px; color: var(--ink-soft); }
.btn {
  font-family: var(--marker); font-size: 19px; background: var(--hl); color: var(--ink); border: 2.8px solid var(--ink); cursor: pointer;
  border-radius: 16px 70px 14px 64px / 64px 14px 70px 16px; padding: 12px 26px; box-shadow: 5px 6px 0 var(--ink);
  text-decoration: none; display: inline-block; transition: transform .05s ease, box-shadow .05s ease; transform: rotate(-1deg);
}
.btn:hover  { transform: rotate(-1deg) translate(2px,2px); box-shadow: 3px 4px 0 var(--ink); }
.btn:active { transform: rotate(-1deg) translate(5px,6px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.formmsg { font-family: var(--hand); font-size: 18px; margin: 14px 0 0; min-height: 1.2em; }
.formmsg.ok  { color: var(--ok); }
.formmsg.err { color: var(--err); }

/* ───── how it works ───── */
.how { background: #fff; border: 2.8px solid var(--ink); border-radius: 60px 18px 56px 20px / 18px 56px 20px 60px; box-shadow: 7px 9px 0 var(--ink); padding: 24px 24px 20px; margin-bottom: 26px; transform: rotate(0.5deg); }
.how h3, .faq h3 { font-size: clamp(24px, 5.5vw, 32px); margin: 0 0 16px; transform: rotate(-1deg); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 14px; font-family: var(--print); color: var(--ink); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--marker); font-size: 16px; color: var(--ink); background: var(--hl);
  border: 2.4px solid var(--ink); border-radius: 50% 60% 48% 52% / 52% 48% 60% 50%; box-shadow: 2.5px 3px 0 var(--ink);
}
.steps li:nth-child(even)::before { border-radius: 60% 48% 52% 50% / 50% 52% 48% 60%; }
.steps li strong { font-family: var(--marker); font-weight: 400; }

/* ───── FAQ ───── */
.faq { background: #fff; border: 2.8px solid var(--ink); border-radius: 18px 56px 20px 60px / 56px 20px 60px 18px; box-shadow: 7px 9px 0 var(--ink); padding: 22px 24px 14px; margin-bottom: 26px; transform: rotate(-0.4deg); }
.faq details { border-bottom: 2px dashed var(--ink); }
.faq details:last-of-type { border-bottom: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 13px 30px 13px 0; position: relative; font-family: var(--marker); font-size: 17px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-family: var(--marker); font-size: 22px; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { font-family: var(--print); margin: -2px 0 16px; color: var(--ink); max-width: 62ch; }
.faq details > p strong { font-family: var(--marker); font-weight: 400; background: var(--hl); padding: 0 3px; }
.faq details > p a, .faq details > p strong a { color: var(--ink); text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 2px; }

.muted { color: var(--ink-soft); }
footer { text-align: center; font-family: var(--hand); font-size: 16px; color: var(--ink-soft); margin-top: 36px; }

/* shared little success page (if app.js ever renders into one) */
body.centered { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body.centered .card { text-align: center; max-width: 460px; }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr 1fr; }
  .member .m-phone { grid-column: 1 / -1; }
  .pricebar { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .wordmark { font-size: clamp(46px, 17vw, 90px); }
}
