/* Home: the hero and its receipt, the attack, why it holds, theming, install. */

/* ---------- Shared ---------- */

.display {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.section-head:has(.display) {
  max-width: 68ch;
  margin-bottom: 48px;
}

.fine {
  font-size: 0.88rem;
  color: var(--ink-2);
}

.wrap.wide {
  max-width: 1280px;
}

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

.hero {
  position: relative;
  overflow: clip;
  padding: 40px 0 72px;
}

/* Two soft lights behind the card. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.hero::before {
  top: -80px;
  left: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.42), transparent 65%);
  animation: drift 16s ease-in-out infinite alternate;
}

.hero::after {
  top: 140px;
  right: -100px;
  width: 460px;
  height: 460px;
  background: radial-gradient(
    circle,
    rgba(14, 159, 110, 0.32),
    transparent 65%
  );
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 64px;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 24px;
  padding-top: 40px;
}

.hero-title {
  font-size: clamp(2.8rem, 5.6vw, 5.2rem);
  line-height: 0.98;
}

.hero-title .w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  vertical-align: top;
}

.hero-title .w > span {
  display: inline-block;
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-title .w:nth-child(2) > span {
  animation-delay: 0.07s;
}
.hero-title .w:nth-child(3) > span {
  animation-delay: 0.14s;
}
.hero-title .w:nth-child(4) > span {
  animation-delay: 0.21s;
}
.hero-title .w:nth-child(5) > span {
  animation-delay: 0.28s;
}

.hero-copy > :not(h1) {
  animation: fade-up 0.8s 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.for-note,
.protocol-note {
  max-width: 52ch;
  margin-top: -8px;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.protocol-note strong {
  color: var(--ink);
}

.install {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 6px 6px 18px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
}

.install code {
  padding: 0;
  overflow-x: auto;
  background: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.install .prompt {
  color: var(--code-dim);
  user-select: none;
}

.stage {
  display: grid;
  gap: 16px;
  perspective: 2200px;
  animation: stage-in 1s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The card flips over to show what the app received. */
.flip {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.65, 0, 0.25, 1);
}

.flip.flipped {
  transform: rotateY(180deg);
}

.face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.stage-card {
  zoom: 0.86;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgba(14, 26, 51, 0.35);
}

.face.back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid #22345f;
  border-radius: 19px;
  background:
    radial-gradient(
      520px circle at 100% 0%,
      rgba(88, 130, 255, 0.22),
      transparent 60%
    ),
    #0a1329;
  box-shadow: 0 30px 60px -30px rgba(14, 26, 51, 0.6);
  color: #e6ecfb;
  transform: rotateY(180deg);
}

.rx-label {
  color: var(--code-dim);
  font-size: 0.86rem;
}

.rx-event {
  margin-top: -8px;
  color: #7fe0b5;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.rx-event.deny {
  color: #ffb380;
}

.rx-json {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid #22345f;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--code-scroll) transparent;
}

.rx-copy {
  color: #aab8d8;
  font-size: 0.95rem;
}

.rx-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rx-pills li {
  padding: 5px 12px;
  border: 1px solid #2b3f6e;
  border-radius: 99px;
  color: #e6ecfb;
  font-size: 0.84rem;
  font-weight: 600;
}

.rx-kya {
  color: #aab8d8;
  font-size: 0.86rem;
}

.rx-back {
  align-self: flex-start;
  margin-top: 6px;
}

/* The receipt's lines arrive one after another once the card has turned. */
.flip.flipped .back > * {
  animation: fade-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.flip.flipped .back > :nth-child(1) {
  animation-delay: 0.55s;
}
.flip.flipped .back > :nth-child(2) {
  animation-delay: 0.62s;
}
.flip.flipped .back > :nth-child(3) {
  animation-delay: 0.72s;
}
.flip.flipped .back > :nth-child(4) {
  animation-delay: 0.85s;
}
.flip.flipped .back > :nth-child(5) {
  animation-delay: 0.92s;
}
.flip.flipped .back > :nth-child(6) {
  animation-delay: 1s;
}
.flip.flipped .back > :nth-child(7) {
  animation-delay: 1.08s;
}
.flip.flipped .back > :nth-child(8) {
  animation-delay: 1.16s;
}

/* Bottom of the copy column: the nudge toward the card. */
.try-cue {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 28px;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.rx-log-wrap {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid #22345f;
}

.rx-log {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #c8d3ec;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.rx-log li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.rx-log time {
  color: #5d6f99;
}

.live-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grant);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 159, 110, 0.45);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(14, 159, 110, 0);
  }
}

@keyframes rise {
  from {
    transform: translateY(105%);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
}

@keyframes drift {
  to {
    margin: 30px 0 0 40px;
  }
}

/* ---------- Dark sections ---------- */

.dark {
  --header-bg: #0a1329; /* the site header takes this color over the section */
  position: relative;
  overflow: clip; /* not hidden: hidden would stop the attack stage from pinning */
  border-top: 0;
  background:
    radial-gradient(
      700px circle at 85% 0%,
      rgba(88, 130, 255, 0.14),
      transparent 60%
    ),
    #0a1329;
  color: #e6ecfb;
}

.dark + section,
section + .dark {
  border-top: 0;
}

.dark h2,
.dark h3 {
  color: #fff;
}

.dark .lede {
  color: #aab8d8;
}

.dark :not(pre) > code {
  background: rgba(255, 255, 255, 0.1);
  color: #e6ecfb;
}

.btn.ghost-dark {
  border: 1px solid #34487a;
  background: transparent;
  color: #e6ecfb;
}

.btn.ghost-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  filter: none;
}

/* ---------- The attack ---------- */

#attack {
  padding-bottom: 120px;
}

.attack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: start;
}

.attack-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.astep {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 62vh;
  padding: 24px 0;
  opacity: 0.32;
  transition: opacity 0.45s;
}

.astep:first-child {
  min-height: 52vh;
  align-content: start;
  padding-top: 8vh;
}

/* The last step is a full screen tall, so the pinned stage stays pinned while
   people walk the shadow roots and read what happened. */
.astep:last-child {
  min-height: 100vh;
  align-content: start;
  padding-top: 14vh;
}

.astep.active {
  opacity: 1;
}

.astep h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}

.astep p {
  max-width: 46ch;
  color: #aab8d8;
}

.astep .btn {
  justify-self: start;
}

.astep-kicker {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: #7fe0b5;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.astep-kicker span {
  color: #5d6f99;
}

.attack-stage {
  position: sticky;
  top: 76px;
  width: calc(var(--duel-w, 680px) + 38px);
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #22345f;
  border-radius: 24px;
  background: #0e1838;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}

.duel {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  gap: 16px;
  justify-content: center;
  align-items: start;
  width: var(--duel-w, auto);
}

.contender {
  display: grid;
  grid-template-rows: auto var(--frame-row, auto);
  align-items: start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  transition:
    opacity 0.5s,
    filter 0.5s;
}

.c-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.c-name {
  color: #aab8d8;
  font-size: 0.84rem;
  font-weight: 600;
}

.c-name code {
  padding: 0 !important;
  background: none !important;
  color: #fff !important;
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

/* An empty verdict keeps its line, so the heads never change height. */
.verdict:empty::after {
  content: "\a0";
}

.verdict::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.verdict[data-verdict="idle"] {
  visibility: hidden;
}

.verdict[data-verdict="held"] {
  background: rgba(14, 159, 110, 0.18);
  color: #7fe0b5;
}

.verdict[data-verdict="broken"] {
  background: rgba(255, 94, 87, 0.18);
  color: #ff8a80;
}

.verdict[data-verdict="info"] {
  background: rgba(255, 255, 255, 0.1);
  color: #e6ecfb;
}

.verdict.pop {
  animation: verdict-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes verdict-pop {
  from {
    transform: scale(0.6);
  }
}

/* The frame is sized by script so both cards fit the screen while pinned. */
.c-frame {
  position: relative;
  width: var(--fw, 340px);
  height: var(--fh, 600px);
  overflow: hidden;
  border-radius: calc(22px * var(--s, 0.74));
  transition:
    box-shadow 0.35s,
    height 0.35s;
}

/* A card taller than the room fades out at the bottom instead of rescaling. */
.contender.clipped .c-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 72px;
  background: linear-gradient(transparent, #0e1838);
  pointer-events: none;
}

.c-scale {
  width: var(--nw, 460px);
  transform: scale(var(--s, 0.74));
  transform-origin: 0 0;
}

.contender[data-state="broken"] .c-frame {
  box-shadow:
    0 0 0 2px #ff5e57,
    0 0 48px -6px rgba(255, 94, 87, 0.55);
}

.contender[data-state="held"] .c-frame {
  box-shadow:
    0 0 0 2px #2f8f6b,
    0 0 48px -10px rgba(14, 159, 110, 0.45);
}

.console {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid #22345f;
}

.console-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.console-label {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #aab8d8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.dark .console-line code {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: none;
  color: #ffb3bb;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-note {
  min-height: 3em;
  max-width: 64ch;
  color: #c8d3ec;
  font-size: 0.92rem;
  line-height: 1.5;
}

#atk-screen::part(connector),
#make-screen::part(connector) {
  display: none;
}

/* ---------- The plain-HTML twin: the same screen without shadow DOM ---------- */

.twin {
  width: 460px;
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

.tw-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 28px 22px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px -40px rgba(15, 23, 42, 0.4);
}

/* The component tightens its card padding on small viewports; so does the twin. */
@media (max-width: 480px) {
  .tw-card {
    padding: 20px 18px;
  }
}

.tw-eyebrow {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.55;
  text-transform: uppercase;
}

.tw-headline {
  margin: 0;
  color: #0f172a;
  font-family: "Times New Roman", Georgia, serif;
  font-size: clamp(24px, 5vw, 30px); /* the component's own sizing */
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.tw-headline em {
  font-style: italic;
}

.tw-sub {
  color: #334155;
  font-size: 14.5px;
  line-height: 1.55;
}

.tw-agent {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #f1ece2;
}

.tw-logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
  font-weight: 600;
}

.tw-agent-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tw-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tw-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The plain screen's own pill styles. The forged badge reuses them. */
.twin .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 17px;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.twin .pill.verified {
  background: #dcfce7;
  color: #166534;
}

.twin .pill.unverified {
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.08em;
}

.tw-headline .pill {
  margin-left: 6px;
  font-size: 15px;
  line-height: 24px;
  padding: 2px 12px;
}

.tw-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.tw-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.55;
  text-transform: uppercase;
}

.tw-hint {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.tw-rows {
  display: flex;
  flex-direction: column;
}

.tw-row {
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 -10px;
  padding: 16px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.tw-row + .tw-row {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.tw-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 14px;
}

.tw-row.on .tw-check {
  border-color: var(--tw-primary, #0f172a);
  background: var(--tw-primary, #0f172a);
  color: #fff;
}

.tw-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1ece2;
  color: #334155;
}

.tw-icon svg {
  width: 18px;
  height: 18px;
}

.tw-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tw-label {
  color: #0f172a;
  font-size: 14.5px;
  line-height: 1.45;
}

.tw-label strong {
  font-weight: 600;
}

.tw-label span {
  color: #334155;
}

.tw-risk {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fce7b6;
  color: #7a4f00;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dark .tw-scopes code {
  padding: 0;
  background: none;
  color: #334155;
  font-size: inherit;
}

.tw-scopes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #334155;
  font-family: monospace;
  font-size: 11.5px;
}

.tw-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tw-allow,
.tw-deny {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.tw-allow {
  background: var(--tw-primary, #0f172a);
  color: #fff;
}

.tw-deny {
  padding: 10px 18px;
  background: transparent;
  color: #334155;
}

.twin.approved .tw-allow {
  background: #b42318;
}

/* ---------- Why it holds: the blue field ---------- */

.field-blue {
  --header-bg: var(--blue-field);
  border-top: 0;
  background: var(--blue-field);
  color: #fff;
}

.field-blue + section {
  border-top: 0;
}

#why h2,
#why h3 {
  color: #fff;
}

#why .lede {
  color: rgba(255, 255, 255, 0.88);
}

#why :not(pre) > code {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

#why a {
  color: #fff;
}

/* A browser inspector, drawn in the vernacular people already know. */
.devtools {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: #0d1526;
  box-shadow: 0 50px 90px -40px rgba(7, 18, 60, 0.8);
}

.dt-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid #23304d;
  background: #18223a;
}

.dt-dots {
  display: flex;
  gap: 7px;
}

.dt-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a4766;
}

.dt-tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dt-tab {
  padding: 12px 12px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #8896b8;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  cursor: pointer;
}

.dt-tab:hover {
  color: #dbe4f7;
}

.dt-tab[aria-selected="true"] {
  border-bottom-color: #7fb0ff;
  color: #fff;
}

.dt-toggle {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #aab8d8;
  font-size: 0.8rem;
  cursor: pointer;
}

.dt-toggle input {
  accent-color: #7fb0ff;
}

.dt-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: 340px;
}

.dt-preview {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid #23304d;
  background-color: var(--paper);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 14px 14px;
}

.xray-live {
  display: grid;
  place-items: center;
  min-height: 200px;
  overflow-x: auto;
}

.xray-live > * {
  width: min(100%, 380px);
}

.xray-live > consent-button {
  width: auto;
}

.xray-count {
  color: var(--ink-2);
  font-size: 0.84rem;
}

/* The selected element, highlighted the way the inspector does it. */
.dt-highlight {
  position: absolute;
  top: var(--hy, 0);
  left: var(--hx, 0);
  width: var(--hw, 0);
  height: var(--hh, 0);
  background: rgba(111, 168, 220, 0.42);
  outline: 1px dashed rgba(37, 99, 235, 0.8);
  pointer-events: none;
  transition:
    top 0.3s,
    left 0.3s,
    width 0.3s,
    height 0.3s;
}

.dt-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(14, 26, 51, 0.25);
  color: #6b7280;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.dt-tip b {
  color: #881280;
  font-weight: 500;
}

.dt-tip i {
  font-style: normal;
}

.dt-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 12px;
  border: 5px solid transparent;
  border-top-color: #fff;
}

.dt-tree {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dt-tree-head {
  padding: 8px 18px;
  border-bottom: 1px solid #23304d;
  color: #8896b8;
  font-size: 0.74rem;
}

#why .dt-tree-head code {
  padding: 0;
  background: none;
  color: #dbe4f7;
}

.xray-pre {
  flex: 1;
  margin: 0;
  max-height: 420px;
  padding: 14px 18px;
  overflow: auto;
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--code-scroll) transparent;
}

.xray-pre .dim {
  color: var(--code-dim);
}

.xray-pre .shadow {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 212, 138, 0.12);
  color: #ffd48a;
  font-style: italic;
}

/* Tree lines arrive in order once the inspector is on screen. */
.devtools.reveal .xray-pre .ln {
  display: inline-block;
  animation: line-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 28ms);
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}

.inspect-tip {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
}

.why-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  margin-top: 72px;
}

.why-col {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.why-col > p {
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.86);
}

#why .fine {
  color: rgba(255, 255, 255, 0.72);
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.logo-tile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 78px;
  padding: 14px 6px 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px -14px rgba(7, 18, 60, 0.7);
}

.logo-tile img {
  width: 36px;
  height: 36px;
}

.logo-name {
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
}

/* A small "x" pinned to each tile: calm, not a warning. */
.sticker {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(14, 26, 51, 0.3);
  transform: rotate(8deg);
}

.sticker svg {
  width: 13px;
  height: 13px;
}

.sticker path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.8;
  stroke-linecap: round;
}

/* The stickers pop on once. JS adds .will-draw only when motion is welcome. */
.will-draw .sticker {
  transform: scale(0) rotate(8deg);
}

.will-draw.is-in .sticker {
  animation: pop 0.32s cubic-bezier(0.3, 1.6, 0.5, 1) var(--d, 0s) forwards;
}

.logo-tile:nth-child(2) {
  --d: 0.08s;
}
.logo-tile:nth-child(3) {
  --d: 0.16s;
}
.logo-tile:nth-child(4) {
  --d: 0.24s;
}
.logo-tile:nth-child(5) {
  --d: 0.32s;
}

@keyframes pop {
  to {
    transform: scale(1) rotate(8deg);
  }
}

/* The W3C lockup is dark artwork on white; give it a white chip. */
.w3c-chip {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px -14px rgba(7, 18, 60, 0.7);
}

.w3c {
  display: block;
}

.spec-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-list a {
  display: inline-block;
  padding: 4px 0;
  font-weight: 600;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.spec-list a:hover {
  text-decoration-color: #fff;
}

.compare {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.compare summary {
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.compare .table-wrap {
  margin-top: 12px;
  border: 0;
}

.compare table {
  color: var(--ink);
  font-size: 0.84rem;
}

.compare tbody th {
  background: var(--surface);
  font-weight: 600;
}

.compare thead th:last-child,
.compare td:last-child {
  background: color-mix(in srgb, var(--signal) 7%, var(--surface));
  font-weight: 600;
}

.limits {
  display: grid;
  gap: 18px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.limits h3 {
  font-size: 1.1rem;
}

.limit-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
}

.limit-list strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
}

/* ---------- Make it yours ---------- */

#make {
  padding-bottom: 104px;
}

.make {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.make-preview {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.make-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.make-preview[data-theme="tailwind"] .swatch-row,
.make-preview[data-theme="tailwind"] .custom-color {
  opacity: 0.35;
  pointer-events: none;
}

.custom-color {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: conic-gradient(
    #ef4444,
    #f59e0b,
    #22c55e,
    #06b6d4,
    #6366f1,
    #d946ef,
    #ef4444
  );
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.custom-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.make-card {
  zoom: 0.86;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgba(14, 26, 51, 0.3);
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* The Tailwind theme brings its own edge and shadow, so the mat steps away. */
.make-preview[data-theme="tailwind"] .make-card {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
}

/* Sign-in methods share the card's width, one button each. */
.make-signin button {
  flex: 1 1 auto;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .make-signin button {
    padding-inline: 6px;
  }
}

@media (max-width: 360px) {
  .make-signin button {
    padding-inline: 4px;
    font-size: 0.8rem;
  }
}

.make-auth {
  display: grid;
  gap: 10px;
  padding: 4px 0 12px;
}

/* Passkey and OAuth approve with their own button, so the screen's Allow steps
   aside. */
.make-preview.no-allow #make-screen::part(submit) {
  display: none;
}

.signin-note {
  max-width: 52ch;
  line-height: 1.5;
}

.signin-note code {
  font-size: 0.82rem;
}

.make-code {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.make-code .codeblock pre.code {
  max-height: 560px;
  font-size: 0.8rem;
}

/* ---------- The end: install ---------- */

.endcap {
  padding: 120px 0 96px;
}

.endcap::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  width: 900px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(37, 99, 235, 0.35),
    transparent
  );
  pointer-events: none;
  transform: translateX(-50%);
}

.endcap .wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.big-install {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  max-width: 100%;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid #22345f;
  background: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 4.2vw, 3.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  cursor: copy;
  transition: border-color 0.2s;
}

.big-install:hover {
  border-color: #7fb0ff;
}

.bi-prompt {
  color: #5d6f99;
}

.bi-cmd {
  white-space: nowrap;
}

.bi-hint {
  position: absolute;
  top: -34px;
  left: 50%;
  padding: 3px 10px;
  border-radius: 99px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.big-install:hover .bi-hint,
.big-install:focus-visible .bi-hint,
.big-install.copied .bi-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.endcap-facts {
  color: #aab8d8;
}

.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin-top: 56px;
  border-top: 1px solid #22345f;
  text-align: left;
}

.door {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 28px 28px 8px 0;
  color: inherit;
  text-decoration: none;
}

.door + .door {
  padding-left: 28px;
  border-left: 1px solid #22345f;
}

.door strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  transition: text-decoration-color 0.2s;
}

.door:hover strong {
  text-decoration-color: #7fb0ff;
}

.door span {
  color: #aab8d8;
  font-size: 0.95rem;
}

/* ---------- The tip that follows the cursor over things worth inspecting ---------- */

.has-inspect-hint {
  cursor: context-menu;
}

.inspect-hint {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--ink);
  box-shadow: 0 6px 18px rgba(14, 26, 51, 0.3);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.inspect-hint[data-show] {
  opacity: 1;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: 40px;
  }
  .attack {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .why-row,
  .make,
  .limit-list,
  .doors {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-copy {
    padding-top: 8px;
  }
  .stage {
    max-width: 460px;
  }
  .why-row {
    gap: 48px;
  }
  .limit-list {
    gap: 16px;
  }
  .make-code {
    position: static;
  }
  .door,
  .door + .door {
    padding: 22px 0;
    border-left: 0;
  }
  .door + .door {
    border-top: 1px solid #22345f;
  }
  .dt-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .dt-preview {
    border-right: 0;
    border-bottom: 1px solid #23304d;
  }
  .dt-body {
    min-height: 0;
  }
  .xray-live {
    min-height: 150px;
  }
  /* The tabs scroll on their own row; the toggle keeps its full label below. */
  .dt-bar {
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
  }
  .dt-dots {
    display: none;
  }
  .dt-tabs {
    flex: 1 1 100%;
    padding: 0 6px;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .dt-toggle {
    flex: 1 1 100%;
    margin: 0;
    padding: 11px 14px;
    border-top: 1px solid #23304d;
  }

  /* The attack: the stage pins edge to edge under the header and the steps
     scroll beneath it. */
  .attack {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .attack-stage {
    order: -1;
    z-index: 2;
    top: 61px;
    width: auto;
    margin: 0 calc(-1 * var(--gutter));
    padding: 12px 12px 10px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }
  /* Step text fades as it slides under the pinned stage. */
  .attack-stage::after {
    content: "";
    position: absolute;
    inset: 100% 0 auto;
    height: 32px;
    background: linear-gradient(#0a1329, transparent);
    pointer-events: none;
  }
  .duel {
    width: auto;
  }
  .console-line {
    display: none;
  }
  .console-note {
    min-height: 4.5em;
    font-size: 0.84rem;
  }
  .duel {
    gap: 10px;
  }
  .astep,
  .astep:first-child,
  .astep:last-child {
    min-height: 0;
    padding: 40px 0;
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .endcap {
    padding: 88px 0 72px;
  }
  /* Name above verdict on both sides, so the two cards start level. */
  .c-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .c-name {
    font-size: 0.74rem;
  }
  .verdict {
    font-size: 0.7rem;
  }
}
