/* The SnappyTech page. The intro's styles live in intro.css. */

:root {
  --void: #0e0f2b;
  --night: #1a1c44;
  --lift: #2a2a63;
  --iris: #6a6cff;
  --snap: #ffd166;
  --white: #fff;
  --lilac: #c6c8ec;
  --ink: #15163a;
  --edge: clamp(20px, 5vw, 72px);
  --chat-button: 72px;
  --logo-width: clamp(112px, 10vw, 142px);
  --radius: 6px; /* Every corner on the site, except circles (dots, rings, the chat button). */
  --display: Anybody, 'Arial Black', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  /* Shown if WebGL isn't available. Normally the code ocean covers it. */
  background: radial-gradient(90vw 70vh at 75% 20%, var(--lift), var(--void)) fixed var(--void);
  scrollbar-gutter: stable;
  scroll-padding-top: 84px; /* Links to a spot on the page land below the fixed header. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--white);
  font: 400 1.0625rem/1.5 Geist, system-ui, sans-serif;
}

img { display: block; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--snap);
  outline-offset: 3px;
}

.ocean {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
}

.button {
  display: inline-block;
  padding: .85em 1.6em;
  border-radius: var(--radius);
  background: var(--snap);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .15s;
}

.button:hover { background: var(--white); transform: scale(1.05); }
.button:active { transform: scale(.97); }
.button-small { padding: .6em 1.2em; font-size: .9375rem; }
.button-dark { background: var(--ink); color: var(--white); }
.button-dark:hover { background: var(--lift); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 14px;
  right: var(--edge);
  left: var(--edge);
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.site-header .button { justify-self: end; }

/* The current page's menu link and the Start a project button: yellow with blue text, with live code behind the text. page.js adds the canvas. */
.site-nav a[aria-current="page"],
.site-header > .button {
  position: relative;
  isolation: isolate;
  background: var(--snap);
  color: var(--ink);
  font-weight: 700; /* Geist's heaviest weight here. Keep the link's width in mind: the menu needs about 975px to fit. */
  text-shadow: 0 0 5px var(--snap), 0 0 2px var(--snap), 0 0 1px var(--snap);
}

/* Bigger than the other links without moving them, so the header's spacing doesn't change. */
.site-nav a[aria-current="page"] { z-index: 1; scale: 1.06; }

/* The links at each end grow inward, so they stay inside the menu's pill. */
.site-nav a[aria-current="page"]:first-child { transform-origin: left center; }
.site-nav a[aria-current="page"]:last-child { transform-origin: right center; }

/* It keeps its size on hover and press, so it always matches the logo. */
.site-header > .button:hover { background: var(--snap); filter: brightness(1.1); transform: none; }
.site-header > .button:active { filter: brightness(.95); transform: none; }

/* The same size and shape as the logo opposite it, with the hand on the left and two lines of text, so the header is symmetrical. */
.site-header > .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--logo-width) * .05);
  width: calc(var(--logo-width) + 30px);
  height: calc(var(--logo-width) * 411 / 1465 + 13px);
  padding: 0 8px;
  border: 1px solid var(--ink); /* Its edge, over the yellow closing panel and Premium plan. It's inside the size above. */
  font-size: calc(var(--logo-width) * .15);
  line-height: 1;
  white-space: normal;
}

/* The hand is drawn here so the button's markup stays as written. It keeps cocking, which isn't needed on the page it links to. */
.site-header > .button::before {
  content: '';
  flex: none;
  width: calc(var(--logo-width) * .26); /* Small enough to stay inside the button at the biggest point of its snap. */
  aspect-ratio: 357 / 402;
  background: var(--ink);
  -webkit-mask: url(assets/snap-hand.png) center / contain no-repeat;
  mask: url(assets/snap-hand.png) center / contain no-repeat;
  transform-origin: 55% 62%;
}

.site-header > .button:not([aria-current="page"])::before { animation: row-hand-cock 2.4s cubic-bezier(.2, .9, .3, 1) infinite; }

/* Dressed like the logo: the same blue pill and yellow edge, with the first line of text white and the second yellow. The split is a gradient clipped to the text, so the markup stays as written. */
.site-header > .button,
.site-header > .button:hover,
.site-header > .button:active {
  background:
    linear-gradient(var(--white) 50%, var(--snap) 50%) text,
    linear-gradient(rgb(14 15 43 / .88), rgb(14 15 43 / .88));
  color: transparent;
  text-shadow: none;
  border-color: var(--snap);
  filter: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header > .button::before { background: var(--white); }

/* On hover the button grows a little, its yellow edge glows and pulses, and the hand snaps and vibrates. It keeps its colours. */
.site-header > .button { transition: scale .18s cubic-bezier(.3, 1.6, .5, 1), background .15s; }
.site-header > .button:hover { scale: 1.08; animation: button-glow 1.2s ease-in-out infinite; }
.site-header > .button:hover::before { animation: button-hand-vibrate .9s linear infinite; }

@keyframes button-hand-vibrate {
  0%, 60%, 100% { rotate: 0deg; translate: 0 0; scale: 1; }
  66% { rotate: 12deg; translate: 0 0; scale: .94; }
  72% { rotate: -10deg; translate: 0 0; scale: 1.12; }
  76% { rotate: 7deg; translate: 1px -1px; }
  80% { rotate: -7deg; translate: -1px 1px; }
  84% { rotate: 6deg; translate: 1px 1px; }
  88% { rotate: -5deg; translate: -1px -1px; }
  92% { rotate: 3deg; translate: 1px 0; }
  96% { rotate: -2deg; translate: -1px 0; }
}

@keyframes button-glow {
  0%, 100% { box-shadow: 0 0 4px 0 rgb(255 209 102 / .45), inset 0 0 3px 0 rgb(255 209 102 / .3); }
  50% { box-shadow: 0 0 16px 3px rgb(255 209 102 / .85), inset 0 0 8px 1px rgb(255 209 102 / .5); }
}

/* Set like the logo's lettering: heavy, lowercase, with the letters and the two lines pressed together. */
.site-header > .button {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  letter-spacing: -.04em;
  line-height: .82;
  text-transform: lowercase;
}

.code-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.logo-link,
.site-nav {
  border: 1px solid rgb(198 200 236 / .2);
  border-radius: var(--radius);
  background: rgb(14 15 43 / .88); /* Solid enough to read over anything, since the header is always on screen. */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.logo-link { justify-self: start; padding: 6px 16px 5px 12px; border-color: var(--snap); } /* A clear edge, so its pill reads as the same size as the Start a project button. */
.logo { width: var(--logo-width); height: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
}

.site-nav a {
  padding: .35em .95em;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.site-nav a:not([aria-current="page"]):hover { background: var(--white); color: var(--ink); }

/* Added by page.js. Only shows where the desktop menu doesn't fit. */
.menu-button,
.menu-code,
.menu-snap { display: none; }
.menu-locked { overflow: hidden; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  padding: 84px var(--edge) 34px;
  overflow: clip;
  cursor: pointer;
}

.hero-title {
  position: relative;
  z-index: 2;
  width: fit-content;
  font-family: var(--display);
  font-size: min(14.2vw, 25.5svh);
  font-stretch: 100%;
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.02em;
  pointer-events: none;
}

.line { display: block; width: fit-content; white-space: nowrap; }
.ltr { display: inline-block; }
.ltr-space { width: .28em; }

.hero-hand {
  position: absolute;
  top: 50%;
  right: var(--edge);
  z-index: 1;
  height: min(76svh, 56vw);
  margin-top: calc(min(76svh, 56vw) / -2 + 10px);
  aspect-ratio: 357 / 402;
  pointer-events: none;
}

.hero-mark { width: 100%; height: 100%; transform-origin: 55% 62%; }

.hero-mark.is-snapping,
.cta-hand.is-snapping { animation: hand-snap .42s cubic-bezier(.2, .9, .3, 1); }

@keyframes hand-snap {
  0% { rotate: 0deg; scale: 1; }
  30% { rotate: 8deg; scale: .96; }
  52% { rotate: -8deg; scale: 1.07; }
  100% { rotate: 0deg; scale: 1; }
}

.hero-burst {
  position: absolute;
  inset: 0;
  overflow: visible;
  opacity: 0;
  transform-origin: 43% 18%;
}

.hero-burst.is-snapping { animation: hand-burst .5s .12s ease-out; }

@keyframes hand-burst {
  0% { opacity: 0; transform: scale(.55); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.55); }
}

.hero-foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-top: clamp(16px, 3svh, 34px);
}

.hero-lead {
  max-width: 31em;
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
  text-shadow: 0 0 18px var(--void), 0 0 6px var(--void);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

/* The Animations switch: a small track and knob, yellow while on. */
.anim-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  text-shadow: 0 0 12px var(--void);
  cursor: pointer;
}

.anim-toggle::before {
  content: "";
  width: 46px;
  height: 24px;
  border: 2px solid var(--white);
  border-radius: var(--radius);
  box-sizing: border-box;
  background: rgb(14 15 43 / .6);
  transition: background-color .2s, border-color .2s;
}

.anim-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 5px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 3px;
  background: var(--white);
  box-shadow: 0 1px 3px rgb(0 0 0 / .4);
  transition: transform .2s;
}

.anim-toggle[aria-checked="true"]::before { background: var(--snap); border-color: var(--snap); }
.anim-toggle[aria-checked="true"]::after { transform: translateX(22px); }

.hero-hint {
  position: absolute;
  top: 80px;
  right: calc(var(--edge) + (var(--logo-width) + 30px) / 2); /* Its right edge is at the middle of the Start a project button... */
  translate: 50% 0; /* ...and this moves it half its own width back, so it's centered under the button. */
  z-index: 2;
  color: var(--lilac);
  font-size: .9375rem;
  white-space: nowrap;
  text-shadow: 0 0 10px var(--void);
  pointer-events: none;
}

/* Websites page: title along the top, hand low on the right. */
@media (min-width: 721px) {
  .hero-websites { justify-content: space-between; padding-top: clamp(76px, 11svh, 104px); }
  .hero-websites .hero-title { font-size: min(14.8vw, 25svh); }
  .hero-websites .title-three { font-size: min(14.8vw, 17svh); }
  .hero-websites .title-wide { font-size: min(10.5vw, 25svh); }

  .hero-websites .hero-hand {
    top: auto;
    bottom: 26px;
    height: min(42svh, 30vw);
    margin-top: 0;
  }

  .hero-websites .hero-foot {
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - min(42svh, 30vw) * .95);
  }

  /* Where the actions sit at the right edge, this keeps the last link clear of the chat button. */
  .hero:not(.hero-websites, .hero-pricing) .hero-actions {
    margin-right: max(0px, calc(var(--chat-button) + 32px - var(--edge)));
  }
}

/* Pricing page: everything centered, with a small hand above the title. */
.hero-pricing {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-pricing .hero-hand {
  position: relative;
  top: auto;
  right: auto;
  height: min(25svh, 24vw);
  margin: 0 0 clamp(8px, 2svh, 20px);
}

.hero-pricing .hero-title { font-size: min(14vw, 21svh); }
.hero-pricing .line { margin-inline: auto; }

.hero-pricing .hero-foot {
  flex-direction: column;
  align-items: center;
}

.hero-pricing .hero-actions { justify-content: center; }

/* Start a project page: a shorter hero, so the form shows on the first screen. */
.hero-start { min-height: 68svh; }
.hero-start .hero-title { font-size: min(11vw, 20svh); }

.hero-start .hero-hand {
  height: min(50svh, 36vw);
  margin-top: calc(min(50svh, 36vw) / -2 + 10px);
}

/* ---------- Start a project form ---------- */

.start { padding: clamp(8px, 2vh, 24px) var(--edge) clamp(64px, 12vh, 140px); }

.start-form,
.start-done {
  display: grid;
  gap: clamp(24px, 4vh, 40px);
  padding: clamp(22px, 3.6vw, 56px);
  border: 1px solid rgb(198 200 236 / .24);
  border-radius: var(--radius);
  background: rgb(26 28 68 / .92);
}

.start-form[hidden],
.start-done[hidden] { display: none; }

.start-done { justify-items: start; outline: none; }

.start-done h2 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 7.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.02em;
}

.start-done p {
  max-width: 34em;
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vh, 24px) clamp(14px, 2vw, 24px);
}

.field { display: grid; gap: 8px; }
.field-row .field-wide { grid-column: 1 / -1; }  /* Fills the row, e.g. the Start form's last field. */

.start-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.start-form legend { margin-bottom: 10px; padding: 0; }

.start-form label:not(.pill),
.start-form legend { font-weight: 600; }

.start-form small { color: var(--lilac); font-size: 1em; font-weight: 400; }

.start-form input[type="text"],
.start-form input[type="email"],
.start-form input[type="tel"],
.start-form textarea,
.audit-fields input,
.audit-fields textarea,
.calc-form input,
.calc-form textarea {
  width: 100%;
  padding: .75em 1em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: rgb(14 15 43 / .7);
  color: var(--white);
  font: inherit;
}

.start-form textarea { display: block; min-height: 8em; resize: vertical; }
.audit-fields textarea, .calc-form textarea { display: block; resize: vertical; }

.start-form input:hover,
.start-form textarea:hover,
.audit-fields input:hover,
.audit-fields textarea:hover,
.calc-form input:hover,
.calc-form textarea:hover { border-color: var(--lilac); }

.start-form input:focus-visible,
.start-form textarea:focus-visible,
.audit-fields input:focus-visible,
.audit-fields textarea:focus-visible,
.calc-form input:focus-visible,
.calc-form textarea:focus-visible {
  outline: 3px solid var(--snap);
  outline-offset: 2px;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* The real checkbox or radio stays on top of its pill, invisible, so it still gets clicks and error messages. */
.pill { position: relative; }

.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* An option starts as a line of code. Picking it opens the tag out into a button. Both use the same mono font, so nothing reflows. */
.pill span {
  position: relative;
  display: block;
  padding: .55em 2em;
  border-radius: var(--radius);
  background: linear-gradient(var(--snap), var(--snap)) center / 0% 100% no-repeat rgb(14 15 43 / .7);
  color: var(--lilac);
  font: 400 .9375rem/1.5 'Geist Mono', ui-monospace, Menlo, monospace;
  transition: background-size .28s cubic-bezier(.2, .9, .3, 1), border-radius .28s, color .12s;
}

.pill span::before,
.pill span::after {
  position: absolute;
  top: .55em;
  color: var(--snap);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1), opacity .16s;
}

.pill span::before { content: '<'; right: calc(100% - 2em + .1em); }
.pill span::after { content: '/>'; left: calc(100% - 2em + .3em); }

.pill input:hover + span { color: var(--white); }

.pill input:checked + span {
  border-radius: var(--radius);
  background-size: 100% 100%;
  color: var(--ink);
  font-weight: 500;
  animation: pill-snap .36s cubic-bezier(.2, .9, .3, 1);
}

.pill input:checked + span::before { opacity: 0; transform: translateX(-1em); }
.pill input:checked + span::after { opacity: 0; transform: translateX(1em); }
.pill input:focus-visible + span { outline: 3px solid var(--snap); outline-offset: 3px; }

@keyframes pill-snap {
  0% { scale: .94; box-shadow: 0 0 0 0 rgb(255 209 102 / .6); }
  55% { scale: 1.06; }
  100% { scale: 1; box-shadow: 0 0 0 14px rgb(255 209 102 / 0); }
}

.start-form .button {
  justify-self: start;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.start-form .button:disabled { opacity: .5; cursor: default; }

/* Book a call (book.html): a month calendar of open days, and the picked day's times beside it. */
.book-picker {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.book-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.book-month h2 { font-size: 1.25rem; font-weight: 700; }

.book-nav {
  width: 40px;
  height: 40px;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: rgb(14 15 43 / .7);
  color: var(--white);
  font: inherit;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}

.book-nav:hover:not(:disabled) { border-color: var(--snap); }
.book-nav:disabled { opacity: .3; cursor: default; }

.book-weekdays,
.book-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.book-weekdays { margin-bottom: 6px; color: var(--lilac); font-size: .8125rem; }

.book-day {
  height: 46px;
  padding: 0;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: rgb(14 15 43 / .7);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.book-day:hover:not(:disabled) { border-color: var(--snap); }
.book-day:disabled { border-color: transparent; background: none; color: rgb(198 200 236 / .35); font-weight: 400; cursor: default; }
.book-day[aria-pressed="true"] { border-color: var(--snap); background: var(--snap); color: var(--ink); }

.book-nav:focus-visible,
.book-day:focus-visible { outline: 3px solid var(--snap); outline-offset: 2px; }

.book-times legend { font-size: 1.25rem; font-weight: 700; }
.book-zone { margin-bottom: 14px; color: var(--lilac); font-size: .875rem; }

.book-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 392px;
  overflow-y: auto;
}

/* The real radio sits on top of its time, invisible, like .pill. */
.book-time { position: relative; }
.book-time input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.book-time span {
  display: block;
  padding: .7em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}

.book-time input:hover + span { border-color: var(--snap); }
.book-time input:checked + span { border-color: var(--snap); background: var(--snap); color: var(--ink); }
.book-time input:focus-visible + span { outline: 3px solid var(--snap); outline-offset: 2px; }

.book-note { margin-top: 12px; color: var(--lilac); }
.book-error { margin: 0; color: var(--snap); }

@media (max-width: 760px) {
  .book-picker { grid-template-columns: minmax(0, 1fr); }
  .book-day { height: 42px; }
  .book-slots { max-height: none; }
}

/* ---------- Statement ---------- */

.statement {
  padding: clamp(96px, 20vh, 220px) var(--edge);
}

.statement p {
  max-width: 19em;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6.1vw, 6.4rem);
  font-stretch: 86%;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.015em;
}

/* ---------- Service scenes ---------- */

.scenes {
  position: relative;
  overflow: clip;
  background: linear-gradient(rgb(14 15 43 / 0), rgb(14 15 43 / .55) 12%, rgb(14 15 43 / .55) 88%, rgb(14 15 43 / 0));
}

.scene {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 84px var(--edge) 48px;
  perspective: 1500px;
}

/* Every other scene puts its window on the left. */
.scene:nth-child(even) { grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); }
.scene:nth-child(even) .scene-copy { order: 2; }

.scene h2 {
  font-family: var(--display);
  font-size: min(6.3vw, 13svh);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.02em;
}

.scene-copy > p:not(.scene-price) {
  max-width: 26em;
  margin-top: clamp(16px, 3svh, 28px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}

.scene-price {
  margin-top: clamp(16px, 3svh, 28px);
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.3vw, 2.2rem);
  font-weight: 700;
}

/* The price links to the Start a project form. */
.scene-price a { text-decoration: none; }
.scene-price a:hover { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .15em; }

.mock {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(76svh, 640px);
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
  background: var(--night);
  box-shadow: 0 50px 120px -24px rgb(106 108 255 / .55), 0 12px 40px rgb(0 0 0 / .4);
  will-change: transform;
}

/* page.js adds the outline and .is-drawing. Until the outline has drawn, the window itself is hidden. */
.mock.is-drawing { border-color: transparent; background: transparent; box-shadow: none; }
.mock.is-drawing > :not(.mock-outline) { visibility: hidden; }

.mock-outline { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.mock-outline rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); rx: 17px; fill: none; stroke: var(--snap); stroke-width: 2px; stroke-dasharray: 1; stroke-dashoffset: 1; }

.mock-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid rgb(198 200 236 / .16);
  background: var(--void);
  color: var(--lilac);
  font-size: .8125rem;
}

.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgb(198 200 236 / .3); }
.mock-bar span { margin-left: 10px; }

.mock-body { position: relative; flex: 1; min-height: 0; }

.mock-code {
  position: absolute;
  inset: 0;
  display: flex; /* Also stops the line breaks in the HTML from showing as blank lines. */
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: clamp(16px, 2.4vw, 36px);
  overflow: hidden;
  color: var(--white);
  font: 400 clamp(.75rem, 1.22vw, 1.1875rem)/1.7 'Geist Mono', ui-monospace, Menlo, monospace;
}

.code-line { width: fit-content; max-width: 100%; white-space: pre; }
.mock-code em { color: var(--snap); font-style: normal; }
.mock-code b { color: var(--lilac); font-weight: 400; }

.mock-real {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--night);
}

.mock-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  aspect-ratio: 1;
  margin: -30% 0 0 -30%;
  border: 2px solid var(--snap);
  border-radius: 50%;
  box-shadow: 0 0 30px 2px rgb(255 209 102 / .5);
  opacity: 0;
  pointer-events: none;
}

.mock-hand {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: auto;
  margin-top: -13%;
  margin-left: -11%;
  opacity: 0;
  filter: drop-shadow(0 0 22px var(--void));
  pointer-events: none;
}

/* The example website: bright, so it reads as a finished product against the dark page. */
.real-site {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 16px);
  padding: clamp(12px, 1.5vw, 20px);
  background: #fbfaf6;
  color: var(--ink);
  font-size: clamp(.75rem, 1vw, .9375rem);
}

.m-nav { display: flex; align-items: center; gap: 14px; }
.m-nav strong { margin-right: auto; font-weight: 700; }
.m-book { padding: .3em .9em; border-radius: var(--radius); background: var(--ink); color: var(--white); }

.m-hero {
  display: grid;
  flex: 1;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 16px;
  min-height: 0;
}

.m-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.2vw, 3.1rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.02em;
}

.m-sub { margin: .7em 0 1em; color: #55577f; }
.m-button { display: inline-block; padding: .55em 1.2em; border-radius: var(--radius); background: var(--snap); font-weight: 600; }

.m-art {
  position: relative;
  height: 100%;
  min-height: 90px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--iris), var(--lift) 70%);
}

.m-art i {
  position: absolute;
  right: 14%;
  bottom: -16%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--snap);
  box-shadow: 0 0 60px rgb(255 209 102 / .7);
}

.m-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-tiles div { padding: .8em; border-radius: var(--radius); background: #efeef3; }
.m-tiles b { display: block; font-weight: 700; }
.m-tiles span { color: #55577f; font-size: .9em; line-height: 1.25; }

/* The example call. */
.real-call {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.3vh, 12px);
  padding: clamp(14px, 1.8vw, 24px);
  font-size: clamp(.8125rem, 1.08vw, 1rem);
  line-height: 1.35;
}

.call-status { display: flex; align-items: center; gap: 8px; color: var(--lilac); }
.call-status i { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; }

.bubble {
  align-self: flex-start;
  max-width: 82%;
  padding: .65em .95em;
  border-radius: var(--radius) var(--radius) var(--radius) 2px;
  background: var(--lift);
}

.bubble-ai {
  align-self: flex-end;
  border-radius: var(--radius) var(--radius) 2px var(--radius);
  background: var(--snap);
  color: var(--ink);
}

.call-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.call-steps span {
  padding: .35em .8em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  color: var(--lilac);
  font-size: .9em;
}

/* The example dashboard. */
.real-app {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 16px);
  padding: clamp(14px, 1.8vw, 24px);
  font-size: clamp(.75rem, 1vw, .9375rem);
}

.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app-stats div { padding: .8em 1em; border-radius: var(--radius); background: var(--lift); }
.app-stats span { display: block; color: var(--lilac); }
.app-stats b { font-family: var(--display); font-size: clamp(1.2rem, 2.3vw, 2.2rem); font-weight: 800; line-height: 1.1; }

.app-chart {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 3%;
  min-height: 0;
  padding: 12px 12px 0;
  border-bottom: 1px solid rgb(198 200 236 / .25);
}

.app-chart i {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(var(--snap), var(--iris));
  transform-origin: bottom;
}

.app-rows li {
  display: flex;
  justify-content: space-between;
  padding: .45em 0;
  border-bottom: 1px solid rgb(198 200 236 / .14);
}

.app-rows li span:last-child { color: var(--lilac); }
.app-rows .is-due { color: var(--snap) !important; }

/* The example audit: its rows share the height a chart would take. */
.real-audit .app-rows { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.real-audit .app-rows li { flex: 1; align-items: center; }

.scene-link {
  display: inline-block;
  margin-top: clamp(12px, 2svh, 20px);
  font-weight: 500;
  text-underline-offset: .25em;
}

.scene-link:hover { color: var(--snap); }

/* ---------- Clients ---------- */

.clients { padding: clamp(80px, 14vh, 160px) 0 clamp(40px, 8vh, 80px); overflow: clip; }

.clients h2 {
  padding: 0 var(--edge);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  font-weight: 400;
}

.marquee { margin-top: clamp(16px, 3vh, 28px); }

.marquee-track {
  display: flex;
  gap: .8em;
  width: max-content;
  font-family: var(--display);
  font-size: clamp(2.8rem, 8.5vw, 9rem);
  font-stretch: 110%;
  font-weight: 800;
  line-height: 1.1;
  animation: marquee 42s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track li {
  color: rgb(198 200 236 / .3);
  transition: color .2s;
}

.marquee-track li:hover { color: var(--snap); }

@keyframes marquee {
  to { transform: translateX(calc(-50% - .4em)); }
}

/* ---------- Free website audit ---------- */

.audit { padding: clamp(64px, 12vh, 140px) var(--edge) clamp(24px, 6vh, 64px); }

.audit h2 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 9.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.02em;
}

.audit > p {
  max-width: 34em;
  margin-top: clamp(14px, 2.5vh, 24px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}

/* A browser window: the domain goes in its address bar, and the window opens to ask for the rest. */
.audit-form {
  margin-top: clamp(24px, 4vh, 40px);
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
  background: var(--void);
  box-shadow: 0 30px 80px -24px rgb(106 108 255 / .55);
}

.audit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px; }
.audit-dots { display: flex; flex: none; gap: 6px; padding-left: 4px; }
.audit-dots i { width: 11px; height: 11px; border-radius: 50%; background: rgb(198 200 236 / .3); }

.audit-url {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  min-width: 0;
  padding: 0 1.1em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: var(--night);
  font: 400 clamp(1rem, 1.4vw, 1.25rem) 'Geist Mono', ui-monospace, Menlo, monospace;
}

.audit-url:focus-within { outline: 3px solid var(--snap); outline-offset: 2px; }
.audit-prefix { flex: none; color: var(--lilac); }

.audit-url input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: .8em 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--white);
  font: inherit;
}

.audit-form .button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.audit-next { flex: none; }
.audit-form:not(.is-step-one) .audit-next { display: none; }

/* page.js adds .is-step-one. Without it, every field just shows. */
.audit-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s cubic-bezier(.3, .8, .3, 1); }
.is-step-one .audit-more { grid-template-rows: 0fr; }

.audit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 16px clamp(14px, 2vw, 24px);
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 clamp(14px, 2vw, 24px);
  overflow: hidden;
  border: 0;
}

.audit-fields::before { content: ''; grid-column: 1 / -1; height: 0; }
.audit-fields label, .calc-form label { font-weight: 600; }
.audit-note { grid-column: 1 / -1; }
.audit-fields small, .calc-form small { color: var(--lilac); font-size: 1em; font-weight: 400; }
.audit-send { grid-column: 1 / -1; justify-self: start; margin-bottom: clamp(16px, 2.4vw, 24px); }

.audit-fields > * { transition: opacity .3s, transform .4s cubic-bezier(.2, .9, .3, 1); }
.audit-fields > :nth-child(2) { transition-delay: .08s; }
.audit-fields > :nth-child(3) { transition-delay: .16s; }
.audit-fields > :nth-child(4) { transition-delay: .24s; }
.is-step-one .audit-fields > * { opacity: 0; transform: translateY(14px); }

.audit-done {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: clamp(24px, 4vh, 40px);
  padding: clamp(22px, 3.6vw, 48px);
  border-radius: var(--radius);
  background: var(--snap);
  color: var(--ink);
  outline: none;
  animation: audit-snap .55s cubic-bezier(.3, .8, .3, 1);
}

.audit-done[hidden] { display: none; }

.audit-done h3 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  font-stretch: 92%;
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.02em;
}

.audit-done p { max-width: 40em; font-size: clamp(1.0625rem, 1.45vw, 1.3125rem); line-height: 1.4; overflow-wrap: anywhere; }

@keyframes audit-snap {
  from { clip-path: circle(0% at 50% 50%); }
  to { clip-path: circle(130% at 50% 50%); }
}

/* ---------- Home page pricing link ---------- */

.home-pricing { padding: clamp(64px, 12vh, 140px) var(--edge) clamp(80px, 16vh, 180px); }

.home-pricing h2 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 9.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.02em;
}

.home-pricing p {
  margin: clamp(14px, 2.5vh, 24px) 0 clamp(20px, 4vh, 36px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
}

/* ---------- Websites page tiers ---------- */

.tiers { padding: clamp(64px, 12vh, 140px) var(--edge) 0; }

.tiers > h2 {
  max-width: 11em;
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 7.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.02em;
}

.tiers > p {
  max-width: 34em;
  margin-top: clamp(14px, 2.5vh, 24px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}
/* The three plans. As written here they're stacked cards, with each line's name beside its value: that's the phone layout,
   and what browsers without subgrid get. Wider screens turn them into a compare table further down. */
.tier-stage {
  --cell: clamp(.9375rem, 1.2vw, 1.0625rem);
  --tier-pad: clamp(16px, 1.7vw, 26px);
  display: grid;
  gap: 14px;
  margin-top: clamp(28px, 6vh, 56px);
}

.tier-labels { display: none; }

.tier {
  position: relative;
  border-radius: var(--radius);
  background: var(--tier);
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, background-color .2s;
}

.tier-real { position: relative; z-index: 1; border-radius: inherit; background: var(--tier); box-shadow: inset 0 0 0 1px rgb(198 200 236 / .2); } /* The thin edge keeps Starter's dark column apart from the page. */
.tier-head { padding: clamp(18px, 2vw, 30px) var(--tier-pad); }

.tier h3 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-stretch: 86%;
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.02em;
}

.tier-price {
  margin: .2em 0 .35em;
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.75rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: 1;
}

.tier-price small { margin-left: .15em; font: 500 .38em/1 'Geist Mono', ui-monospace, Menlo, monospace; }

/* The whole plan is the link: the button's ::after covers it. The button mustn't be transformed, or ::after would shrink to the button. */
.tier .button::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.tier .button:hover,
.tier .button:active { transform: none; }

.tier ul,
.tier-labels { font-size: var(--cell); line-height: 1.3; }

.tier li,
.tier-labels li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 2.8em;
  padding: .5em var(--tier-pad);
  border-top: 1px solid rgb(255 255 255 / .16);
}

.tier li span { color: var(--lilac); }
.tier li b { font-weight: 600; text-align: right; }
.tier-yes,
.tier-no { font-size: 0; } /* The words stay for screen readers. Everyone else sees a tick or a dash. */
.tier-yes::before { content: '✓'; color: var(--snap); font-size: var(--cell); }
.tier-no::before { content: '–'; font-size: var(--cell); opacity: .4; }
.tier .tier-group { display: none; }

.tier-premium { color: var(--ink); }
.tier-premium .tier-price,
.tier-premium .tier-yes::before,
.tier-premium li span { color: var(--ink); }
.tier-premium li { border-color: rgb(21 22 58 / .22); }

.tier-notes {
  display: grid;
  gap: .5em;
  max-width: 62em;
  margin-top: clamp(16px, 3vh, 28px);
  color: var(--lilac);
  font-size: .875rem;
  line-height: 1.45;
}

/* A plan pops out under the cursor, or when its button has keyboard focus. */
.tier:has(.button:focus-visible) { z-index: 2; transform: translateY(-10px) scale(1.04); box-shadow: 0 0 0 2px var(--white), 0 28px 70px rgb(5 6 24 / .7); }

@media (hover: hover) and (pointer: fine) {
  .tier:hover { z-index: 2; transform: translateY(-10px) scale(1.04); box-shadow: 0 0 0 2px var(--white), 0 28px 70px rgb(5 6 24 / .7); }
}

/* The compare table: the names in a column on the left, then one column per plan, with every row lined up by subgrid. */
@media (min-width: 761px) {
  @supports (grid-template-rows: subgrid) {
    .tier-stage {
      grid-template-rows: auto repeat(14, auto); /* The plan's heading, then 14 lines. Keep in step with the lists in websites.html. */
      grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
      gap: 0 clamp(6px, 1vw, 14px);
    }

    .tier-labels,
    .tier,
    .tier-real,
    .tier ul { display: grid; grid-template-rows: subgrid; }
    .tier-labels { grid-row: 2 / -1; grid-column: 1; }
    .tier,
    .tier-real { grid-row: 1 / -1; }
    .tier ul { grid-row: 2 / -1; }

    .tier-labels li { justify-content: flex-start; padding-left: 0; color: var(--lilac); }
    .tier-labels .tier-group { color: var(--snap); font: 500 .8125rem/1.3 'Geist Mono', ui-monospace, Menlo, monospace; }
    .tier li { justify-content: flex-start; }
    .tier li b { text-align: left; }
    .tier li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* The left column shows the names. These stay for screen readers. */
    .tier .tier-group { display: flex; }
    .tier h3 { font-size: clamp(1.15rem, 2.5vw, 2.4rem); } /* Professional has to fit its column. */
    .tier-price { font-size: clamp(1.7rem, 4vw, 3.75rem); }
  }
}

/* Set by page.js: each plan builds once as it comes into view. An outline draws, its code types, the hand snaps and the plan renders. */
.tier-code,
.tier-outline,
.tier-hand,
.tier-ring { display: none; }

.tiers-build .tier-labels { opacity: 0; transition: opacity .3s; }
.tiers-build.is-live .tier-labels { opacity: 1; }
.tiers-build .tier { overflow: hidden; background: transparent; }
.tiers-build .tier:not(.is-snapped) { pointer-events: none; }
.tiers-build .tier.is-outlining { background: var(--night); }
.tiers-build .tier-real { clip-path: circle(0% at 80% 60px); }
.tiers-build .tier.is-snapped .tier-real { clip-path: circle(200% at 80% 60px); transition: clip-path var(--panel-snap-ms) cubic-bezier(.2, .7, .2, 1); }

.tiers-build .tier-code {
  z-index: 0;
  display: flex;
  justify-content: flex-start;
  padding: clamp(18px, 2vw, 30px) var(--tier-pad);
  font-size: clamp(.75rem, 1.05vw, .9375rem);
}

.tiers-build .tier:not(.is-typing) .code-line { clip-path: inset(0 100% 0 0); }
.tiers-build .tier.is-typing .code-line { clip-path: inset(0); transition: clip-path var(--type-ms) steps(var(--chars)) var(--type-delay); }

.tiers-build .tier-outline {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.tiers-build .tier-outline rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); rx: 21px; fill: none; stroke: var(--snap); stroke-width: 2px; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tiers-build .tier.is-outlining .tier-outline { opacity: 1; }
.tiers-build .tier.is-outlining .tier-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset var(--panel-outline-ms) linear; }
.tiers-build .tier.is-snapped .tier-outline { opacity: 0; transition: opacity .2s; }

.tiers-build .tier-hand,
.tiers-build .tier-ring { position: absolute; top: 60px; left: 80%; z-index: 4; display: block; opacity: 0; pointer-events: none; }
.tiers-build .tier-hand { width: clamp(56px, 6vw, 84px); height: auto; translate: -50% -50%; transform-origin: 55% 62%; filter: drop-shadow(0 0 18px var(--void)); }
.tiers-build .tier-ring { width: 72px; aspect-ratio: 1; margin: -36px 0 0 -36px; border: 2px solid var(--snap); border-radius: 50%; box-shadow: 0 0 30px 2px rgb(255 209 102 / .6); }
.tiers-build .tier.is-hand .tier-hand { opacity: 1; }
.tiers-build .tier.is-snapped .tier-hand { opacity: 0; animation: hand-snap var(--panel-snap-ms) cubic-bezier(.2, .9, .3, 1); transition: opacity .15s .15s; }
.tiers-build .tier.is-snapped .tier-ring { animation: code-card-ring calc(var(--panel-snap-ms) * 1.4) ease-out; }

.tiers + .pricing { padding-top: clamp(80px, 16vh, 180px); }

/* ---------- Website calculator (Pricing) ---------- */

.calc { padding: clamp(64px, 12vh, 140px) var(--edge) 0; }

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(28px, 6vh, 56px);
}

.calc-label { margin-bottom: 12px; color: var(--lilac); font: 500 .9375rem/1.2 'Geist Mono', ui-monospace, Menlo, monospace; }
.calc-label:not(:first-child) { margin-top: 44px; }

.calc-pages { display: flex; align-items: baseline; gap: .3em; }

.calc-pages output {
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(4rem, 9vw, 8rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: .95;
}

.calc-pages span { color: var(--lilac); font-size: 1.25rem; }
#calc-pages { width: 100%; margin: 16px 0 0; accent-color: var(--snap); cursor: pointer; }
.calc-ticks { display: flex; justify-content: space-between; margin-top: 6px; color: var(--lilac); font: 400 .875rem/1 'Geist Mono', ui-monospace, Menlo, monospace; }
.calc .pill input:disabled { cursor: default; }
.calc .pill input:disabled + span { opacity: .75; }

.calc-result {
  position: sticky;
  top: 96px;
  padding: clamp(22px, 3vw, 40px);
  border: 1px solid rgb(198 200 236 / .24);
  border-radius: var(--radius);
  background: var(--night);
}

.calc-total {
  margin-top: 8px;
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(3.25rem, 6vw, 5.5rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: 1;
}

.calc-total small { font-size: .32em; font-weight: 700; letter-spacing: 0; }
.calc-monthly { min-height: 1.5em; margin-top: 6px; font-weight: 500; }
.calc-lines { margin-top: 18px; }
.calc-lines li { display: flex; justify-content: space-between; gap: 16px; padding: .5em 0; border-top: 1px solid rgb(255 255 255 / .22); }
.calc-lines li:last-child { border-bottom: 1px solid rgb(255 255 255 / .22); }
.calc-lines li span:last-child { flex: none; color: var(--snap); font-weight: 600; }
.calc-included { margin-top: 12px; color: var(--lilac); font-size: .9375rem; }
.calc-included:empty { display: none; }

.calc-form { margin-top: 18px; }
.calc-form .button { justify-self: start; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.calc-open { display: block; }
.calc-form:not(.is-step-one) .calc-open { display: none; }
.calc-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s cubic-bezier(.3, .8, .3, 1); }
.is-step-one .calc-more { grid-template-rows: 0fr; }
.calc-fields { display: grid; gap: 14px; min-width: 0; min-height: 0; margin: 0; padding: 0 6px; overflow: hidden; border: 0; }
.calc-fields::before, .calc-fields::after { content: ''; height: 0; } /* Their gaps leave room for the focus outlines the clipping would cut off. */
.calc .audit-done { margin-top: 18px; padding: 22px; }
.calc .audit-done h3 { font-size: clamp(2rem, 4vw, 3rem); }
.calc-note { margin-top: 14px; color: var(--lilac); font-size: .875rem; }

@media (max-width: 899px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { position: static; }
}

/* ---------- Pricing ---------- */

.pricing { padding: clamp(64px, 12vh, 140px) var(--edge); }

.big-heading,
.pricing-head h2,
.calc-head h2,
.plans-head h2 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 9.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.02em;
}

.pricing-head p,
.calc-head p,
.plans-head p {
  max-width: 34em;
  margin-top: clamp(14px, 2.5vh, 24px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}

.price-group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  gap: 12px 32px;
  margin-top: clamp(48px, 9vh, 96px);
}

.price-group h2 {
  position: sticky;
  top: 84px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.3vw, 3.25rem);
  font-stretch: 90%;
  font-weight: 700;
  line-height: 1;
}

/* Each list is a code file, with a row per line. page.js names the file and adds a .row-ui copy to each row for hover. */
.price-group ul {
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
  background: #0b0c24;
  counter-reset: line;
}

.price-group ul[data-file]::before {
  content: attr(data-file);
  display: flex;
  align-items: center;
  height: 38px;
  padding-left: 76px;
  border-bottom: 1px solid rgb(198 200 236 / .16);
  background:
    radial-gradient(circle 5px at 19px 50%, rgb(198 200 236 / .3) 99%, transparent),
    radial-gradient(circle 5px at 35px 50%, rgb(198 200 236 / .3) 99%, transparent),
    radial-gradient(circle 5px at 51px 50%, rgb(198 200 236 / .3) 99%, transparent),
    var(--void);
  color: var(--lilac);
  font: 400 .8125rem 'Geist Mono', ui-monospace, Menlo, monospace;
}

.price-group li {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 2px 24px;
  padding: 12px 20px 12px 56px;
  counter-increment: line;
  font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
}

.price-group li::before {
  content: counter(line);
  position: absolute;
  top: 50%;
  left: 20px;
  translate: 0 -50%;
  color: rgb(198 200 236 / .4);
  font-size: .875rem;
  line-height: 1.5;
}

.pricing-link { margin-top: clamp(32px, 6vh, 56px); }

/* ---------- Terms and Privacy ---------- */

/* Same two columns as .price-group, with plain text instead of code rows. */
.legal { padding: clamp(48px, 10vh, 120px) var(--edge) clamp(80px, 16vh, 180px); }

.legal-group {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  gap: 12px 32px;
}

.legal-group + .legal-group { margin-top: clamp(40px, 7vh, 72px); }

.legal-group h2 {
  position: sticky;
  top: 84px;
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
  font-stretch: 90%;
  font-weight: 700;
  line-height: 1.05;
}

.legal-text { max-width: 44em; color: var(--lilac); font-size: 1rem; line-height: 1.6; }
.legal-text > * + * { margin-top: 1em; }
.legal-text ul { display: grid; gap: .75em; padding-left: 1.25em; list-style: disc; }
.legal-text li::marker { color: var(--snap); }
.legal-text strong { color: var(--white); font-weight: 600; }
.legal-text a { color: var(--snap); }

@media (max-width: 899px) {
  .legal-group { grid-template-columns: 1fr; }
  .legal-group h2 { position: static; }
}

.price-group strong { grid-area: 1 / 1; font-size: .9375rem; font-weight: 500; line-height: 1.5; }
.price-group strong::before { content: '<'; color: var(--snap); }
.price-group strong::after { content: ' />'; color: var(--snap); }

.price-group span { grid-area: 2 / 1; color: var(--lilac); font-size: .875rem; line-height: 1.45; }
.price-group span::before { content: '// '; }

.price-group b {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--snap);
  font-size: .9375rem;
  font-weight: 500;
  white-space: nowrap;
}

/* First hover: a ring opens out from the line number and the line of code snaps into a big, proper row, and stays built. */
.row-ui {
  z-index: 1;
  contain: inline-size; /* Its width must not stretch the columns. Its height can still grow the row, so hovering moves nothing. */
  display: grid;
  grid-area: 1 / 1 / -1 / -1;
  align-self: stretch;
  align-content: center;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr) auto;
  align-items: center;
  gap: 8px 24px;
  margin: -12px -20px -12px -56px;
  padding: 12px 20px;
  background: var(--lift);
  font-family: Geist, system-ui, sans-serif;
  clip-path: circle(0% at 28px 50%);
  transition: clip-path .4s cubic-bezier(.2, .9, .3, 1);
}

.price-group li.is-built .row-ui { clip-path: circle(150% at 28px 50%); }
.price-group li.is-built + li.is-built .row-ui { box-shadow: inset 0 1px rgb(198 200 236 / .22); }

.row-ui strong {
  grid-area: auto;
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.015em;
}

.row-ui strong::before,
.row-ui strong::after,
.row-ui span::before { content: none; }

.row-ui span { grid-area: auto; color: var(--white); line-height: 1.35; }

.row-ui b {
  grid-row: auto;
  grid-column: auto;
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-stretch: 90%;
  font-weight: 800;
}

.row-ui b small { font-size: .5em; font-weight: 600; }

/* Clicking a line: its outline draws, its code types, the hand snaps, and it turns yellow with live code behind it. page.js runs this. */
.row-outline {
  position: absolute;
  inset: 1px;
  z-index: 3;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 3px rgb(255 209 102 / .8));
}

.row-outline rect { fill: none; stroke: var(--snap); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }

.row-hand {
  position: absolute;
  top: 50%;
  left: 5px;
  z-index: 4;
  width: 24px;
  height: auto;
  margin-top: -14px;
  pointer-events: none;
  opacity: 0;
  transform-origin: 55% 62%;
}

.row-ask {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.row-ask:focus-visible { outline-offset: -3px; }

.price-group li .st-box { z-index: 2; background: var(--void); }
.price-group li .st-box .st-frame { display: none; } /* The outline takes its place. */
.price-group li .st-chip { display: none; }
.price-group li .st-code { inset: 7px 14px 7px 38px; }

/* The typed code sits inside the list, so it has to undo the list's own styling of spans. */
.price-group li .st-code span { color: inherit; font-size: inherit; line-height: inherit; }
.price-group li .st-code span::before { content: none; }
.price-group li .st-code .st-code-tag { color: var(--snap); }
.price-group li .st-code .st-code-text { color: var(--white); }
.price-group li .st-code .st-caret { background: var(--snap); }

.row-ui strong,
.row-ui span { transition: translate .22s cubic-bezier(.3, 1.4, .5, 1); }

/* While the hand is on a line, the text stays clear of it. */
.price-group li.is-outlining .row-ui strong,
.price-group li.is-outlining .row-ui span,
.price-group li.is-asked .row-ui strong,
.price-group li.is-asked .row-ui span { translate: 18px 0; }

/* Hovering or focusing a line: its outline draws around it, the text makes room, and a small hand keeps cocking to say it can snap.
   Not while scrolling: page.js adds .is-scrolling until the mouse moves. */
@media (hover: hover) and (pointer: fine) {
  :root:not(.is-scrolling) .price-group li:not(.is-asked):hover .row-outline { opacity: 1; }
  :root:not(.is-scrolling) .price-group li:not(.is-asked):hover .row-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset .4s linear; }
  :root:not(.is-scrolling) .price-group li:not(.is-asked):hover .row-ui strong,
  :root:not(.is-scrolling) .price-group li:not(.is-asked):hover .row-ui span { translate: 18px 0; }
  :root:not(.is-scrolling) .price-group li:not(.is-asked):hover .row-hand { opacity: 1; transition: opacity .15s; animation: row-hand-cock 1.5s .2s cubic-bezier(.2, .9, .3, 1) infinite; }
}

.price-group li:not(.is-asked):has(.row-ask:focus-visible) .row-outline { opacity: 1; }
.price-group li:not(.is-asked):has(.row-ask:focus-visible) .row-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset .4s linear; }

@keyframes row-hand-cock {
  0%, 62%, 100% { rotate: 0deg; scale: 1; }
  74% { rotate: 12deg; scale: .94; }
  84% { rotate: -10deg; scale: 1.12; }
}

.price-group li.is-outlining .row-outline { opacity: 1; }
.price-group li.is-outlining .row-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset .17s linear; }

.price-group li.is-hand .row-hand { opacity: 1; animation: none; }

/* The yellow copy of the line, opening out from the hand. Its canvas sits behind its text. */
.price-group li.is-built .row-flip {
  position: absolute;
  inset: 0;
  z-index: 2;
  grid-area: auto;
  margin: 0;
  background: var(--snap);
  color: var(--ink);
  clip-path: circle(0% at 17px 50%);
  transition: clip-path .42s cubic-bezier(.3, .8, .3, 1);
}

.row-flip strong,
.row-flip span,
.row-flip b { color: var(--ink); text-shadow: 0 0 5px var(--snap), 0 0 2px var(--snap); }

.price-group .row-flip span { font-weight: 700; }
.price-group .row-flip b small { font-weight: 800; }

.price-group li.is-asked .row-flip { clip-path: circle(150% at 17px 50%); }
.price-group li.is-asked .row-hand { animation: hand-snap .42s cubic-bezier(.2, .9, .3, 1); filter: brightness(0); opacity: 0; transition: opacity .2s .25s; }

/* Back again: the hand snaps and the yellow closes into it. */
.price-group li.is-asked.is-going-back .row-flip { clip-path: circle(0% at 17px 50%); transition-timing-function: cubic-bezier(.5, 0, .7, .4); }
.price-group li.is-asked.is-going-back .row-hand { opacity: 1; transition: none; animation: hand-snap .42s cubic-bezier(.2, .9, .3, 1); }

/* Too narrow for three columns: the description moves under the name and price. */
@media (max-width: 1199px) {
  .row-ui { grid-template-columns: minmax(0, 1fr) auto; }
  .row-ui span { grid-area: 2 / 1 / 3 / -1; }
}

/* ---------- Plans ---------- */

.plans { padding: clamp(48px, 10vh, 120px) var(--edge) clamp(80px, 16vh, 180px); }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(32px, 6vh, 64px);
}

.plan {
  --x: 50%;
  --y: 0%;
  position: relative;
  padding: clamp(22px, 3vw, 44px);
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .24);
  border-radius: var(--radius);
  background: rgb(26 28 68 / .78);
}

.plan::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(460px circle at var(--x) var(--y), rgb(255 209 102 / .2), transparent 65%);
  pointer-events: none;
}

.plan > * { position: relative; }

/* The monthly plans start as code too, like the code cards. The code only shows while page.js has the plan in code,
   and fades as the plan snaps in, since the plan's background lets it through. */
.plan > .plan-code,
.plan > .mock-ring { position: absolute; }
.plan-code { opacity: 0; transition: opacity .3s; }
.plan.is-code .plan-code { opacity: 1; transition: none; }
.plan-real { clip-path: circle(130% at 50% 50%); transition: clip-path .55s cubic-bezier(.3, .8, .3, 1); }
.plan.is-code .plan-real { clip-path: circle(0% at 50% 50%); transition: none; }
.plan.is-snapped .mock-ring { animation: code-card-ring .6s ease-out; }
.plan h3 { font-size: clamp(1.25rem, 1.8vw, 1.625rem); font-weight: 600; }

.plan-price {
  margin-top: clamp(14px, 3vh, 32px);
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 7rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.02em;
}

.plan-price small { font-size: .32em; font-weight: 700; letter-spacing: 0; }
.plan-setup { margin-top: 4px; color: var(--white); font-weight: 500; }
.plan-real > p:not(.plan-price, .plan-setup) { max-width: 34em; margin-top: 16px; color: var(--lilac); }

/* Pricing's three website plans: smaller cards, so all three fit on one line on desktop. Phones stack them (below). */
.plan-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-grid-three .plan { padding: clamp(20px, 2.2vw, 32px); }
.plan-grid-three .plan-price { font-size: clamp(2.6rem, 4.4vw, 4.75rem); }
.plan-grid-three .plan-real { display: flex; flex-direction: column; height: 100%; }
.plan-grid-three .plan-real > p:not(.plan-price, .plan-setup) { margin-bottom: 20px; }
.plan-grid-three .plan-real > .button { align-self: flex-start; margin-top: auto; } /* Lines the buttons up. */

/* ---------- Code cards ---------- */

/* Each starts as code and snaps to its result as it scrolls into view (page.js). Without that script, the result just shows. */
.code-card {
  --snap-at: 0s; /* The snap waits for the typing in page.js, so it needs no delay of its own. */
  position: relative;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
  background: var(--void);
  text-decoration: none;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}

.code-card:hover { transform: translateY(-4px); }

.code-card-real {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(18px, 2.4vw, 32px);
  background: var(--snap);
  color: var(--ink);
  clip-path: circle(130% at 50% 50%);
  transition: clip-path .55s var(--snap-at) cubic-bezier(.3, .8, .3, 1);
}

.code-card.is-code .code-card-real { clip-path: circle(0% at 50% 50%); transition: none; }

/* The code sits at the top, and page.js types it one line after another as the card comes into view. */
.code-card .mock-code,
.plan .mock-code { justify-content: flex-start; }
.code-card.is-code .code-line,
.plan.is-code .code-line { clip-path: inset(0 100% 0 0); }
.code-card.is-typing .code-line,
.plan.is-typing .code-line { clip-path: inset(0); transition: clip-path var(--type-ms) steps(var(--chars)) var(--type-delay); }
.code-card.is-snapped .mock-ring { animation: code-card-ring .6s var(--snap-at) ease-out; }

@keyframes code-card-ring {
  0% { opacity: 1; transform: scale(0); }
  100% { opacity: 0; transform: scale(2.6); }
}

.code-card-eyebrow { font: 500 .875rem/1.3 'Geist Mono', ui-monospace, Menlo, monospace; }

.code-card-num {
  font-family: var(--display);
  font-size: min(36cqw, 12rem);
  font-stretch: 88%;
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.03em;
}

.code-card h2,
.code-card h3 {
  margin-top: 8px;
  font-family: var(--display);
  font-size: clamp(1.2rem, 6cqw, 2.4rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.code-card-note { max-width: 34em; margin-top: 10px; }
.code-card-link { font-weight: 600; text-decoration: underline; text-underline-offset: .25em; }

/* The founders: code cards that snap to a portrait and huge name on yellow. The bio sets the card's height, so it's never cut off. */
.founder-grid { display: grid; gap: clamp(14px, 2vw, 24px); margin-top: clamp(32px, 6vh, 64px); }
.founder-card { min-height: 0; }
.founder-card:hover { transform: none; }

.founder-card .code-card-real {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  align-items: end;
  gap: 0 clamp(20px, 3vw, 48px);
  padding: 0 clamp(20px, 3.4vw, 48px) 0 0;
}

.founder-card:nth-child(even) .code-card-real {
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  padding: 0 0 0 clamp(20px, 3.4vw, 48px);
}

.founder-card:nth-child(even) .founder-photo { order: 2; }

/* The portraits are black and white on white, so multiply melts their background into the yellow. */
.founder-photo { width: 100%; height: auto; mix-blend-mode: multiply; }

.founder-copy { align-self: center; padding: clamp(20px, 3vw, 40px) 0; }

.code-card.founder-card h3 {
  margin: 10px 0 clamp(14px, 2vw, 24px);
  font-size: min(11cqw, 9rem);
  font-stretch: 90%;
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.025em;
}

.founder-card h3 span { display: block; }
.founder-copy > p:not(.code-card-eyebrow) { max-width: 40em; font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.45; }
.founder-copy > p + p:not(.code-card-eyebrow) { margin-top: .8em; }

@media (max-width: 720px) {
  .founder-card .code-card-real,
  .founder-card:nth-child(even) .code-card-real { grid-template-columns: minmax(0, 1fr); padding: 0 20px; }

  .founder-card:nth-child(even) .founder-photo { order: 0; }
  /* Runs edge to edge and fades out at the bottom, so the shoulders don't end in a hard line. */
  .founder-photo {
    width: calc(100% + 40px);
    max-width: none;
    margin: 0 -20px;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 50% 0;
    -webkit-mask-image: linear-gradient(#000 76%, transparent);
    mask-image: linear-gradient(#000 76%, transparent);
  }

  .code-card.founder-card h3 { font-size: 19cqw; }
  .founder-copy { padding-top: 0; }
}

/* ---------- Results and case studies ---------- */

.results { padding: clamp(64px, 12vh, 140px) var(--edge) 0; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.result-grid b {
  display: block;
  color: var(--snap);
  font-family: var(--display);
  font-size: clamp(3rem, 6.5vw, 7rem);
  font-stretch: 88%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.result-grid span { display: block; max-width: 22em; margin-top: 8px; color: var(--lilac); }
.results-link { margin-top: clamp(24px, 4vh, 40px); }

/* The disclaimer under figures marked with an asterisk. */
.fine-print { margin-top: clamp(16px, 3vh, 28px); color: var(--lilac); font-size: .8rem; }

.study-shot {
  width: 100%;
  height: auto;
  margin-top: clamp(32px, 6vh, 64px);
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
}

/* ---------- Closing panel ---------- */

.cta-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  padding: 72px var(--edge) clamp(24px, 5vh, 48px);
  overflow: hidden;
  background: var(--snap);
  color: var(--ink);
}

/* ocean.js draws the yellow and the code from here. */
.cta-panel.has-code { background: none; }

.cta-panel h2 {
  position: relative;
  z-index: 1;
  max-width: 6.5em;
  font-family: var(--display);
  font-size: min(17vw, 34svh);
  font-stretch: 100%;
  font-weight: 900;
  line-height: .84;
  letter-spacing: -.025em;
}

.cta-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: clamp(20px, 4vh, 40px);
  font-size: clamp(1.0625rem, 1.6vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
}

.cta-foot p { text-shadow: 0 0 10px var(--snap), 0 0 4px var(--snap); }
.cta-foot .button { padding: 1em 2em; }
.cta-foot { padding-right: max(0px, calc(var(--chat-button) + 28px - var(--edge))); } /* Clears the chat button. */

.cta-hand {
  position: absolute;
  top: 8%;
  right: var(--edge);
  width: min(44vw, 66svh);
  height: auto;
  opacity: .16;
  filter: brightness(0);
  transform-origin: 55% 62%;
}

/* ---------- Chatbot (chat.js) ---------- */

.chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  width: var(--chat-button);
  height: var(--chat-button);
  padding: calc(var(--chat-button) * .2);
  border: 0;
  border-radius: 50%;
  background: var(--snap);
  box-shadow: 0 0 0 2px var(--ink), 0 10px 30px rgb(0 0 0 / .45);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}

.chat-launcher:hover { transform: scale(1.08); }
.chat-launcher img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0); }

/* A snap for attention: the hand wiggles, the button lights up and a ring goes out. chat.js sets when. */
.chat-launcher.is-nudging { animation: chat-nudge-glow .7s ease-out; }
.chat-launcher.is-nudging img { animation: hand-snap .42s cubic-bezier(.2, .9, .3, 1); }

.chat-launcher.is-nudging::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--snap);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
  pointer-events: none;
  animation: chat-nudge-ring .7s ease-out;
}

@keyframes chat-nudge-glow {
  30% { box-shadow: 0 0 0 2px var(--ink), 0 0 34px 10px rgb(255 209 102 / .85); }
}

@keyframes chat-nudge-ring {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.9); }
}

/* The bubble above the button. Pops up once on a page, until the chat has been opened. */
.chat-hint {
  position: fixed;
  right: 16px;
  bottom: calc(var(--chat-button) + 30px);
  z-index: 45;
  padding: .6em 1em;
  border: 0;
  border-radius: var(--radius) var(--radius) 2px var(--radius);
  background: var(--white);
  box-shadow: 0 10px 30px rgb(0 0 0 / .45);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transform-origin: 100% 100%;
  animation: chat-hint-pop .45s cubic-bezier(.3, 1.6, .5, 1);
  transition: opacity .2s;
}

.chat-hint { max-width: min(300px, calc(100vw - 32px)); text-align: left; } /* Room for the greeting when it pops out on phones. */
.chat-hint[hidden] { display: none; }
.chat-hint.is-gone { opacity: 0; }

.chat-hint::after {
  content: '';
  position: absolute;
  right: 22px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: var(--white);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* The cookie banner (chat.js): lower left, clear of the chat button. */
.consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 45;
  display: grid;
  gap: 12px;
  width: min(440px, calc(100vw - var(--chat-button) - 48px));
  padding: 16px 18px;
  border: 1px solid rgb(198 200 236 / .25);
  border-radius: var(--radius);
  background: var(--night);
  box-shadow: 0 10px 30px rgb(0 0 0 / .45);
  font-size: .9375rem;
  line-height: 1.45;
}

.consent div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.consent .button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.consent-decline { padding: 0; border: 0; background: none; color: var(--lilac); font: inherit; text-decoration: underline; cursor: pointer; }
.consent-decline:hover { color: var(--white); }
.consent p a { color: var(--snap); }

@keyframes chat-hint-pop {
  from { opacity: 0; transform: scale(.4) translateY(12px); }
}

.chat-panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--chat-button) + 28px);
  z-index: 55; /* Above the header, whose buttons would otherwise cover the chat's on phones. */
  width: min(400px, calc(100vw - 32px));
  height: min(600px, calc(100svh - var(--chat-button) - 48px));
  overflow: hidden;
  border: 1px solid rgb(198 200 236 / .28);
  border-radius: var(--radius);
  background: var(--void);
  box-shadow: 0 30px 80px -10px rgb(106 108 255 / .5), 0 12px 40px rgb(0 0 0 / .5);
}

.chat-panel[hidden] { display: none; }

.chat-ui {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--night);
}

/* Opening: only an outline at first, then the box fills with code. The window waits behind that, until the snap's ring opens it out from the middle. */
.chat-panel.is-building { border-color: transparent; background: transparent; box-shadow: none; }
.chat-panel.is-filling { background: var(--void); transition: opacity .12s, background-color .1s; }
.chat-panel.is-snapped {
  border-color: rgb(198 200 236 / .28);
  box-shadow: 0 30px 80px -10px rgb(106 108 255 / .5), 0 12px 40px rgb(0 0 0 / .5);
  transition: opacity .12s, border-color .3s, box-shadow .3s;
}
.chat-panel.is-building .st-frame { display: none; } /* The outline takes its place. */
.is-building .chat-ui { clip-path: circle(0% at 50% 50%); }
.is-snapped .chat-ui { clip-path: circle(130% at 50% 50%); transition: clip-path .4s cubic-bezier(.3, .8, .3, 1); }

.chat-outline { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; opacity: 0; filter: drop-shadow(0 0 4px rgb(255 209 102 / .8)); }
.chat-outline rect { fill: none; stroke: var(--snap); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-outlining .chat-outline { opacity: 1; }
.is-outlining .chat-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset var(--chat-outline-ms) linear; }
.is-snapped .chat-outline { opacity: 0; transition: opacity .2s; }

/* Closing: the hand snaps, the window closes into its code, then the code erases from the top down. */
.chat-panel { transition: opacity .12s; }
.chat-ui { clip-path: circle(130% at 50% 50%); }
.is-closing .chat-ui { clip-path: circle(0% at 50% 50%); transition: clip-path .32s cubic-bezier(.5, 0, .7, .4); }
.is-closing .chat-hand { opacity: 1; animation: hand-snap .32s cubic-bezier(.2, .9, .3, 1); }
.is-closing .chat-ring { animation: code-card-ring .34s ease-in reverse; }
.is-erasing .chat-hand { opacity: 0; transition: opacity .12s; }
.is-erasing .st-code > :has(~ .st-caret) { visibility: hidden; } /* Hides what the caret has passed, leaving the rest where it is. */
.chat-panel.is-gone { opacity: 0; }

.chat-hand,
.chat-ring { position: absolute; top: 50%; left: 50%; z-index: 2; pointer-events: none; opacity: 0; }

.chat-hand { width: 84px; height: auto; margin: -47px 0 0 -42px; filter: drop-shadow(0 0 18px var(--void)); }
.is-hand .chat-hand { opacity: 1; transition: opacity .12s; }
.is-snapped .chat-hand { opacity: 0; animation: hand-snap .32s cubic-bezier(.2, .9, .3, 1); transition: opacity .2s .2s; }

.chat-ring { width: 40%; aspect-ratio: 1; margin: -20% 0 0 -20%; border: 2px solid var(--snap); border-radius: 50%; }
.is-snapped .chat-ring { animation: code-card-ring .4s ease-out; }

.chat-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgb(198 200 236 / .16);
  background: var(--void);
}

.chat-mark { width: 30px; height: auto; }
.chat-head p { flex: 1; line-height: 1.15; }
.chat-head strong { display: block; font-weight: 600; }
.chat-head span { color: var(--lilac); font-size: .8125rem; }

.chat-close {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.chat-close:hover { background: rgb(255 255 255 / .1); }

.chat-close::before,
.chat-close::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 10px;
  left: 10px;
  height: 2px;
  margin-top: -1px;
  background: var(--white);
  transform: rotate(45deg);
}

.chat-close::after { transform: rotate(-45deg); }

.chat-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-bubble {
  flex: none;
  max-width: 86%;
  padding: .55em .9em;
  border-radius: var(--radius) var(--radius) var(--radius) 2px;
  background: var(--lift);
  font-size: .9375rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-bubble a { color: var(--snap); }
.chat-bubble.is-user { align-self: flex-end; border-radius: var(--radius) var(--radius) 2px var(--radius); background: var(--chat-accent, var(--snap)); color: var(--chat-on-accent, var(--ink)); } /* Colour from Studio. */
.chat-bubble.is-thinking { min-width: 3em; min-height: 2.2em; }

.chat-bubble.is-thinking::after {
  content: '...';
  letter-spacing: .15em;
  animation: chat-thinking 1s ease-in-out infinite alternate;
}

@keyframes chat-thinking {
  from { opacity: .3; }
  to { opacity: 1; }
}

.chat-questions { display: flex; flex: none; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.chat-questions:not(:empty) { padding-bottom: 10px; }

.chat-questions button {
  padding: .4em .85em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: none;
  color: var(--white);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

.chat-questions button:hover { border-color: var(--snap); color: var(--snap); }

.chat-form { display: flex; flex: none; gap: 8px; padding: 10px 14px; border-top: 1px solid rgb(198 200 236 / .16); }

.chat-input {
  flex: 1;
  min-width: 0;
  padding: .55em .9em;
  border: 1px solid rgb(198 200 236 / .4);
  border-radius: var(--radius);
  background: rgb(14 15 43 / .7);
  color: var(--white);
  font: inherit;
  font-size: 1rem; /* Under this, iPhones zoom the page when the field is focused. */
}

.chat-input:focus-visible { outline: 3px solid var(--snap); outline-offset: 1px; }

.chat-send {
  flex: none;
  padding: 0 1em;
  border: 0;
  border-radius: var(--radius);
  background: var(--snap);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chat-send:disabled { opacity: .5; cursor: default; }

.chat-foot { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 12px; }
.chat-foot small { color: var(--lilac); font-size: .8125rem; }

/* ---------- Studio, the customer portal (portal.html) ---------- */

/* An app page: a menu down the left and one section showing at a time. Nothing sits in a box;
   thin rules and space do the grouping. Only portal.html uses these. */
.portal {
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --up: #3ddc97;
  --down: #ff6b6b;
  --line: rgb(198 200 236 / .16);
  min-height: 100vh;
  min-height: 100dvh;
}

.portal [hidden] { display: none !important; }
.portal ol { margin: 0; padding: 0; list-style: none; }

.portal-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.portal h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-stretch: 90%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.portal h2 { font: 600 1rem/1.2 Geist, system-ui, sans-serif; }

.portal-note { color: var(--lilac); font-size: .9375rem; }
.portal-status { font: 500 .875rem/1.4 var(--mono); color: var(--snap); }
.portal-status:empty { display: none; }

.portal .button { justify-self: start; padding: .7em 1.3em; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.portal button:disabled { opacity: .6; cursor: progress; }

.portal-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.portal-link:hover { color: var(--snap); }

/* Loading line, with a blinking cursor. */
.portal-boot { padding: 40vh var(--edge) 0; color: var(--lilac); font: 500 1rem var(--mono); text-align: center; }
.portal-caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 4px; vertical-align: -.2em; background: var(--snap); animation: portal-blink 1s steps(1) infinite; }
@keyframes portal-blink { 50% { opacity: 0; } }

/* The logo with the product's name beside it. */
.portal-brand { display: inline-flex; align-items: flex-end; gap: 8px; justify-self: start; text-decoration: none; }
.portal-brand .logo { width: 116px; }
.portal-brand span { color: var(--snap); font: 500 .8125rem/1.5 var(--mono); }

/* Text boxes */
.portal-field {
  display: block;
  width: 100%;
  padding: .8em 1em;
  border: 1px solid rgb(198 200 236 / .3);
  border-radius: var(--radius);
  background: rgb(8 9 30 / .5);
  color: var(--white);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.portal-field:hover { border-color: var(--lilac); }
.portal-field:focus { border-color: var(--snap); outline: 0; box-shadow: 0 0 0 3px rgb(255 209 102 / .18); }
.portal-field::placeholder { color: rgb(198 200 236 / .5); }
textarea.portal-field { min-height: 8.5em; resize: vertical; }

/* Sign in */
.portal-login {
  display: grid;
  gap: 18px;
  width: min(100% - 2 * var(--edge), 440px);
  margin: 0 auto;
  padding: clamp(72px, 20vh, 200px) 0 64px;
}

.portal-login h1 { margin-top: 20px; font-size: clamp(2.6rem, 6vw, 4rem); }

/* Signed in: the menu, then the section. */
.portal-home { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.portal-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  height: 100dvh;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  background: rgb(8 9 30 / .5);
}

.portal-side > :not(nav) { padding-inline: 12px; }
.portal-site { display: grid; gap: 2px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.portal-url { color: var(--lilac); font: 400 .8125rem/1.5 var(--mono); text-decoration: none; }
.portal-url:hover { color: var(--snap); }

.portal-nav { display: grid; gap: 2px; }

.portal-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: .5em 12px;
  border-radius: var(--radius);
  color: var(--lilac);
  font-size: .9375rem;
  text-decoration: none;
}

.portal-nav a:hover { color: var(--white); }
.portal-nav a[aria-current] { background: rgb(255 255 255 / .09); color: var(--white); font-weight: 600; }
.portal-nav b { color: var(--snap); font: 500 .8125rem/1 var(--mono); }
.portal-nav b:empty { display: none; }

.portal-who { display: grid; justify-items: start; gap: 4px; margin-top: auto; color: var(--lilac); font-size: .8125rem; }
.portal-who span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.portal-main { container-type: inline-size; min-width: 0; max-width: 1180px; padding: 30px clamp(20px, 4vw, 48px) 80px; }

/* The section's name, with the site's status beside it. */
.portal-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 28px; }
.portal-top p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--lilac); font-size: .8125rem; }

.portal-online { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.portal-online[data-state="up"] { color: var(--up); }
.portal-online[data-state="down"] { color: var(--down); }
.portal-updating { color: var(--snap); }

.portal-online::before,
.portal-badge::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.portal-online[data-state="up"]::before,
.portal-badge[data-status="In progress"]::before { animation: portal-pulse 2s ease-out infinite; }

@keyframes portal-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

.portal-view { display: grid; gap: 40px; }
.portal-view > * { min-width: 0; }
.portal-view h2 { margin-bottom: 12px; }
.portal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.portal-head h2 { margin: 0; }
.portal-head span { color: var(--lilac); font: 400 .75rem/1.2 var(--mono); text-align: right; }

/* Numbers: a rule above each one. Two across on a narrow screen, then one row (--n is set by portal.js). */
.portal-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; }
.portal-stats:empty { display: none; }
.portal-tile { display: grid; align-content: start; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.portal-tile span,
.portal-tile small { color: var(--lilac); font-size: .8125rem; }
.portal-tile strong { font-family: var(--display); font-size: clamp(1.7rem, 4.6cqw, 2.6rem); font-stretch: 90%; font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.portal-tile[data-state="bad"] strong { color: var(--down); }

.portal-cols { display: grid; gap: 40px 48px; }

@container (min-width: 560px) {
  .portal-stats { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
}

@container (min-width: 760px) {
  .portal-cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .portal-cols:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
}

/* Daily chart: a bar per day, with the day's count on hover or focus. */
.portal-chart { display: flex; align-items: stretch; gap: 3px; height: 150px; border-bottom: 1px solid var(--line); }
.portal-chart > span { position: relative; display: flex; flex: 1; align-items: flex-end; }
.portal-chart > span:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-chart > span > span { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--snap); }
.portal-chart > span > span.is-empty { background: rgb(198 200 236 / .2); }
.portal-chart > span:hover > span,
.portal-chart > span:focus-visible > span { background: var(--white); }

.portal-chart > span:hover::after,
.portal-chart > span:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 1;
  padding: .4em .75em;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: 600 .8125rem var(--mono);
  white-space: nowrap;
  translate: -50% 0;
  pointer-events: none;
}

.portal-chart > span:first-child::after { left: 0; translate: none; }
.portal-chart > span:last-child::after { right: 0; left: auto; translate: none; }
.portal-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--lilac); font: 400 .75rem var(--mono); }

/* Uptime: the daily chart's columns as full-height blocks, coloured by how the day went. */
.portal-uptime { height: 32px; border-bottom: 0; }
.portal-uptime > span > span { height: 100%; border-radius: 3px; }
.portal-uptime > span > span[data-state="up"] { background: var(--up); }
.portal-uptime > span > span[data-state="partial"] { background: var(--snap); }
.portal-uptime > span > span[data-state="down"] { background: var(--down); }

/* Change requests: the form and the list. */
.portal-ask { display: grid; align-content: start; gap: 12px; }
.portal-ask h2 { margin: 0; }
.portal-request-page { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-request-page .portal-field { font-weight: 400; }
#portal-request-pages-note:empty { display: none; }
.portal-send { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.portal-more { margin-top: 12px; font-size: .875rem; }

.portal-log li { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.portal-log li:last-child { border-bottom: 1px solid var(--line); }
.portal-number,
.portal-log small { color: var(--lilac); font: 400 .8125rem/1.4 var(--mono); white-space: nowrap; }
.portal-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.portal-badge { display: inline-flex; align-items: center; gap: 7px; min-width: 7.6em; font: 500 .75rem/1.4 var(--mono); white-space: nowrap; }
.portal-badge::before { width: 7px; height: 7px; }
.portal-badge[data-status="Live"] { color: var(--up); }
.portal-badge[data-status="In progress"] { color: var(--snap); }
.portal-badge[data-status="Closed"] { color: rgb(198 200 236 / .7); }
.portal-badge[data-status="To fix"] { color: var(--down); }
.portal-badge[data-status="Waiting on us"] { color: var(--snap); }
.portal-badge[data-status="Replied"] { color: var(--up); }
.portal-badge[data-status="Your turn"] { color: var(--snap); }
.portal-help .portal-badge[data-status="Waiting on us"] { color: var(--lilac); } /* Customers have nothing to do yet. */

@container (max-width: 480px) { .portal-log small { display: none; } }

/* Requests left this billing period: the bar fills with what's left, and turns empty with a red count at zero. */
.portal-stack { display: grid; align-content: start; gap: 36px; }
.portal-allowance { display: grid; gap: 10px; }
.portal-allowance .portal-head { margin-bottom: 0; }
.portal-ask .portal-allowance { margin-bottom: 20px; }
.portal-meter { height: 8px; overflow: hidden; border-radius: var(--radius); background: rgb(198 200 236 / .18); }
.portal-meter span { display: block; height: 100%; background: var(--snap); transition: width .4s ease-out; }
.portal-allowance .portal-note[data-state="bad"] { color: var(--down); }
.portal-field:disabled { opacity: .6; cursor: not-allowed; }

/* Starter's Traffic and SEO, and Professional's top lists in Traffic: made-up numbers, greyed and blurred so they
   can't be mistaken for real ones, under an upgrade message. */
.portal-view.is-locked,
.portal-advanced.is-locked { position: relative; }
.portal-view.is-locked > :not(.portal-lock),
.portal-advanced.is-locked > :not(.portal-lock) { opacity: .35; filter: grayscale(1) blur(3px); user-select: none; }
.portal-advanced.is-locked { min-height: 260px; }
/* SEO's Search details (portal.js): one row per page that opens into its fields. */
.portal-seo-form { max-width: 860px; }
.portal-seo-pages { display: grid; }
.portal-seo-page { border-top: 1px solid var(--line); }
.portal-seo-page:last-child { border-bottom: 1px solid var(--line); }
.portal-seo-page summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 0; font-size: .9375rem; cursor: pointer; }
.portal-seo-page summary small { flex: 2; min-width: 0; color: var(--lilac); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-seo-page summary:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-seo-body { display: grid; gap: 14px; padding: 4px 0 20px 14px; border-left: 2px solid var(--line); }
.portal-seo-body h3 { margin: 8px 0 0; font-size: .9375rem; }
.portal-seo-field { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-seo-field .portal-field { font-weight: 400; }
.portal-seo-field small { color: var(--lilac); font-weight: 400; }
.portal-seo-body textarea.portal-field { min-height: 4.5em; }
.portal-seo-social { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: .875rem; }
.portal-seo-social dt { color: var(--lilac); }
.portal-seo-social dd { margin: 0; overflow-wrap: anywhere; }
.portal-seo-image { display: grid; grid-template-columns: 64px 1fr; align-items: start; gap: 14px; }
.portal-seo-image img { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: var(--radius); object-fit: cover; background: rgb(255 255 255 / .05); }
.portal-seo-image img[hidden] { display: block; visibility: hidden; }
.portal-seo-warning { margin: 0; padding: 10px 14px; border: 1px solid var(--down); border-radius: var(--radius); color: var(--white); font-size: .9375rem; }
#portal-opportunity-list strong { font-weight: 600; }

/* Analytics' date ranges. Greyed-out ones are Platinum's. */
.portal-range-bar { display: grid; gap: 12px; }
.portal-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.portal-ranges button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: none;
  color: var(--lilac);
  font: 500 .8125rem/1 var(--mono);
  cursor: pointer;
}
.portal-ranges button:hover { color: var(--white); }
.portal-ranges button:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-ranges button[aria-pressed="true"] { border-color: var(--snap); background: rgb(255 255 255 / .09); color: var(--white); }
.portal-ranges button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.portal-view[aria-busy="true"] :is(.portal-stats, .portal-chart, .portal-grid) { opacity: .5; transition: opacity .2s; }
.portal-lock {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(13 14 40 / .9);
  text-align: center;
  translate: -50% 0;
}
.portal-lock h2 { margin: 0; font-size: 1.25rem; }
.portal-lock .button { justify-self: center; }
.portal-nav a.is-locked { color: rgb(198 200 236 / .55); }
.portal-nav a.is-locked::after { content: 'Pro'; color: var(--snap); font: 500 .75rem/1 var(--mono); }
.portal-nav a:is([data-tab="chatbot"], [data-tab="editor"], [data-tab="blog"], [data-tab="booking"]).is-locked::after { content: 'Platinum'; }

/* Top pages, sources, countries, devices */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 32px 40px; }
.portal-bars li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 7px 0; font-size: .9375rem; }
.portal-bars li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.portal-bars small { color: var(--lilac); font: 400 .8125rem/1.6 var(--mono); }
.portal-bar { grid-column: 1 / -1; height: 2px; min-width: 2px; background: var(--snap); }

/* Under the request form: what a request covers, and where to go for more. */
.portal-fine { padding-top: 12px; border-top: 1px solid var(--line); font-size: .8125rem; }
.portal-upsell { font-size: .9375rem; }

/* Plan and Add-ons: one column per thing to buy, a rule above each, like the stats. */
.portal-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 36px 32px; }
.portal-offer { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.portal-offer h2 { margin: 0; }
.portal-offer ul { display: grid; align-content: start; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--lilac); font-size: .9375rem; }
.portal-offer li::before { content: '+ '; color: var(--snap); font-family: var(--mono); }
.portal-offer-tag { align-self: end; margin: 0; color: var(--snap); font-family: var(--mono); font-size: .875rem; } /* Your plan, or Included. */
.portal-price { font-family: var(--display); font-size: clamp(1.7rem, 4.6cqw, 2.4rem); font-stretch: 90%; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.portal-price small { margin-left: 4px; color: var(--lilac); font: 400 .8125rem Geist, system-ui, sans-serif; letter-spacing: 0; }
.portal-reset-buy { position: relative; }
.portal-reset-more { position: absolute; top: 100%; left: 0; right: 0; margin: 10px 0 0; font-size: .8125rem; } /* Hangs under Reset, so it lines up with Buy a page credit. */
.portal-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-self: end; }

/* Chatbot (Platinum): a row of stats, then two tabs: Conversations (a list beside the chat) and Settings. */
#portal-bot-stats strong { overflow: hidden; text-overflow: ellipsis; }
.portal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.portal-tabs button { margin-bottom: -1px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--lilac); font: inherit; font-weight: 600; cursor: pointer; }
.portal-tabs button:hover { color: var(--white); }
.portal-tabs button[aria-selected="true"] { border-color: var(--snap); color: var(--white); }
.portal-tabs button:focus-visible { outline: 2px solid var(--snap); outline-offset: -2px; }
.portal-bot { gap: 24px; }
.portal-chats li { padding: 0; }
.portal-chat-pick { display: flex; flex: 1; align-items: baseline; gap: 14px; padding: 12px 8px; border: 0; border-radius: var(--radius); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.portal-chat-pick:hover { background: rgb(255 255 255 / .05); }
.portal-chat-pick[aria-current] { background: rgb(255 255 255 / .09); box-shadow: inset 3px 0 var(--snap); }
.portal-chat-pick:focus-visible { outline: 2px solid var(--snap); outline-offset: -2px; }
.portal-transcript { display: grid; gap: 12px; max-height: 520px; overflow-y: auto; }
.portal-line { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.portal-line[data-role="visitor"] { border-color: var(--snap); }
.portal-line b { color: var(--lilac); font: 500 .75rem/1.4 var(--mono); }
/* The chatbot's transcript as chat bubbles: the visitor on the left, the chatbot on the right in its colour.
   Help's tickets use .portal-line too, without bubbles. */
.portal-bubbles { gap: 10px; align-content: start; }
.portal-bubbles .portal-line { justify-self: start; justify-items: start; max-width: 85%; padding: 0; border: 0; white-space: normal; }
.portal-bubbles .portal-line > b { padding: 0 2px; }
.portal-bubbles .portal-line span { padding: .6em .85em; border-radius: 12px 12px 12px 3px; background: var(--night); white-space: pre-wrap; }
.portal-bubbles .portal-line[data-role="bot"] { justify-self: end; justify-items: end; }
.portal-bubbles .portal-line[data-role="bot"] span { border-radius: 12px 12px 3px 12px; background: var(--bot, var(--iris)); color: var(--bot-text, var(--white)); }

.portal-bot-form { max-width: 760px; gap: 28px; }
.portal-group { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.portal-group > .portal-head { margin-bottom: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.portal-bot-form label { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-bot-form label small,
.portal-bot-form .portal-field { font-weight: 400; }
.portal-bot-form label small { color: var(--lilac); }
.portal-bot-form .portal-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.portal-bot-form .portal-head label { display: inline; }
/* A checkbox drawn as an on/off switch. */
.portal-check.portal-switch input { appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 99px; background: rgb(198 200 236 / .3); cursor: pointer; transition: background .15s; }
.portal-check.portal-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: transform .15s; }
.portal-check.portal-switch input:checked { background: var(--up); }
.portal-check.portal-switch input:checked::after { transform: translateX(16px); }
.portal-switch input:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-bot-form .portal-delay { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 400; color: var(--lilac); }
.portal-delay .portal-field { width: auto; }
.portal-delay .portal-field:disabled { opacity: .45; }
/* Colour: a row of swatches, then Custom (the color box, drawn as a rainbow circle). */
.portal-swatches { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.portal-swatches legend { margin-bottom: 6px; padding: 0; font-size: .9375rem; font-weight: 600; }
.portal-swatches div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.portal-swatches button,
.portal-bot-form .portal-custom-colour { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.portal-swatches button { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); }
.portal-swatches [data-color="#15163a"] { background: #15163a; }
.portal-swatches [data-color="#4b4de8"] { background: #4b4de8; }
.portal-swatches [data-color="#2a9d8f"] { background: #2a9d8f; }
.portal-swatches [data-color="#e4572e"] { background: #e4572e; }
.portal-swatches [data-color="#d6336c"] { background: #d6336c; }
.portal-swatches [data-color="#8a5a2b"] { background: #8a5a2b; }
.portal-swatches button[aria-pressed="true"],
.portal-bot-form .portal-custom-colour.is-on { box-shadow: 0 0 0 2px var(--void), 0 0 0 4px var(--snap); }
.portal-swatches button:focus-visible,
.portal-custom-colour:focus-within { outline: 2px solid var(--snap); outline-offset: 4px; }
.portal-bot-form .portal-custom-colour { display: block; overflow: hidden; background: conic-gradient(#ff6b6b, #ffd166, #3ddc97, #6a6cff, #d6336c, #ff6b6b); }
.portal-custom-colour input { width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#portal-colour-value { margin-left: 4px; color: var(--lilac); font: 500 .75rem var(--mono); }
/* What it knows: each section is a line that opens to its box. */
.portal-fact { border-bottom: 1px solid var(--line); }
.portal-fact summary { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 11px 4px; font-size: .9375rem; cursor: pointer; list-style: none; }
.portal-fact summary::-webkit-details-marker { display: none; }
.portal-fact summary b { font-weight: 600; }
.portal-fact summary span { overflow: hidden; color: var(--lilac); text-overflow: ellipsis; white-space: nowrap; }
.portal-fact summary span.is-empty { font-style: italic; opacity: .6; }
.portal-fact summary::after { content: 'Edit'; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
.portal-fact[open] summary::after { content: 'Done'; }
.portal-fact summary:hover::after { color: var(--snap); }
.portal-fact summary:focus-visible { outline: 2px solid var(--snap); outline-offset: -2px; }
.portal-fact > :not(summary) { margin: 0 4px 12px; }
.portal-fact textarea.portal-field { width: calc(100% - 8px); min-height: 4.5em; }
.portal-fact p { margin: 0 4px 12px; }
.portal-fact-rows { display: grid; gap: 12px; }
.portal-fact-rows:empty { display: none; }
.portal-fact-row { display: grid; gap: 6px; justify-items: start; padding-left: 12px; border-left: 2px solid var(--line); }
.portal-fact-row .portal-field { width: 100%; }
@container (max-width: 560px) {
  .portal-fact summary { grid-template-columns: minmax(0, 1fr) auto; }
  .portal-fact summary span { display: none; }
}
.portal-check input { width: 18px; height: 18px; accent-color: var(--snap); }
.portal-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px 20px; }
.portal-colour { height: 3em; padding: 4px; cursor: pointer; }
.portal-field option { background: var(--night); color: var(--white); }

/* A notice at the top of a section, e.g. Search Console or the chatbot isn't set up yet, with a Contact support button. */
.portal-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 28px; padding: 12px 16px; border: 1px solid var(--snap); border-radius: var(--radius); font-size: .9375rem; }
.portal-notice p { margin: 0; }

/* Help: the ticket form, and tickets that open to their messages and a reply box (also in Admin). */
.portal-help label { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-help .portal-field { font-weight: 400; }
.portal-ticket { border-top: 1px solid var(--line); }
.portal-ticket:last-child { border-bottom: 1px solid var(--line); }
/* Needs the reader: a yellow outline and a pulsing badge, like a request in progress. */
.portal-ticket.needs-you { border-radius: var(--radius); outline: 1px solid var(--snap); outline-offset: -1px; background: rgb(255 209 102 / .06); }
.portal-ticket.needs-you .portal-badge::before { animation: portal-pulse 2s ease-out infinite; }
.portal-ticket summary { display: flex; align-items: baseline; gap: 14px; padding: 12px 8px; border-radius: var(--radius); font-size: .9375rem; cursor: pointer; list-style: none; }
.portal-ticket summary::-webkit-details-marker { display: none; }
.portal-ticket summary:hover { background: rgb(255 255 255 / .05); }
.portal-ticket summary:focus-visible { outline: 2px solid var(--snap); outline-offset: -2px; }
.portal-ticket summary > small { color: var(--lilac); font: 400 .8125rem/1.4 var(--mono); white-space: nowrap; }
.portal-ticket .portal-title { display: grid; gap: 2px; }
.portal-ticket .portal-title small { color: var(--lilac); font-size: .8125rem; overflow-wrap: anywhere; }
.portal-ticket .portal-transcript { margin: 4px 8px 14px; }
.portal-ticket-reply { display: grid; gap: 10px; margin: 0 8px 16px; }
.portal-ticket-reply .portal-status { margin: 0; }

/* Admin's closed tickets: a line that opens to the list. */
.portal-archive { margin-top: 20px; }
.portal-archive > summary { display: flex; align-items: baseline; gap: 10px; width: fit-content; padding: 6px 0; color: var(--lilac); font-weight: 600; cursor: pointer; list-style: none; }
.portal-archive > summary::-webkit-details-marker { display: none; }
.portal-archive > summary::before { content: '+'; color: var(--snap); font-family: var(--mono); }
.portal-archive[open] > summary::before { content: '−'; }
.portal-archive > summary:hover { color: var(--white); }
.portal-archive > summary:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-archive > summary span { font: 400 .75rem/1 var(--mono); }
.portal-archive[open] > summary { margin-bottom: 10px; }

/* Studio's Admin section and the banner while an admin views as a customer. */
.portal-viewing { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 24px; padding: 10px 14px; border: 1px solid var(--snap); border-radius: var(--radius); color: var(--snap); font-size: .875rem; }
.portal-admin-row { flex-wrap: wrap; }
.portal-admin-row .portal-title { display: grid; gap: 2px; min-width: 200px; }
.portal-admin-row .portal-title small { white-space: normal; overflow-wrap: anywhere; }
.portal-admin-error { color: var(--down) !important; }
.portal-admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .875rem; }
.portal-admin-actions .portal-field { width: auto; padding: .45em .7em; }
.portal-admin-actions input.portal-field { width: 4.5em; }
.portal-admin-actions .button { padding: .5em 1em; }

/* Checkout (checkout.html): the sign-in page's column, with an order summary. */
.portal-order { display: grid; gap: 8px; padding: 14px 0; border-block: 1px solid var(--line); }
.portal-order div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.portal-order dt { color: var(--lilac); font-size: .9375rem; }
.portal-order dd { margin: 0; font-weight: 600; text-align: right; }
.portal-order .portal-total dd { color: var(--snap); font-family: var(--display); font-size: 1.6rem; font-stretch: 90%; font-weight: 800; }
#checkout-pay:not([hidden]) { display: grid; gap: 14px; justify-items: start; }
.checkout-term:not([hidden]) { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.checkout-fine { font-size: .8125rem; }
.checkout-term legend { margin-bottom: 10px; padding: 0; font-weight: 600; }
#checkout-next[hidden] { display: none; }

/* Picked images, shown small (the intake form and Studio's change requests). */
.portal-thumbs:not([hidden]) { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 7px 7px 0 0; list-style: none; }
.portal-thumbs img { display: block; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 255 255 / .06); }
[data-thumbs="logo"] img { object-fit: contain; }
.portal-thumbs li { position: relative; }
/* The X on each picture: removes that image (upload.js). */
.portal-thumb-remove { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--night); color: var(--white); font: 600 .9375rem/1 system-ui, sans-serif; cursor: pointer; }
.portal-thumb-remove:hover { border-color: var(--snap); color: var(--snap); }
.portal-thumb-remove:focus-visible { outline: 2px solid var(--snap); outline-offset: 2px; }
.portal-file { padding: .6em; cursor: pointer; }
.portal-images { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-images small { color: var(--lilac); font-weight: 400; }
.portal-images .portal-field { font-weight: 400; }

/* The intake form (intake.html): the sign-in page's column, wider, in groups. */
.portal-login.intake { width: min(100% - 2 * var(--edge), 720px); padding-top: clamp(48px, 10vh, 120px); }
.intake-form:not([hidden]) { display: grid; gap: 36px; justify-items: start; }
.intake-form fieldset { display: grid; gap: 16px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.intake-form > fieldset > legend { margin-bottom: 16px; padding: 0; color: var(--snap); font: 500 .8125rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.intake-form label:not(.pill),
.intake-label { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.intake-form small { color: var(--lilac); font-weight: 400; }
.intake-form .portal-field { font-weight: 400; }
.intake-form label.portal-check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 500; }
.intake-form .portal-check input { align-self: center; }
.intake-colours { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.intake-colours .intake-label { flex-basis: 100%; }
.intake-form label.intake-colour { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.intake-colour .portal-colour { width: 3.2em; }
.intake-choice legend { margin-bottom: 10px; padding: 0; }
.intake-form .intake-choice { gap: 10px; }
/* Opening hours: day, opens, closes. */
.intake-hours { display: grid; grid-template-columns: 3em repeat(2, minmax(0, 1fr)); align-items: center; gap: 8px 10px; max-width: 480px; font-size: .9375rem; }
.intake-hours span { color: var(--lilac); font: 500 .875rem/1 var(--mono); }
.intake-hours .portal-field { padding: .55em .7em; }
.intake-hours .portal-field:disabled { opacity: .35; }
.intake-copy { justify-self: start; color: var(--lilac); font-size: .875rem; }
/* Pages and features show once a plan is picked. The note pops up when a plan's page limit is reached. */
.intake-after-plan:not([hidden]) { display: grid; gap: 16px; }
.intake-hint { color: var(--lilac); font-size: .8125rem; }
/* Choices the picked plan doesn't include: greyed out, with the plans that do in a note on hover or tap (intake.js). */
.intake-form .pill[data-locked] { cursor: not-allowed; }
.intake-form .pill[data-locked] input { pointer-events: none; }
.intake-form .pill[data-locked] span { opacity: .35; }
.intake-form .pill[data-locked]::after { content: attr(data-tip); display: none; position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 2; padding: 6px 10px; border: 1px solid var(--snap); border-radius: var(--radius); background: var(--night); color: var(--snap); font-size: .8125rem; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.intake-form .pill[data-locked].tip-end::after { right: 0; left: auto; }
.intake-form .pill[data-locked]:hover::after,
.intake-form .pill[data-locked].show-tip::after { display: block; }
.intake-limit:not([hidden]) { justify-self: start; margin: 0; padding: 8px 12px; border: 1px solid var(--snap); border-radius: var(--radius); background: rgb(255 209 102 / .08); color: var(--snap); font-size: .875rem; animation: intake-pop .2s ease-out; }
@keyframes intake-pop { from { opacity: 0; transform: translateY(-4px); } }

/* Narrow screens: the menu becomes a row of tabs across the top. */
@media (max-width: 760px) {
  .portal-home { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .portal-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; height: auto; padding: 16px var(--edge) 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .portal-side > :not(nav) { padding-inline: 0; }
  .portal-site,
  .portal-who span { display: none; }
  .portal-who { margin: 0 0 0 auto; }
  .portal-nav { display: flex; flex-basis: 100%; order: 1; gap: 4px; margin: 0 calc(-1 * var(--edge)); padding: 0 var(--edge) 12px; overflow-x: auto; }
  .portal-nav a { white-space: nowrap; }
  .portal-main { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-caret,
  .portal-online::before,
  .portal-badge::before { animation: none !important; }
}

/* ---------- Studio's console look (portal.html and demo.html only) ----------
   Only pages with data-studio-theme on <html> get it, so checkout.html and intake.html keep the plain look above.
   Light or dark and the collapsed menu are set on <html> by portal.html's <head> and portal.js, which remember them.
   The site's colour names are reused for Studio's own colours: --white is the text, --lilac the quieter text,
   --snap the yellow for text and outlines, and --fill the yellow for buttons and bars. */
[data-studio-theme="dark"] {
  --bg: #07070b; --panel: #0b0b12; --side: #0a0a10; --hover: #15161f; --dot: #16171f; --field: #0c0c13; --rule: #1a1b26;
  --white: #fff; --lilac: #9a9bb3; --night: #15161f; --void: #07070b; --snap: #ffd166; --fill: #ffd166; --chart: #ffd166;
  --up-ink: #3ddc97; --down-ink: #ff6b6b;
}
[data-studio-theme="light"] {
  --bg: #f6f6f8; --panel: #fff; --side: #fbfbfc; --hover: #efeff3; --dot: #e2e2e8; --field: #fff; --rule: #e4e4ea;
  --white: #15163a; --lilac: #5d5e72; --night: #ececf1; --void: #fff; --snap: #a86a00; --fill: #ffd166; --chart: #e0a100;
  --up-ink: #12895b; --down-ink: #d63c3c;
  color-scheme: light;
}
html[data-studio-theme] { background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 22px 22px; } /* The dotted background. */
[data-studio-theme] .portal { --line: var(--rule); --up: var(--up-ink); --down: var(--down-ink); }
[data-studio-theme] .portal .button { background: var(--fill); color: #15163a; }
[data-studio-theme] .portal .button:hover { background: #ffe29a; }

/* Sign in: one panel on the dotted background, with the menu's Snappy icon. */
[data-studio-theme] .portal-login { width: min(100% - 2 * var(--edge), 420px); margin: clamp(48px, 16vh, 160px) auto 64px; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
[data-studio-theme] .portal-login .portal-brand { align-items: center; gap: 10px; }
[data-studio-theme] .portal-login .portal-brand span:last-child { color: var(--lilac); }
/* A small "Beta" badge after "Studio", in the menu and on sign-in. */
.portal-beta { display: inline-block; margin-left: 4px; padding: 2px 5px; border: 1px solid var(--snap); border-radius: 4px; color: var(--snap); font: 600 .5625rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: 1px; }
[data-studio-theme] .portal-login h1 { margin-top: 8px; font: 500 1.375rem/1.2 var(--mono); letter-spacing: 0; }

/* The menu: a mark, the site, then links with icons. */
[data-studio-theme] .portal-home { grid-template-columns: 252px minmax(0, 1fr); transition: grid-template-columns .22s ease; }
[data-studio-theme] .portal-side { gap: 14px; padding: 14px 10px; overflow: hidden auto; background: var(--side); }
[data-studio-theme] .portal-side > :not(nav) { padding-inline: 4px; }
[data-studio-theme] .portal-side .portal-brand { align-items: center; gap: 10px; white-space: nowrap; }
[data-studio-theme] .portal-side .portal-brand span:last-child { color: var(--lilac); }
.portal-mark { display: block; flex: none; width: 34px; height: 34px; border-radius: 8px; } /* The Snappy icon (assets/favicon.png). */
[data-studio-theme] .portal-site { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: .875rem; }
[data-studio-theme] .portal-url { font-size: .75rem; }
[data-studio-theme] .portal-nav a { position: relative; justify-content: flex-start; gap: 12px; min-height: 38px; padding: 0 10px; border-radius: 8px; color: var(--lilac); font: 400 .8125rem/1.2 var(--mono); white-space: nowrap; }
[data-studio-theme] .portal-nav a::before { content: ''; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
[data-studio-theme] .portal-nav a:hover { background: var(--hover); color: var(--white); }
[data-studio-theme] .portal-nav a[aria-current] { background: var(--hover); color: var(--white); font-weight: 500; }
[data-studio-theme] .portal-nav a[aria-current]::before { background: var(--snap); }
[data-studio-theme] .portal-nav b,
[data-studio-theme] .portal-nav a.is-locked::after { margin-left: auto; }
[data-studio-theme] .portal-nav b { padding: 0 6px; border-radius: 9px; background: rgb(255 209 102 / .16); line-height: 18px; }
[data-studio-theme] .portal-nav a.is-locked { color: var(--lilac); opacity: .65; }
[data-studio-theme] .portal-nav [data-tab="overview"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 2.5h4v4h-4zM9.5 2.5h4v4h-4zM2.5 9.5h4v4h-4zM9.5 9.5h4v4h-4z'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="requests"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.5 2.5l3 3L6 13H3v-3z'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="editor"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2.5' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 5.5h12M6 9.5l1.5 1.5L10.5 8'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="blog"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 1.5h6l3 3v10h-9z'/%3E%3Cpath d='M9.5 1.5v3h3M5.5 8h5M5.5 10.5h5'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="traffic"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 14h12M4 11V8M8 11V3.5M12 11V6'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="seo"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="chatbot"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="booking"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 6.5h12M5.5 1.5v3M10.5 1.5v3M5.5 9.5h1M9.5 9.5h1M5.5 11.5h1'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="health"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 8h3l2-4.5 3 9 2-4.5h3'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="plan"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1.5' y='3.5' width='13' height='9' rx='1.5'/%3E%3Cpath d='M1.5 6.5h13'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="add-ons"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='12' height='12' rx='2'/%3E%3Cpath d='M8 5v6M5 8h6'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="help"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M6.3 6.2a1.8 1.8 0 1 1 3 1.4c-.8.5-1.3.9-1.3 1.8M8 11.4v.2'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-nav [data-tab="admin"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 1.5l5 2v4c0 3.2-2.2 5.6-5 7-2.8-1.4-5-3.8-5-7v-4z'/%3E%3C/svg%3E"); }
[data-studio-theme] .portal-who { padding-top: 12px; border-top: 1px solid var(--line); font-size: .75rem; }
.portal-collapse { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--lilac); font: 400 .8125rem/1.2 var(--mono); white-space: nowrap; cursor: pointer; }
.portal-collapse:hover { background: var(--hover); color: var(--white); }
.portal-collapse svg,
.portal-theme svg,
.portal-jump svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s; }

/* Collapsed: icons only, with a count shrunk to a dot. Wide screens only; phones keep the row of tabs. */
@media (min-width: 761px) {
  [data-studio-menu="collapsed"] .portal-home { grid-template-columns: 60px minmax(0, 1fr); }
  [data-studio-menu="collapsed"] .portal-side .portal-brand span:last-child,
  [data-studio-menu="collapsed"] .portal-site,
  [data-studio-menu="collapsed"] .portal-who { display: none; }
  [data-studio-menu="collapsed"] .portal-nav a { justify-content: center; gap: 0; padding: 0; font-size: 0; }
  [data-studio-menu="collapsed"] .portal-nav a.is-locked::after { display: none; }
  [data-studio-menu="collapsed"] .portal-nav b { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; padding: 0; font-size: 0; background: var(--fill); }
  [data-studio-menu="collapsed"] .portal-collapse { justify-content: center; margin-top: auto; padding: 0; } /* Stays at the bottom, where the hidden email pushed it. */
  [data-studio-menu="collapsed"] .portal-collapse span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  [data-studio-menu="collapsed"] .portal-collapse svg { transform: rotate(180deg); }
}

/* The top bar: the section's name, the site's status, the theme switch and New request. It stays on screen. */
[data-studio-theme] .portal-main { max-width: none; padding: 0 0 80px; }
[data-studio-theme] .portal-main > :not(.portal-top) { max-width: 1180px; margin: 22px 24px 0; }
[data-studio-theme] .portal-top { position: sticky; top: var(--demo-bar, 0px); z-index: 3; flex-wrap: nowrap; align-items: center; gap: 16px; min-height: 56px; margin: 0; padding: 8px 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); }
[data-studio-theme] .portal-top h1 { font: 500 .9375rem/1.2 var(--mono); letter-spacing: 0; white-space: nowrap; }
[data-studio-theme] .portal-top h1::before { content: 'studio / '; color: var(--lilac); font-weight: 400; }
[data-studio-theme] .portal-top p { font: 400 .75rem/1.3 var(--mono); }
.portal-tools { display: none; }
[data-studio-theme] .portal-tools { display: flex; flex: none; align-items: center; gap: 12px; margin-left: auto; }
.portal-theme { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
.portal-theme button { display: grid; place-items: center; width: 30px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--lilac); cursor: pointer; }
.portal-theme button[aria-pressed="true"] { background: var(--hover); color: var(--snap); }
.portal-theme svg { width: 15px; height: 15px; }
[data-studio-theme] .portal-tools .button { padding: .55em 1em; font: 600 .8125rem/1.2 var(--mono); }

/* Jump to: the button in the top bar, and the box it opens (a <dialog>) with the sections that match what's typed. */
.portal-jump { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--lilac); font: 400 .8125rem/1 var(--mono); white-space: nowrap; cursor: pointer; }
.portal-jump:hover { border-color: var(--lilac); color: var(--white); }
.portal-jump svg { width: 15px; height: 15px; }
.portal-jump kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: .6875rem; }
[data-studio-theme] .portal-main > .portal-jump-box { width: min(100% - 32px, 460px); max-width: none; margin: 14vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--white); box-shadow: 0 24px 60px rgb(0 0 0 / .45); }
.portal-jump-box::backdrop { background: rgb(0 0 0 / .45); }
[data-studio-theme] .portal-jump-box .portal-field { width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; font: 400 .9375rem/1.3 var(--mono); }
.portal-jump-list { margin: 0; padding: 6px; list-style: none; }
.portal-jump-list a { display: block; padding: 9px 10px; border-radius: 6px; color: var(--lilac); font: 400 .875rem/1.2 var(--mono); text-decoration: none; }
.portal-jump-list a:hover,
.portal-jump-list a.is-picked { background: var(--hover); color: var(--white); }
.portal-jump-list a.is-picked::after { content: '↵'; float: right; color: var(--snap); }
.portal-jump-list .portal-note { padding: 9px 10px; }

/* Boxes: the stats as one strip with dividers, and Overview's chart and change requests as panels. */
[data-studio-theme] .portal-stats { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
[data-studio-theme] .portal-tile { padding: 16px; border: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
[data-studio-theme] .portal-tile span { font: 400 .6875rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
[data-studio-theme] .portal-tile strong { font: 500 clamp(1.4rem, 3.4cqw, 1.75rem)/1.1 var(--mono); letter-spacing: -.02em; }
[data-studio-theme] .portal-tile small { font-size: .75rem; }
@container (min-width: 560px) {
  [data-studio-theme] .portal-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } /* Overview's six wrap instead of squeezing. */
}
/* A stat's trend line, from one number per day (sparkline() in portal.js). */
.portal-tile:has(.portal-spark) { grid-template-rows: auto auto 1fr auto; } /* Lines line up at the bottom of the strip. */
.portal-spark { display: block; align-self: end; width: 100%; height: 24px; margin-top: 4px; overflow: visible; }
.portal-spark polyline { fill: none; stroke: var(--chart); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Every section's blocks sit in panels, 16px apart. */
[data-studio-theme] :is(
  [data-chart], #portal-uptime, #portal-search-chart,
  [data-view="overview"] .portal-stack > *, #portal-overview-lists > *,
  #portal-request, [data-view="requests"] .portal-stack > *,
  #portal-breakdowns > *,
  [data-view="seo"] > div:not(.portal-stats, .portal-lock, .portal-advanced), #portal-search-lists > *, #portal-opportunities, #portal-seo-form,
  #portal-bot-chats > *, #portal-bot-form,
  #portal-billing, .portal-offer,
  #portal-ticket, [data-view="help"] .portal-cols > div,
  #portal-admin > div,
  .portal-panel
) { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
[data-studio-theme] :is(.portal-view, .portal-view .portal-cols, .portal-view .portal-stack, .portal-view .portal-grid, .portal-offers) { gap: 16px; }
[data-studio-theme] .portal-seo-form { max-width: none; } /* Its rows read like a table, so the panel fills the width like the ones above it. */
[data-studio-theme] #portal-overview-lists { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.portal-feed small { flex: none; width: 5.5em; }

/* Editor, Blog and Booking. */
.portal-form label:not(.portal-check, .portal-images) { display: grid; gap: 6px; font-size: .9375rem; font-weight: 600; }
.portal-form .portal-field { font-weight: 400; }
.portal-form h2 label { display: inline; font: inherit; }
#portal-blog-ai { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
#portal-blog .portal-cols > .portal-stack { align-self: start; } /* The list and tips stay their own height beside the long form. */
#portal-blog-form label small { color: var(--lilac); font-weight: 400; }
ul.portal-steps { list-style: disc; } /* Blog SEO tips. */
#portal-blog-generate > label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.portal-steps { display: grid; gap: 10px; margin: 0 0 14px; padding-left: 1.4em; font-size: .9375rem; }
.portal-steps li::marker { color: var(--snap); font-family: var(--mono); }
.portal-inline { display: flex; gap: 8px; }
.portal-inline .portal-field { flex: 1; min-width: 0; }
.portal-log li > .portal-link { flex: none; }
.portal-legend { margin-bottom: 8px; padding: 0; font-size: .9375rem; font-weight: 600; }
.portal-hours { display: grid; gap: 8px; }
.portal-hours-row { display: grid; grid-template-columns: minmax(7.5em, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
.portal-hours-row .portal-field { padding: 8px 10px; }
.portal-hours-row .portal-field:disabled { opacity: .4; }
.portal-badge[data-status="Scheduled"] { color: var(--snap); }
.portal-badge[data-status="Draft"] { color: var(--lilac); }
@container (max-width: 480px) {
  .portal-feed small,
  .portal-log .portal-when { display: inline; } /* Other lists drop their dates on phones; Activity and bookings keep theirs. */
  .portal-hours-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .portal-hours-row .portal-check { grid-column: 1 / -1; }
}
[data-studio-theme] [data-view="overview"] [data-chart] { align-self: start; }
[data-studio-theme] .portal-view h2 { font: 500 .75rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lilac); }
[data-studio-theme] .portal-view .portal-lock h2 { font: 600 1.125rem/1.3 Geist, system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--white); }
[data-studio-theme] .portal-chart:not(.portal-uptime) > span > span { background: var(--chart); } /* Uptime keeps its green, yellow and red. */
[data-studio-theme] :is(#portal-outages-block, #portal-publishes-block) { align-self: start; } /* An empty list stays short. */
[data-studio-theme] .portal-chart > span:hover::after,
[data-studio-theme] .portal-chart > span:focus-visible::after { color: var(--panel); }
[data-studio-theme] .portal-bar,
[data-studio-theme] .portal-meter span { background: var(--chart); }

/* Things drawn with the old navy's see-through colours, given Studio's colours so they show in light mode too. */
[data-studio-theme] .portal-field { border-color: var(--line); background: var(--field); }
[data-studio-theme] .portal-field:hover { border-color: var(--lilac); }
[data-studio-theme] .portal-field::placeholder { color: var(--lilac); opacity: .7; }
[data-studio-theme] .portal-lock { background: var(--panel); box-shadow: 0 20px 40px -20px rgb(0 0 0 / .35); }
[data-studio-theme] .portal-ranges button[aria-pressed="true"],
[data-studio-theme] .portal-chat-pick[aria-current] { background: var(--hover); }
[data-studio-theme] .portal-chat-pick:hover,
[data-studio-theme] .portal-ticket summary:hover { background: var(--hover); }
[data-studio-theme] .portal-badge[data-status="Closed"] { color: var(--lilac); }
[data-studio-theme] .portal-check.portal-switch input::after { background: #fff; }
[data-studio-theme] .portal-bubbles .portal-line[data-role="bot"] span { color: var(--bot-text, #fff); }
[data-studio-theme] .demo-bar { --white: #fff; --lilac: #c6c8ec; --snap: #ffd166; color: #fff; } /* The demo's bar stays navy in both. */

@media (max-width: 760px) {
  [data-studio-theme] .portal-home { grid-template-columns: minmax(0, 1fr); }
  [data-studio-theme] .portal-side { overflow: visible; padding: 14px var(--edge) 0; }
  [data-studio-theme] .portal-site,
  .portal-collapse { display: none; }
  [data-studio-theme] .portal-who { padding-top: 0; border: 0; }
  [data-studio-theme] .portal-top { position: static; flex-wrap: wrap; padding: 10px var(--edge); }
  [data-studio-theme] .portal-top p { order: 1; flex-basis: 100%; } /* The status drops under the name and buttons. */
  [data-studio-theme] .portal-top h1::before { content: none; }
  .portal-jump span,
  .portal-jump kbd { display: none; } /* Just the magnifier. */
  .portal-jump { padding: 0 8px; }
  [data-studio-theme] .portal-main > :not(.portal-top) { margin-inline: var(--edge); }
}

/* ---------- The demo dashboard (demo.html): a bar on top of Studio ---------- */

/* The bar stays on screen while Studio scrolls under it. demo.js keeps --demo-bar at the bar's height. */
.demo-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 10px 20px;
  border-bottom: 1px solid rgb(198 200 236 / .16);
  background: var(--ink);
  font-size: .9375rem;
  line-height: 1.4;
}
.demo-bar p { color: var(--lilac); }
.demo-bar p b { margin-right: 8px; padding: .2em .6em; border-radius: var(--radius); background: var(--snap); color: var(--ink); font: 500 .8125rem/1.4 'Geist Mono', ui-monospace, Menlo, monospace; }
.demo-plans { display: flex; gap: 4px; }
.demo-plans a { padding: .5em 1em; border: 1px solid rgb(198 200 236 / .16); border-radius: var(--radius); text-decoration: none; white-space: nowrap; }
.demo-plans a:hover { border-color: var(--snap); }
.demo-plans a[aria-current] { border-color: var(--snap); background: var(--snap); color: var(--ink); font-weight: 600; }
.demo-plans small { margin-left: .5em; font: 500 .8125rem/1 'Geist Mono', ui-monospace, Menlo, monospace; opacity: .75; }
.demo-bar .button { margin-left: auto; }
.demo .portal,
.demo .portal-home { min-height: calc(100vh - var(--demo-bar, 0px)); min-height: calc(100dvh - var(--demo-bar, 0px)); }
/* What a button says when it would buy or leave. */
.demo-note { position: fixed; bottom: 20px; left: 50%; z-index: 9; max-width: calc(100% - 40px); padding: 10px 16px; border-radius: var(--radius); background: var(--snap); color: var(--ink); font-size: .9375rem; font-weight: 600; line-height: 1.4; transform: translateX(-50%); box-shadow: 0 8px 30px rgb(0 0 0 / .4); }
.demo-note[hidden] { display: none; }

/* Wide screens: Studio's menu sticks below the bar. */
@media (min-width: 761px) {
  .demo .portal-side { top: var(--demo-bar, 0px); height: calc(100vh - var(--demo-bar, 0px)); height: calc(100dvh - var(--demo-bar, 0px)); }
}
/* Narrow screens: the bar scrolls away with the page, and the plans share a row. */
@media (max-width: 760px) {
  .demo-bar { position: static; }
  .demo-plans { flex-basis: 100%; }
  .demo-plans a { flex: 1; padding-inline: .4em; text-align: center; }
  .demo-plans small { display: none; }
  .demo-bar .button { flex: 1; text-align: center; }
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding: 28px var(--edge);
  background: var(--void);
}

.site-footer .logo { margin-right: auto; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--snap); text-decoration: underline; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  width: 100%;
  order: 1;
}

.footer-note { width: 100%; order: 2; color: var(--lilac); font-size: .9375rem; }

/* ---------- Smaller screens ---------- */

@media (max-width: 899px) {
  .scenes { background: none; }
  .scene { display: block; padding: clamp(48px, 9vh, 80px) var(--edge); }
  .scene h2 { font-size: clamp(2.8rem, 13vw, 6rem); }
  .mock { height: min(68svh, 520px); margin-top: 28px; }
  .mock-code { font-size: clamp(.625rem, 2.5vw, .875rem); }
  .plan-grid { grid-template-columns: 1fr; }
}

/* The menu button replaces the desktop menu wherever that doesn't fit. It needs 970px, and Windows scrollbars can take 15px of that. The same width is in page.js. */
@media (max-width: 1000px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header > .button { display: none; }

  /* The phone menu: closed, the nav isn't displayed at all, so the intro and link transitions skip it. */
  .site-nav { display: none; }

  .site-header.is-menu-open .site-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 84px var(--edge) 104px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 0;
    background: var(--void);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    clip-path: circle(130% at 50% 50%);
  }

  /* Opening: the menu waits behind its code, then a ring opens it out from the middle. Closing shrinks the same window away with no code. page.js adds the code and hand. */
  .site-header.is-building .site-nav { clip-path: circle(0% at 50% 50%); }
  .site-header.is-snapped .site-nav { clip-path: circle(130% at 50% 50%); transition: clip-path .4s cubic-bezier(.3, .8, .3, 1); }
  .site-header.is-closing .site-nav { clip-path: circle(0% at 50% 50%); transition: clip-path .32s cubic-bezier(.5, 0, .7, .4); }

  .site-header.is-menu-open .menu-code,
  .site-header.is-menu-open .menu-snap {
    position: fixed;
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .site-header.is-menu-open .menu-code {
    z-index: -2;
    overflow: hidden;
    background: var(--void);
    font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
    transition: opacity .12s;
  }

  .site-header.is-building .menu-code { animation: menu-snap .35s cubic-bezier(.3, .8, .3, 1); }
  .site-header.is-gone .menu-code { opacity: 0; }
  .site-header.is-menu-open .menu-snap { z-index: -1; }

  .site-header.is-menu-open .site-nav a {
    width: fit-content;
    padding: .08em 0;
    border-radius: 0;
    font-family: var(--display);
    font-size: min(12vw, 8svh);
    font-stretch: 92%;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
  }

  .site-header.is-menu-open .site-nav a:not([aria-current="page"]):hover { background: none; color: var(--snap); }
  .site-header.is-menu-open .site-nav a[aria-current="page"] { padding: .08em .25em; background: var(--snap); color: var(--ink); scale: 1; }

  .site-header.is-menu-open > .button {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: var(--edge);
    display: inline-flex;
  }

  .site-header.is-building > .button { opacity: 0; }
  .site-header.is-snapped > .button { animation: menu-fade .3s .15s both; }
  .site-header.is-closing > .button { opacity: 0; transition: opacity .15s; }

  .menu-button {
    position: relative;
    display: block;
    justify-self: end;
    width: 52px;
    height: 44px;
    padding: 0;
    border: 1px solid rgb(198 200 236 / .2);
    border-radius: var(--radius);
    background: rgb(14 15 43 / .6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
  }

  .menu-button::before,
  .menu-button::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    left: 15px;
    height: 2px;
    margin-top: -1px;
    background: var(--white);
    transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), background .15s;
  }

  .menu-button::before { transform: translateY(-4px); }
  .menu-button::after { transform: translateY(4px); }

  .is-menu-open .menu-button::before { background: var(--snap); transform: rotate(45deg); }
  .is-menu-open .menu-button::after { background: var(--snap); transform: rotate(-45deg); }

  @keyframes menu-snap {
    from { clip-path: circle(0% at calc(100% - var(--edge) - 26px) 36px); }
    to { clip-path: circle(150% at calc(100% - var(--edge) - 26px) 36px); }
  }

  @keyframes menu-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (max-width: 720px) {
  :root { --chat-button: 64px; }
  .result-grid { grid-template-columns: 1fr; }
  .audit-fields { grid-template-columns: minmax(0, 1fr); }
  .audit-next { flex: 1 1 100%; }

  .hero-hint { display: none; }
  .hero { padding-bottom: 24px; }
  .hero-title { font-size: min(27vw, 18svh); }

  .hero-hand {
    top: 62px;
    right: var(--edge);
    height: min(33svh, 78vw);
    margin-top: 0;
  }

  .hero-actions { width: 100%; }
  .hero:not(.hero-websites, .hero-pricing) .hero-actions { padding-right: max(0px, calc(var(--chat-button) + 24px - var(--edge))); } /* Clears the chat button. */
  .anim-toggle { gap: 8px; font-size: .9375rem; }

  .hero-pricing .hero-hand { height: min(24svh, 50vw); }
  .hero-pricing .hero-title { font-size: min(18vw, 15svh); }
  .hero-websites .hero-title { font-size: min(15vw, 12svh); }
  .hero-websites .title-wide { font-size: min(10vw, 12svh); }
  .hero-pricing .hero-actions { width: auto; }
  .hero-start { min-height: 74svh; }
  .hero-start .hero-title { font-size: min(19.5vw, 15svh); }
  .hero-start .hero-hand { height: min(26svh, 56vw); margin-top: 0; }
  .field-row { grid-template-columns: 1fr; }

  .price-group { grid-template-columns: 1fr; }
  .price-group li { grid-template-rows: auto auto auto; grid-template-columns: minmax(0, 1fr); padding-left: 48px; }
  .row-ui { grid-template-columns: minmax(0, 1fr); margin-left: -48px; }
  .row-ui span { grid-area: auto; }
  .price-group li::before { left: 16px; }
  .price-group b { grid-row: 3; grid-column: 1; margin-top: 4px; }
  .price-group h2 { position: static; }

  .cta-panel h2 { font-size: min(21vw, 22svh); }
  .cta-hand { top: 9%; width: min(72vw, 66svh); }
  .site-footer .logo { width: 100%; max-width: 124px; margin-right: 100%; }
}

/* The Animations switch is off: nothing moves. The background code is one still frame (ocean.js), and the scripts show every page in its final state. */
.no-animations *,
.no-animations *::before,
.no-animations *::after { animation: none !important; transition: none !important; }
.no-animations .hero-hint { display: none; }
.no-animations .hero { cursor: auto; }
.no-animations .marquee-track { flex-wrap: wrap; width: auto; padding: 0 var(--edge); font-size: clamp(1.8rem, 4vw, 3.5rem); }
.no-animations .marquee-track li[aria-hidden] { display: none; }
.no-animations .site-header > .button:hover { scale: none; }
.no-animations .tier:hover,
.no-animations .tier:has(.button:focus-visible) { transform: none; }
.no-animations .row-outline, .no-animations .row-hand { display: none; }
.no-animations .price-group li:not(.is-asked):hover .row-ui strong,
.no-animations .price-group li:not(.is-asked):hover .row-ui span { translate: none !important; }

@media (prefers-reduced-motion: reduce) {
  .anim-toggle,
  .hero-hint { display: none; }
  .hero { cursor: auto; }
  .marquee-track { flex-wrap: wrap; width: auto; padding: 0 var(--edge); animation: none; }
  .marquee-track li[aria-hidden] { display: none; }
  .button, .row-ui, .pill span, .pill span::before, .pill span::after { transition: none; }
  .pill input:checked + span { animation: none; }
  .code-card { transition: none; }
  .audit-more, .audit-fields > *, .calc-more { transition: none; }
  .audit-done { animation: none; }
  .chat-launcher, .chat-hint { transition: none; }
  .chat-hint { animation: none; }
  .chat-bubble.is-thinking::after { animation: none; }
  .menu-button::before, .menu-button::after { transition: none; }
  .row-ui strong, .row-ui span, .price-group li.is-built .row-flip { transition: none; }
  .site-header > .button:not([aria-current="page"])::before,
  .site-header > .button:hover::before,
  .site-header > .button:hover { animation: none; scale: none; }
  .price-group li .row-outline rect, .price-group li.is-outlining .row-outline rect { transition: none !important; }
  .price-group li .row-hand { animation: none !important; }
  .tier { transition: none; }
  .tier:hover,
  .tier:has(.button:focus-visible) { transform: none; }
}


/* ---------- Websites: "Drag. Drop. Done." editor demo (a code card, built like the case study cards) ---------- */

.editor-demo { padding: clamp(80px, 16vh, 180px) var(--edge) 0; }

.editor-demo-tag {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--snap);
  border-radius: var(--radius);
  color: var(--snap);
  font: 500 .9375rem/1.3 'Geist Mono', ui-monospace, Menlo, monospace;
}

.editor-demo h2 {
  max-width: 11em;
  margin-top: clamp(18px, 3vh, 32px);
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 7.5rem);
  font-stretch: 92%;
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.02em;
}

.editor-demo h2 span { color: var(--snap); }

.editor-demo-intro {
  max-width: 34em;
  margin-top: clamp(14px, 2.5vh, 24px);
  color: var(--lilac);
  font-size: clamp(1.0625rem, 1.45vw, 1.3125rem);
  line-height: 1.4;
}

.editor-demo-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(20px, 3vh, 32px); }
.editor-demo-foot span { color: var(--lilac); font: 500 .9375rem/1.3 'Geist Mono', ui-monospace, Menlo, monospace; }

/* The card is as tall as the finished editor. The code sits behind it, and the editor snaps in over the code. */
.editor-card { min-height: 0; margin-top: clamp(28px, 5vh, 56px); border-color: var(--snap); }
.editor-card:hover { transform: none; }

.editor-real {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0;
  padding: 0;
  background: #f4f3ef;
}

.ed-site { display: flex; flex-direction: column; gap: 14px; padding: clamp(16px, 2.4cqw, 32px); }
.ed-nav { display: flex; justify-content: space-between; gap: 12px; color: #4a4b7a; font-size: .8125rem; }
.ed-hero { padding: clamp(14px, 2cqw, 26px); border-radius: var(--radius); background: var(--night); color: var(--white); }
.ed-hero h3 { font: 800 clamp(1.3rem, 3.4cqw, 2.6rem)/1.05 var(--display); font-stretch: 92%; }
.ed-hero h3 span { display: inline-block; padding: 2px 8px; border: 2px solid var(--iris); border-radius: var(--radius); }
.ed-hero p { margin-top: 8px; padding-left: 10px; font-size: .9375rem; }

.ed-slot { position: relative; height: clamp(64px, 8cqw, 96px); border: 2px dashed var(--iris); border-radius: var(--radius); background: rgb(106 108 255 / .08); }
.ed-drag, .ed-hours {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 clamp(14px, 2cqw, 24px);
  border: 1px solid rgb(21 22 58 / .14);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}

.ed-drag { position: absolute; inset: -2px; z-index: 2; border-color: var(--iris); }
.ed-hours { height: clamp(64px, 8cqw, 96px); }
.ed-drag strong, .ed-hours strong { font: 800 clamp(1.05rem, 2.4cqw, 1.7rem)/1.1 var(--display); font-stretch: 92%; }
.ed-drag span, .ed-hours span { color: #4a4b7a; font-size: .9375rem; }
.ed-cursor { position: absolute; right: 8px; bottom: -10px; }

.ed-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(16px, 2.4cqw, 32px); background: var(--void); color: var(--white); }
.ed-label { margin-top: 14px; color: var(--snap); font: 500 .8125rem/1.3 'Geist Mono', ui-monospace, Menlo, monospace; text-transform: uppercase; }
.ed-label:first-child { margin-top: 0; }
.ed-field { margin-top: 6px; padding: 12px 14px; border: 1px solid rgb(198 200 236 / .22); border-radius: var(--radius); background: var(--night); font-size: .9375rem; }
.ed-type { display: block; width: 18ch; overflow: hidden; border-right: 2px solid var(--snap); font-family: 'Geist Mono', ui-monospace, Menlo, monospace; white-space: nowrap; }
.ed-publish { margin-top: 22px; padding: 12px; border-radius: var(--radius); background: var(--snap); color: var(--ink); font-weight: 600; text-align: center; }

@container (max-width: 640px) {
  .editor-real { grid-template-columns: minmax(0, 1fr); }
}

/* The outline draws as the code starts typing, and the hand snaps as the editor appears. */
.editor-outline { opacity: 0; transition: opacity .2s; }
.editor-outline rect { rx: 17px; }
.editor-card.is-typing .editor-outline { opacity: 1; }
.editor-card.is-typing .editor-outline rect { stroke-dashoffset: 0; transition: stroke-dashoffset .8s linear; }
.editor-card.is-snapped .editor-outline { opacity: 0; }
.editor-hand { top: 40%; left: 70%; }
.editor-card.is-snapped .editor-hand { opacity: 0; animation: hand-snap .55s cubic-bezier(.2, .9, .3, 1); transition: opacity .15s .15s; }
.editor-card:not(.is-snapped) .editor-hand { opacity: 0; }
.editor-card.is-typing:not(.is-snapped) .editor-hand { opacity: 1; }

/* Once it has snapped, the editor keeps working: the heading types and the menu section is dragged into place. */
@media (prefers-reduced-motion: no-preference) {
  .editor-card.is-snapped .ed-type { animation: ed-type 7s steps(18) infinite; }
  .editor-card.is-snapped .ed-drag { animation: ed-drag 7s cubic-bezier(.4, 0, .2, 1) infinite; }
}

@keyframes ed-type {
  0% { width: 0; }
  35%, 90% { width: 18ch; }
  100% { width: 0; }
}

@keyframes ed-drag {
  0%, 40% { translate: 0 76px; rotate: -2deg; box-shadow: 0 18px 36px rgb(21 22 58 / .35); }
  60%, 88% { translate: 0 0; rotate: 0deg; box-shadow: none; }
  100% { translate: 0 76px; rotate: -2deg; box-shadow: 0 18px 36px rgb(21 22 58 / .35); }
}
