/* The ragecaptcha.com notice page. Colours are the LilyCaptcha "Night Lily" tokens
   (src/styles.css in the main app), plus the old rage red for the old name. */

:root {
  --night: #140b12;
  --plum: #1d1119;
  --raise: #27161f;
  --lily: #f47fb2;
  --lily-soft: #f79bc2;
  --ink: #2b0b1c;
  --petal: #fbf2f6;
  --mauve: #b89aab;
  --mauve-2: #94788a;
  --line: rgb(244 127 178 / 0.16);
  --line-strong: rgb(244 127 178 / 0.34);
  --rage: #f92434; /* the old RageCaptcha red, oklch(0.63 0.24 25) */
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 0.875rem;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  background:
    radial-gradient(52rem 36rem at 84% 14%, rgb(244 127 178 / 0.08), transparent 64%), var(--night);
  color: var(--petal);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgb(244 127 178 / 0.35);
  color: var(--petal);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */

.page,
.foot {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.page {
  flex: 1;
  padding-block: clamp(2.5rem, 8vw, 6.5rem) 2rem;
}

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  min-width: 0;
  container-type: inline-size;
}

.bloom {
  position: relative;
  order: -1;
  width: 6.5rem;
}

@media (min-width: 40rem) {
  .page,
  .foot {
    padding-inline: 2rem;
  }
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 3rem;
  }

  .bloom {
    order: 0;
    width: min(100%, 23rem);
    justify-self: center;
  }
}

/* The address. Mono, like the old wordmark, so the letters keep their width while they change. */

.domain {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 11cqi, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.swap {
  position: relative;
  display: inline-block;
  color: var(--lily);
}

/* The line drawn through "rage" before it changes. */
.swap::after {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  top: 54%;
  height: 0.075em;
  border-radius: 1px;
  background: var(--rage);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.slot {
  display: inline-block;
  color: var(--rage);
}

.slot.set {
  color: var(--lily);
  animation: land 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes land {
  from {
    transform: translateY(-0.12em);
    text-shadow: 0 0 0.5em rgb(244 127 178 / 0.85);
  }
  to {
    transform: none;
    text-shadow: 0 0 0.6em rgb(244 127 178 / 0.18);
  }
}

/* Copy */

.lead {
  margin: 1.75rem 0 0;
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.375rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 30rem) {
  .lead span {
    display: block;
  }
}

.note {
  margin: 1.25rem 0 0;
  max-width: 33rem;
  color: var(--mauve);
  text-wrap: pretty;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3.125rem;
  padding: 0.75rem 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 700 1rem/1.2 var(--sans);
  text-decoration: none;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.button:focus-visible,
.copy:focus-visible {
  outline: 2px solid var(--lily);
  outline-offset: 3px;
}

.primary {
  background: var(--lily);
  color: var(--ink);
}

.primary:hover {
  background: var(--lily-soft);
}

.secondary {
  border-color: var(--line-strong);
  background: rgb(244 127 178 / 0.05);
  color: var(--petal);
}

.secondary:hover {
  border-color: rgb(244 127 178 / 0.55);
  background: rgb(244 127 178 / 0.11);
}

.plane {
  flex: none;
  color: var(--lily);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.2, 1.4);
}

.secondary:hover .plane,
.secondary:focus-visible .plane {
  transform: translate(3px, -3px);
}

@media (max-width: 29.99rem) {
  .button {
    flex: 1 1 100%;
  }
}

/* The lily */

.bloom::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: radial-gradient(closest-side, rgb(244 127 178 / 0.26), rgb(244 127 178 / 0));
  pointer-events: none;
}

.lily {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 1.5rem rgb(244 127 178 / 0.25));
}

.lily path {
  transform-box: view-box;
  transform-origin: 0 0;
}

@keyframes open {
  from {
    opacity: 0;
    transform: scale(0.12) rotate(-38deg);
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Developers */

.dev {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin-top: clamp(4rem, 11vw, 7.5rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 56rem) {
  .dev {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3rem;
  }
}

.dev h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.dev-copy p {
  margin: 0.5rem 0 0;
  max-width: 30rem;
  color: var(--mauve);
}

.diff {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--plum);
}

.diff pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font: 500 0.9375rem/1.8 var(--mono);
}

.mark {
  display: inline-block;
  width: 1.6em;
  user-select: none;
}

.del {
  color: var(--mauve-2);
}

.del .mark {
  color: var(--rage);
}

.add {
  color: var(--petal);
}

.add .mark {
  color: var(--lily);
}

.diff-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 0.02);
  color: var(--mauve-2);
  font-size: 0.875rem;
}

.copy {
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--raise);
  color: var(--petal);
  font: 600 0.875rem/1 var(--sans);
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.copy:hover {
  border-color: var(--line-strong);
}

.copy.done {
  color: var(--lily);
}

/* Footer */

.foot {
  padding-block: 2rem 2.5rem;
  color: var(--mauve-2);
  font-size: 0.875rem;
}

.foot p {
  margin: 0;
}

/* The opening sequence. main.js adds .moving to <html> only when motion is allowed, then
   .playing / .struck / .landed on the heading and .open on the lily as it runs. If the script
   never gets that far, the failsafe shows everything after a few seconds. */

@keyframes failsafe {
  to {
    opacity: 1;
  }
}

.moving .domain-text,
.moving .lily path,
.moving .bloom::before {
  opacity: 0;
  animation: failsafe 0s 3.5s forwards;
}

.moving .domain.playing .domain-text {
  opacity: 1;
  animation: none;
  transition: opacity 0.45s ease-out;
}

.moving .domain.struck .swap::after {
  transform: scaleX(1);
  transition: transform 0.32s cubic-bezier(0.65, 0, 0.25, 1);
}

.moving .domain.landed .swap::after {
  transform: scaleX(1);
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.moving .bloom.open::before {
  opacity: 1;
  animation: none;
  transition: opacity 1.6s ease-out;
}

.moving .bloom.open .lily path {
  animation: open 1s cubic-bezier(0.2, 0.75, 0.25, 1.12) both;
}

.moving .bloom.open .petals-outer g:nth-child(2) path {
  animation-delay: 0.09s;
}

.moving .bloom.open .petals-outer g:nth-child(3) path {
  animation-delay: 0.18s;
}

.moving .bloom.open .petals-inner g:nth-child(1) path {
  animation-delay: 0.34s;
}

.moving .bloom.open .petals-inner g:nth-child(2) path {
  animation-delay: 0.43s;
}

.moving .bloom.open .petals-inner g:nth-child(3) path {
  animation-delay: 0.52s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
