/* red.css: Red, the character and the companion (every page), and Red's own page (red.html). Loads after rem.css,
   uses its tokens. Red's line is the thread's marker: red, round, a wet second pass. Red is never on a button fill. */

/* ---------- the character ---------- */
.red-char{display:block;overflow:visible}
.red-char .rc-main{stroke:var(--thread);stroke-width:2.6px}
.red-char .rc-wet{stroke:var(--thread);stroke-width:1.1px;opacity:.4}

/* ---------- the companion ---------- */
.rb{position:fixed;right:18px;bottom:18px;z-index:60;font-family:var(--font);display:flex;align-items:flex-end;gap:10px;pointer-events:none}
.rb > *{pointer-events:auto}
.rb-btn{width:56px;height:56px;border-radius:50%;border:0;padding:0;cursor:pointer;display:grid;place-items:center;flex:none;
  background:rgba(255,255,255,.72);backdrop-filter:blur(18px) saturate(1.4);-webkit-backdrop-filter:blur(18px) saturate(1.4);box-shadow:var(--shadow-deep);transition:transform .25s ease,box-shadow .25s ease}
.rb-btn:hover{transform:translateY(-1px)}
.rb-btn:focus-visible{outline:none;box-shadow:var(--shadow-deep),0 0 0 3px var(--canvas),0 0 0 5px var(--teal)}
.rb-btn .red-char{width:38px;height:38px}
.rb-btn .red-char .rc-main{stroke-width:2.3px}
.rb.open .rb-btn{box-shadow:var(--shadow-deep),0 0 0 1.5px var(--teal-ring)}

/* the pop: one line, to the left of the tangle, bottom-aligned with it */
.rb-pop{order:-1;position:relative;max-width:264px;margin-bottom:4px;padding:14px 38px 14px 16px;border-radius:20px 20px 6px 20px;
  background:var(--card-deep);backdrop-filter:blur(18px) saturate(1.3);-webkit-backdrop-filter:blur(18px) saturate(1.3);box-shadow:var(--shadow-deep);opacity:0;transform:translateY(6px) scale(.96);transform-origin:100% 100%;transition:opacity .26s ease,transform .32s cubic-bezier(.2,.8,.3,1.2)}
.rb-pop.in{opacity:1;transform:none}
html:not(.anim) .rb-pop{transition:none;transform:none}
.rb-line{font-size:16px;line-height:1.35;color:var(--ink);letter-spacing:-.01em}
.rb-acts:empty{display:none}
.rb-acts{margin-top:10px;display:flex;gap:8px}
.rb-x{position:absolute;top:6px;right:6px;width:28px;height:28px;border:0;border-radius:50%;background:none;color:var(--slate);font-size:20px;line-height:1;cursor:pointer;display:grid;place-items:center;font-family:var(--font)}
.rb-x:hover{color:var(--ink);background:rgba(0,0,0,.05)}

/* the sheet */
.rb-sheet{position:fixed;right:18px;bottom:86px;width:368px;max-height:min(560px,calc(100vh - 120px));display:flex;flex-direction:column;border-radius:24px;overflow:hidden;
  background:rgba(250,249,246,.9);backdrop-filter:blur(24px) saturate(1.4);-webkit-backdrop-filter:blur(24px) saturate(1.4);box-shadow:var(--shadow-deep);opacity:0;transform:translateY(10px);transform-origin:100% 100%;transition:opacity .22s ease,transform .3s cubic-bezier(.2,.8,.3,1)}
.rb-sheet.in{opacity:1;transform:none}
html:not(.anim) .rb-sheet{transition:none}
.rb-head{display:flex;align-items:center;gap:12px;padding:14px 12px 12px 16px;border-bottom:1px solid var(--hair)}
.rb-head .red-char{width:30px;height:30px;flex:none}
.rb-head .red-char .rc-main{stroke-width:2px}
.rb-ht{flex:1;min-width:0;display:flex;flex-direction:column}
.rb-ht b{font-size:16px;letter-spacing:-.01em}
.rb-ht span{font-size:12.5px;color:var(--graphite);line-height:1.35}
.rb-close{width:34px;height:34px;border:0;border-radius:50%;background:none;color:var(--slate);font-size:22px;cursor:pointer;flex:none;font-family:var(--font)}
.rb-close:hover{background:rgba(0,0,0,.05);color:var(--ink)}
.rb-log{flex:1;overflow:auto;padding:14px 14px 6px;display:flex;flex-direction:column;gap:8px;min-height:120px;overscroll-behavior:contain}
.rb-chips{display:flex;flex-wrap:wrap;gap:6px;padding:4px 14px 10px}
.rb-chips:empty{display:none}
.rb-chip{font:500 13.5px/1 var(--font);padding:9px 12px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.7);color:var(--teal-text);box-shadow:0 0 0 1.5px var(--teal-ring) inset;transition:box-shadow .2s ease,background .2s ease}
.rb-chip:hover{box-shadow:0 0 0 1.5px var(--teal) inset;background:#fff}
.rb-chip.go{background:var(--ink);color:#fff;box-shadow:none}
.rb-chip.go:hover{background:#262622}
.rb-form{display:flex;gap:8px;padding:10px 12px 6px;border-top:1px solid var(--hair)}
.rb-form input{flex:1;min-width:0;font:400 15px var(--font);padding:10px 14px;border-radius:999px;border:0;background:rgba(255,255,255,.85);box-shadow:0 0 0 1px var(--hair) inset;color:var(--ink)}
.rb-form input:focus{outline:none;box-shadow:0 0 0 2px var(--teal-ring) inset}
.rb-fine{font-size:11.5px;color:var(--slate);padding:0 16px 10px}

/* bubbles, shared by the sheet and red.html's demo */
.rb-m,.cm{display:flex}
.rb-m p,.cm p{max-width:84%;padding:9px 13px;font-size:15px;line-height:1.38;border-radius:18px;letter-spacing:-.005em}
.rb-m.red p,.cm.red p{background:#fff;color:var(--ink);border-bottom-left-radius:6px;box-shadow:0 1px 2px rgba(20,18,10,.05)}
.rb-m.you,.cm.you{justify-content:flex-end}
.rb-m.you p,.cm.you p{background:var(--teal-tint-strong);color:var(--ink);border-bottom-right-radius:6px}
.dots{display:inline-flex;gap:4px;padding:3px 0}
.dots span{width:6px;height:6px;border-radius:50%;background:var(--slate);opacity:.5;animation:rb-dot 1s infinite ease-in-out}
.dots span:nth-child(2){animation-delay:.15s}.dots span:nth-child(3){animation-delay:.3s}
@keyframes rb-dot{0%,100%{transform:translateY(0);opacity:.35}50%{transform:translateY(-3px);opacity:.8}}
@media (prefers-reduced-motion:reduce){.dots span{animation:none}}

@media (max-width:700px){
  .rb{right:12px;bottom:12px}
  .rb-btn{width:48px;height:48px;background:rgba(255,255,255,.8)}
  .rb-btn .red-char{width:32px;height:32px}
  .rb-pop{display:none}                                  /* quiet on phones until tapped */
  .rb.open .rb-btn{opacity:0;pointer-events:none}
  .rb-sheet{left:10px;right:10px;bottom:10px;width:auto;max-height:78vh}
  body{padding-bottom:64px}                              /* the last line of the footer scrolls clear of the tangle */
}

/* ---------- red.html ---------- */
.links a[aria-current="page"]{color:var(--ink)}
.red-hero{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,4fr);gap:40px;align-items:center}
.red-hero .eyebrow{display:block}
.red-hero h1{max-width:11.5em}
.red-hero .ai{margin-top:18px;font-size:15px;color:var(--graphite)}
.red-face{justify-self:center;border:0;background:none;padding:0;cursor:pointer;position:relative;width:min(300px,100%);aspect-ratio:1;border-radius:50%}
.red-face::before{content:"";position:absolute;inset:-6%;border-radius:50%;background:radial-gradient(closest-side,var(--teal-tint-strong),rgba(15,127,134,0));z-index:-1}
.red-face .red-char{width:100%;height:100%}
.red-face .red-char .rc-main{stroke-width:4.4px}
.red-face .red-char .rc-wet{stroke-width:1.8px}
.red-face:focus-visible{outline:2px solid var(--teal);outline-offset:6px}
.red-face .tip{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);font-size:13px;color:var(--slate);white-space:nowrap;opacity:0;transition:opacity .2s ease}
.red-face:hover .tip,.red-face:focus-visible .tip{opacity:1}

.intro{margin-top:calc(var(--u)*2)}
.intro-wrap{position:relative;margin-top:36px}
.intro-svg{display:block;width:100%;height:auto;overflow:visible}
.intro-svg path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.intro-svg .it-thread{stroke:var(--thread);stroke-width:3.2;opacity:.9}
.intro-svg .it-mark{stroke:var(--thread);stroke-width:3.5}
.intro-svg .it-knot{fill:var(--thread)}
.stops{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:22px;margin-top:10px;list-style:none;padding:0}
.stop{font-size:16px;color:var(--graphite);line-height:1.45;text-align:center;padding:0 6px}
.stop b{display:block;color:var(--ink);font-weight:500;font-size:13px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:8px;color:var(--teal-text)}
.intro-wrap.col{display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px}
.intro-wrap.col .intro-svg{width:96px}
.intro-wrap.col .stops{grid-template-columns:1fr;grid-auto-rows:120px;gap:0;margin-top:0}
.intro-wrap.col .stop{text-align:left;align-self:center;padding:0}
html:not(.js) .intro-wrap .stops{grid-template-columns:1fr;text-align:left}   /* no JS: the words alone, in order */
html:not(.js) .intro-wrap .stop{text-align:left;padding:10px 0}
/* round 5 (2026-11-08): a looping flip book above each step (values/intro.build.mjs). On a desktop the five drawings touch
   (no column gap), so the red thread leaving one at the right edge carries straight on into the next. On a phone they stack,
   drawing above the words; with no JS they still show, each on its still. */
.intro-wrap:has(.ifb-pic) .stops{gap:0;margin-top:0}
.intro-wrap:has(.ifb-pic) .stop{padding:0 14px}
.ifb-pic{display:block;margin:0 -14px 14px}
.ifb-pic svg{--v-ink:2px;--v-lake:1.6px;--v-thr:2.8px;--v-ball:1.5px}
@media (max-width:760px){
  .intro-wrap:has(.ifb-pic) .stops{grid-template-columns:1fr;gap:30px}
  .intro-wrap:has(.ifb-pic) .stop{text-align:center;padding:0;max-width:320px;margin:0 auto}
  .ifb-pic{margin:0 auto 10px;max-width:280px}
  .ifb-pic svg{--v-ink:1.6px;--v-lake:1.3px;--v-thr:2.1px;--v-ball:1.2px}
}
html:not(.js) .intro-wrap:has(.ifb-pic) .stop{text-align:center}

.talk{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:64px;align-items:start}
.talk .side{position:relative;padding-top:8px}
.talk .side .body{margin-top:18px}
.talk .side .more{margin-top:22px;background:none;border:0;padding:0;cursor:pointer;font-family:var(--font)}
.chat{position:relative;padding:0;max-width:440px;justify-self:end;width:100%}
.chat .chead{display:flex;align-items:center;gap:12px;padding:16px 18px 14px;border-bottom:1px solid var(--hair)}
.chat .chead .red-char{width:30px;height:30px;flex:none}
.chat .chead .red-char .rc-main{stroke-width:2px}
.chat .chead b{display:block;font-size:16px;letter-spacing:-.01em;font-weight:500}
.chat .chead span{display:block;font-size:12.5px;color:var(--graphite)}
.chat .clog{padding:16px 16px 20px;display:flex;flex-direction:column;gap:8px}
.cday{text-align:center;font-size:12px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--slate);margin:10px 0 2px}
.cnote{font-size:12.5px;color:var(--slate);padding:0 18px 16px;margin-top:-6px}
.chat.armed .cm,.chat.armed .cday{opacity:0;transform:translateY(6px);transition:opacity .35s ease,transform .4s cubic-bezier(.2,.7,.2,1)}
.chat.armed .cm.on,.chat.armed .cday.on{opacity:1;transform:none}
.chat.armed .cm.typing p{color:transparent;position:relative}
.chat.armed .cm.typing p::after{content:"";position:absolute;left:13px;top:50%;width:30px;height:8px;margin-top:-4px;background:radial-gradient(circle 3px,var(--slate) 90%,transparent) 0 0/10px 8px repeat-x;opacity:.55}
.chat .margin{position:absolute;right:calc(100% + 18px);font-family:var(--hand);font-weight:500;font-size:24px;color:var(--thread-text);white-space:nowrap;line-height:1;transform:rotate(-3deg)}
.chat .margin svg{position:absolute;left:100%;top:4px;width:40px;height:20px;overflow:visible}
.chat .margin svg path{fill:none;stroke:var(--thread);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.chat.armed .margin{opacity:0;transition:opacity .5s ease}
.chat.armed.played .margin{opacity:1}

.knows{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:64px;align-items:start}
.knows .big{margin-top:0}
.knows .body p + p{margin-top:14px}
.ask{text-align:left;padding:calc(var(--u)*4) 0 calc(var(--u)*10)}
.ask h2{max-width:13em}
.ask .lede{margin-top:20px;color:var(--graphite);font-size:clamp(18px,1.6vw,22px);max-width:30em}
.ask .cta{margin-top:30px;display:flex;gap:10px;flex-wrap:wrap}
.red-sec{padding:calc(var(--u)*10) 0}

@media (max-width:860px){
  .red-hero{grid-template-columns:1fr;gap:12px}
  .red-face{order:-1;justify-self:start;width:132px;margin-left:-6px}
  .red-face .red-char .rc-main{stroke-width:3.2px}
  .red-face .tip{display:none}
  .talk,.knows{grid-template-columns:1fr;gap:28px}
  .talk{gap:76px}
  .chat{justify-self:stretch;max-width:none}
  .chat .margin{display:none}
  .red-sec{padding:calc(var(--u)*7) 0}
}
html:not(.anim) [data-chat-replay]{display:none}
/* the pop's second slot: stacked above the tangle, flush to the right edge, where the page's ragged right edge is usually empty */
.rb.stack{flex-direction:column;align-items:flex-end}
.rb.stack .rb-pop{order:-1;margin:0 0 2px;border-radius:20px 20px 6px 20px;max-width:236px}

/* round 3 (2026-11-08): Red's page leads with Why Red; what Red does is the second section */
.red-sec.tool{padding-top:calc(var(--u)*9)}
.tool .tool-h{margin-top:16px;font-size:clamp(30px,3.8vw,50px);line-height:1.08;max-width:15em}
.tool .lede{margin-top:24px;color:var(--graphite);font-size:clamp(18px,1.6vw,21px);line-height:1.45;max-width:32em}
.tool .ai{margin-top:16px;font-size:15px;color:var(--graphite)}
.tool .cta{margin-top:30px;display:flex;gap:10px;flex-wrap:wrap}

/* Red in the corner, popped out more (Caleb, 2026-11-08): bigger, near-solid paper, a thin ring of its own thread and
   a deeper lift, so it reads as something to tap and not part of the background */
.rb{right:22px;bottom:22px}
.rb-btn{width:66px;height:66px;background:rgba(255,255,255,.94);box-shadow:0 0 0 2px rgba(216,18,44,.28),0 14px 34px -10px rgba(60,10,20,.38),0 3px 8px rgba(0,0,0,.08)}
.rb-btn:hover{transform:translateY(-2px);box-shadow:0 0 0 2px rgba(216,18,44,.45),0 18px 40px -10px rgba(60,10,20,.42),0 3px 8px rgba(0,0,0,.08)}
.rb-btn .red-char{width:46px;height:46px}
.rb-sheet{bottom:98px}
@media (max-width:600px){.rb{right:14px;bottom:14px}.rb-btn{width:58px;height:58px}.rb-btn .red-char{width:40px;height:40px}.rb-sheet{bottom:84px}}
/* Red's one-time hello shows on phones too (Caleb, 2026-11-08: introduce Red when people first land) */
@media (max-width:700px){.rb.hello .rb-pop:not([hidden]){display:block;max-width:min(264px,calc(100vw - 96px))}}

/* ---------- Meet Red on the home page (2026-11-10): Red beside his own hello (red.js redHello) ---------- */
.why-hi{display:flex;align-items:center;gap:clamp(14px,2vw,26px);margin-top:18px}
.why-hi .why-h,.why-hi h2{margin-top:0}
.why-red{flex:none;width:clamp(64px,8vw,104px);height:clamp(64px,8vw,104px);display:block}
.why-red .red-char{width:100%;height:100%}
.why-red .red-char .rc-main{stroke-width:3.6px}
.why-red .red-char .rc-wet{stroke-width:1.5px}
.why-red.roll{animation:red-roll 1.35s cubic-bezier(.22,.8,.3,1) both}
.why-red.hop svg{animation:red-hop .7s cubic-bezier(.3,0,.3,1) both}
@keyframes red-roll{from{transform:translateX(-70px) rotate(-260deg);opacity:0}25%{opacity:1}to{transform:none;opacity:1}}
@keyframes red-hop{0%,100%{transform:none}30%{transform:translateY(-14%) scale(1.04,.96)}55%{transform:translateY(0) scale(1.06,.92)}75%{transform:scale(.98,1.03)}}
@media (max-width:600px){.why-hi{gap:12px}.why-red{width:56px;height:56px}.why-red .red-char .rc-main{stroke-width:3px}}
@media (prefers-reduced-motion:reduce){.why-red.roll,.why-red.hop svg{animation:none}}

/* /red: Red is a tool first (Caleb 2026-11-10); the hero credits its maker, and the name's meaning has its own section below */
.red-hero .maker{display:flex;align-items:center;gap:12px;margin-top:22px;font-size:15px;color:var(--graphite)}
.red-hero .maker img{width:44px;height:44px;border-radius:50%;object-fit:cover;filter:grayscale(1) contrast(1.04);box-shadow:0 0 0 2px var(--canvas),0 0 0 3.5px var(--teal-ring)}
.red-hero .maker b{color:var(--ink);font-weight:500}
.red-sec.name h2{font-size:clamp(30px,3.8vw,50px);line-height:1.08;max-width:15em}
.red-sec.name .lede{margin-top:22px;color:var(--graphite);font-size:clamp(18px,1.6vw,21px);line-height:1.45;max-width:34em}
.red-sec.name .why-end{color:var(--ink);width:fit-content;max-width:34em}

/* the thread between the stacked steps on a phone (red.js introJoin, 2026-11-10) */
.intro-join{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;z-index:0}
.intro-join .ij-thr{fill:none;stroke:var(--thread);stroke-linecap:round;stroke-linejoin:round}
.intro-wrap:has(.intro-join) .stops{position:relative;z-index:1}
