:root {
  --ink: #760f63; /* brand plum: every former black uses this */
  --paper: #f5ecd6; /* beige, matched to the comic's own background */
  --cream: #fbf6e9;
  /* accents lifted from the comic */
  --pink: #e8a19b;
  --blue: #9fb6db;
  --yellow: #f2d78b;
  --green: #a8d5b5;
  --sans: 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

::selection { background: var(--pink); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.dim { opacity: 0.6; }

/* ---------- top bar + hero ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 20px var(--gutter) 0;
}

.chip {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 12px;
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
a.chip:hover { background: var(--pink); color: var(--ink); }
/* back to the Compute AI site */
.chip.back-chip { background: transparent; color: var(--ink); }
.chip.back-chip:hover { background: var(--ink); color: var(--pink); }
.tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.hero { padding: clamp(28px, 6vw, 56px) var(--gutter) 0; }

.title {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.01em;
  word-spacing: 0.12em;
  font-size: clamp(3rem, 12vw, 9rem);
  animation: rise 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.subtitle {
  margin: 18px 0 0;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  font-weight: 500;
  animation: rise 500ms 120ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.3em); }
}

/* ---------- two-column layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(32px, 5vw, 56px) var(--gutter) 40px;
  align-items: start;
}

/* ---------- comic: unrolls like a paper scroll ---------- */

.comic { min-width: 0; }

.scroll-wrap {
  --wood-dark: #7a4e2f;
  --wood: #c4926a;
  --wood-light: #e3b98f;
  --reveal: 100%; /* px of the strip unrolled so far; set by app.js */
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-top: 10px;
}

.strip {
  width: 100%;
  clip-path: inset(0 0 calc(100% - var(--reveal)) 0);
}

/* wooden rod the scroll hangs from */
.rod,
.roll::before,
.roll::after {
  background: linear-gradient(180deg, var(--wood-dark), var(--wood-light) 40%, var(--wood) 65%, var(--wood-dark));
  border: 2px solid var(--ink);
}
.rod {
  position: absolute;
  top: 0;
  left: -3%;
  right: -3%;
  height: 22px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgb(118 15 99 / 0.18);
  z-index: 2;
}

/* rolled-up paper that travels down as the strip unrolls */
.roll {
  position: absolute;
  top: 10px;
  left: -1.5%;
  right: -1.5%;
  height: 34px;
  margin-top: -17px;
  transform: translateY(var(--reveal));
  border: 2px solid var(--ink);
  border-radius: 17px;
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgb(122 78 47 / 0.12) 5px 6px),
    linear-gradient(180deg, #e9dcbc, #fffaf0 38%, #f2e6c9 62%, #cdb98f);
  background-position: 0 var(--spin, 0px), 0 0;
  box-shadow: 0 10px 14px -6px rgb(118 15 99 / 0.35);
  z-index: 2;
  pointer-events: none;
  display: none;
}
.scroll-wrap.is-ready .roll { display: block; }
/* wooden knobs at both ends of the roll */
.roll::before,
.roll::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px;
  height: 42px;
  margin-top: -21px;
  border-radius: 10px;
}
.roll::before { left: -14px; }
.roll::after { right: -14px; }

.scroll-wrap.is-intro .strip { transition: clip-path 1100ms cubic-bezier(0.22, 1, 0.36, 1); }
.scroll-wrap.is-intro .roll { transition: transform 1100ms cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- sign-up ---------- */

.signup-wrap { position: sticky; top: 24px; }

.signup {
  border: 2px solid var(--ink);
  background: rgb(255 255 255 / 0.45);
  box-shadow: 8px 8px 0 var(--ink);
}

.signup-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.signup-body { padding: 20px 20px 22px; }

.signup-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.signup-title + .field { margin-top: 18px; }

.field { display: block; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; padding: 0; }
.label em { font-style: normal; color: #c2452f; }

.field input {
  width: 100%;
  padding: 11px 12px;
  font: 500 16px var(--sans);
  color: var(--ink);
  background: rgb(255 255 255 / 0.5);
  border: 2px solid var(--ink);
  border-radius: 0;
  outline: none;
  transition: background 150ms;
}
.field input:focus { background: #fff; box-shadow: 3px 3px 0 var(--pink); }
.field input[aria-invalid='true'] { border-color: #c2452f; background: #fdeeea; }

.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid var(--ink);
}
.roles label { cursor: pointer; position: relative; }
.roles label + label { border-left: 2px solid var(--ink); }
/* 1px so `.field input { width: 100% }` doesn't make these hidden boxes stick out and widen the page on phones */
.roles input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; }
.roles span {
  display: block;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: background 140ms, color 140ms;
}
.roles label:hover span { background: rgb(118 15 99 / 0.08); }
.roles input:checked + span { background: var(--ink); color: var(--paper); }
.roles input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: -5px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 16px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; }
.box {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--ink);
  font: 700 12px var(--mono);
}
.check input:checked + .box::after { content: '✕'; }
.check input:focus-visible + .box { outline: 2px solid var(--pink); outline-offset: 2px; }
.check-label { display: block; font-size: 14px; font-weight: 500; }
.fine { display: block; margin-top: 3px; font: 11px/1.45 var(--mono); opacity: 0.65; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 2px solid #c2452f;
  color: #c2452f;
  font: 12px/1.4 var(--mono);
}

.submit {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 900 clamp(1.5rem, 2.6vw, 2rem) / 1 var(--sans);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: background 150ms, color 150ms, transform 100ms;
}
.submit:hover { background: var(--pink); color: var(--ink); }
.submit:active { transform: translate(2px, 2px); }
.submit:disabled { opacity: 0.5; cursor: progress; }

.thanks { padding: 36px 20px 40px; text-align: center; }
.thanks p { margin: 22px 0 0; font-size: 16px; }
.stamp {
  display: inline-block;
  padding: 14px 20px;
  border: 4px double var(--ink);
  background: var(--yellow);
  font: 900 clamp(1.8rem, 3vw, 2.4rem) / 0.95 var(--sans);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  animation: stamp 520ms cubic-bezier(0.34, 1.8, 0.64, 1) both;
}
@keyframes stamp {
  from { transform: scale(2.4) rotate(-18deg); opacity: 0; }
  to { transform: scale(1) rotate(-4deg); opacity: 1; }
}

/* ---------- our promise (pop-up over the site, fits one screen) ---------- */

.promise {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}
.promise[open] { display: flex; flex-direction: column; animation: pop-in 320ms cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.promise::backdrop { background: rgb(118 15 99 / 0.55); backdrop-filter: blur(3px); animation: fade 200ms ease both; }

@keyframes pop-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes fade { from { opacity: 0; } }

.promise-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 10px 24px;
  background: var(--ink);
  color: var(--paper);
  flex: none;
}
.promise-title {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  word-spacing: 0.1em;
}
.promise-close {
  width: 34px;
  height: 34px;
  border: 2px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font: 700 14px var(--mono);
  cursor: pointer;
}
.promise-close:hover { background: var(--pink); border-color: var(--pink); color: var(--ink); }

/* only scrolls on very short screens (e.g. a phone held sideways) */
.promise-body { overflow-y: auto; padding: clamp(12px, 2vh, 20px); overscroll-behavior: contain; }

/* framed like the comic: pink rule, blue rule */
.preamble {
  border: 3px solid var(--pink);
  outline: 3px solid var(--blue);
  outline-offset: 4px;
  margin: 7px;
  padding: clamp(16px, 2.6vh, 28px) clamp(16px, 3vw, 32px);
  font-size: clamp(14px, 1.9vh, 16.5px);
  line-height: 1.5;
}

.preamble strong { font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em; }
.preamble .caps { text-transform: uppercase; letter-spacing: 0.02em; }

.pre-open,
.pre-close { margin: 0; font-size: 1.08em; }

/* the eight values as a 2-column grid of cells */
.values {
  list-style: none;
  margin: clamp(12px, 2.2vh, 22px) 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}
.values li {
  padding: clamp(8px, 1.5vh, 14px) clamp(12px, 1.6vw, 18px);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transition: background 150ms;
}
.values li:hover { background: rgb(242 215 139 / 0.35); }
.promise[open] .values li { animation: rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.values li:nth-child(1) { animation-delay: 120ms; }
.values li:nth-child(2) { animation-delay: 170ms; }
.values li:nth-child(3) { animation-delay: 220ms; }
.values li:nth-child(4) { animation-delay: 270ms; }
.values li:nth-child(5) { animation-delay: 320ms; }
.values li:nth-child(6) { animation-delay: 370ms; }
.values li:nth-child(7) { animation-delay: 420ms; }
.values li:nth-child(8) { animation-delay: 470ms; }

.values i {
  font: italic 0.72em var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-right: 4px;
}
.values b {
  font-size: clamp(1.05rem, 2.4vh, 1.35rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.values span { display: block; margin-top: 3px; }
.values .trust b { background: var(--yellow); padding: 0 5px; }

body.has-dialog { overflow: hidden; }

@media (max-width: 640px) {
  .promise { max-height: calc(100dvh - 20px); width: calc(100vw - 20px); }
  .promise-head { padding: 8px 8px 8px 16px; }
  .promise-body { padding: 8px; }
  .preamble { margin: 5px; outline-offset: 3px; padding: 12px; font-size: 13px; line-height: 1.38; }
  .pre-open, .pre-close { font-size: 1em; }
  .values { grid-template-columns: minmax(0, 1fr); margin: 10px 0; }
  .values li { padding: 6px 10px; }
  /* value word runs straight into its sentence to save height */
  .values b { font-size: 1.08em; }
  .values span { display: inline; margin: 0; }
  .values i { font-size: 0.85em; }
}

/* ---------- footer + mobile CTA ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 20px var(--gutter) 28px;
  font-size: 10px;
  color: rgb(118 15 99 / 0.55);
}
.footer { align-items: baseline; }
.footer .brand-link { display: inline-block; margin-left: 6px; transition: transform 150ms ease, opacity 150ms ease; }
.footer .brand-link:hover { transform: translateY(-2px); }
.footer .brand-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.footer .brand-logo {
  display: inline-block;
  height: 19px;
  width: auto;
  /* sit the letters (not the image box) on the text line; only the "p" drops below */
  vertical-align: -4px;
}

.mobile-cta { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .signup-wrap { position: static; }
  .mobile-cta {
    display: block;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    padding: 12px 18px;
    background: var(--ink);
    color: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--pink);
    font: 900 15px var(--sans);
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 200ms, opacity 200ms;
  }
  .mobile-cta.is-hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* no visible scrollbar; scrolling still works */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

/* phones: the footer logo is easier to tap */
@media (max-width: 640px) { .brand-link { display: inline-block; padding: 10px 6px; margin: -10px -6px; } }
