/* The temporary site at annoti.app. Colours follow the dashboard (packages/dashboard/src/app.css). */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --surface: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #52525b;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-text: #1d4ed8;
  --accent-subtle: #eef2fe;
  --on-accent: #ffffff;
  --focus: #1d4ed8;
  --shine: linear-gradient(90deg, #6d28d9, #1d4ed8 55%, #0f766e);
  --glow-opacity: 0.22;
  --shadow-float: 0 24px 60px rgb(24 24 27 / 0.16), 0 4px 12px rgb(24 24 27 / 0.06);
  --radius: 6px;
  --radius-lg: 14px;
  --font:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --bg-subtle: #141416;
    --surface: #161618;
    --border: #27272b;
    --border-strong: #34343a;
    --text: #ececef;
    --text-muted: #a8a8b0;
    --accent: #3b6cf6;
    --accent-hover: #2c5ce6;
    --accent-text: #8fb0ff;
    --accent-subtle: #19233d;
    --focus: #8fb0ff;
    --shine: linear-gradient(90deg, #c4b5fd, #8fb0ff 55%, #5eead4);
    --glow-opacity: 0.2;
    --shadow-float: 0 24px 60px rgb(0 0 0 / 0.5), 0 4px 12px rgb(0 0 0 / 0.3);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.skip:focus {
  top: 1rem;
}

/* The colours of the logo, blurred into a slowly turning light behind the hero. The wrapper
   clips it, so it never makes the page scroll sideways. */
.glow {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 60rem;
  overflow: hidden;
  pointer-events: none;
}

.glow::before {
  content: '';
  position: absolute;
  top: -22rem;
  left: 50%;
  width: 70rem;
  height: 70rem;
  margin-left: -35rem;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #7c3aed,
    #e11d48,
    #ff7a00,
    #84cc16,
    #0d9488,
    #2563eb,
    #7c3aed
  );
  filter: blur(120px);
  opacity: var(--glow-opacity);
  animation: turn 40s linear infinite;
}

@keyframes turn {
  to {
    transform: rotate(1turn);
  }
}

/* Header and footer */

.top,
.bottom,
main {
  width: min(72rem, 100% - 2rem);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.wordmark {
  font-size: 1.375rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* The logo mark, drawn in CSS so it stays sharp at every size. */
.mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 24%;
  background: conic-gradient(
    from -45deg,
    #7c3aed,
    #e11d48 12.5%,
    #ff1e1e 25%,
    #ff7a00 37.5%,
    #84ff00 50%,
    #22a35a 62.5%,
    #0f7c7c 75%,
    #2f4bff 87.5%,
    #7c3aed
  );
}

.mark svg {
  position: absolute;
  top: 0;
  left: 0;
  /* The legs end level, like the logo: the drawing stops at 83% of the height. */
  width: 100%;
  height: 83%;
}

.mark path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 15;
  stroke-linejoin: round;
}

.brand.small {
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.brand.small .mark {
  width: 1.375rem;
  height: 1.375rem;
}

.bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 5rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--border);
}

.bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.bottom a {
  color: var(--text-muted);
}

.bottom a:hover {
  color: var(--text);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.15s;
}

.button:hover {
  border-color: var(--text-muted);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button.ghost {
  min-height: 2.5rem;
  background: transparent;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3.5rem;
  align-items: center;
  padding-block: 3.5rem 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.25rem 0.875rem 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.dot {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #16a34a;
}

.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #16a34a;
  animation: ping 2s ease-out infinite;
}

@keyframes ping {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

h1 {
  margin: 0;
  font-size: clamp(2.375rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.shine {
  background: var(--shine);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--text-muted);
  font-size: 1.1875rem;
  text-wrap: pretty;
}

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

/* Demo: a website in a browser window, with the widget on top. Everything inside is drawn at a
   size relative to the window, so it scales as one picture. */

.demo {
  position: relative;
  margin: 0;
}

.browser {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.chrome {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.lights {
  display: flex;
  gap: 0.375rem;
}

.lights i {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--border-strong);
}

.url {
  flex: 1;
  max-width: 16rem;
  margin-inline: auto;
  padding: 0.125rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.page {
  --site-bg: #fbf6ee;
  --site-ink: #3b2a1a;
  --site-line: #e9dcc8;
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  padding: 1.4em 1.8em;
  background: var(--site-bg);
  color: var(--site-ink);
  font-size: clamp(8px, 2.4cqw, 14px);
  line-height: 1.3;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.2em;
}

.site-logo {
  font-weight: 800;
  font-size: 1.15em;
  letter-spacing: -0.01em;
}

.site-links {
  display: flex;
  gap: 1em;
}

.site-links i {
  width: 3.2em;
  height: 0.5em;
  border-radius: 1em;
  background: var(--site-line);
}

.site-hero {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: 62%;
  padding: 0.4em;
  margin: -0.4em;
}

.site-kicker {
  color: #b45309;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-title {
  font-size: 2.1em;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.site-text {
  height: 0.55em;
  border-radius: 1em;
  background: var(--site-line);
}

.site-text.short {
  width: 70%;
}

/* Deliberately hard to read, which is what the visitor in the demo reports. */
.site-button {
  display: inline-block;
  margin-top: 1.4em;
  padding: 0.6em 1.3em;
  border-radius: 0.5em;
  background: #f7c98f;
  color: #fff7ec;
  font-weight: 700;
  transition:
    background-color 0.6s,
    color 0.6s;
}

.page.fixed .site-button {
  background: #9a3412;
  color: #ffffff;
}

.site-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
  margin-top: 2em;
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding: 0.6em;
  border-radius: 0.6em;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(59 42 26 / 0.12);
}

.site-card b {
  height: 4.2em;
  border-radius: 0.4em;
  background: linear-gradient(135deg, #f3d9b1, #e3b77c);
}

.site-card:nth-child(2) b {
  background: linear-gradient(135deg, #e8d3c0, #c99a72);
}

.site-card:nth-child(3) b {
  background: linear-gradient(135deg, #f1e3c4, #d8c08f);
}

.site-card i {
  height: 0.5em;
  border-radius: 1em;
  background: var(--site-line);
}

.site-card i + i {
  width: 55%;
}

/* The widget */

.trigger {
  position: absolute;
  right: 1.4em;
  bottom: 1.4em;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.65em 1.1em;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0.4em 1.2em rgb(29 78 216 / 0.35);
  transition: transform 0.15s;
}

.trigger.pressed {
  transform: scale(0.94);
}

.trigger svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.panel {
  position: absolute;
  right: 1.4em;
  bottom: 4.8em;
  width: 17em;
  padding: 1em;
  border-radius: 0.8em;
  background: #ffffff;
  color: #18181b;
  box-shadow:
    0 1em 2.6em rgb(0 0 0 / 0.18),
    0 0.15em 0.5em rgb(0 0 0 / 0.08);
  opacity: 0;
  transform: translateY(0.8em) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.panel.open {
  opacity: 1;
  transform: none;
}

.panel-step {
  display: none;
  flex-direction: column;
  gap: 0.55em;
}

.panel[data-show='pick'] [data-step='pick'],
.panel[data-show='write'] [data-step='write'],
.panel[data-show='thanks'] [data-step='thanks'] {
  display: flex;
}

.panel-title {
  font-weight: 700;
  font-size: 1.05em;
}

.panel-hint {
  color: #52525b;
  font-size: 0.9em;
}

.shot {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.4em;
  border: 1px solid #e4e4e7;
  border-radius: 0.5em;
}

.shot-img {
  display: grid;
  place-items: center;
  width: 4.6em;
  height: 2.9em;
  border-radius: 0.3em;
  background: #fbf6ee;
  outline: 2px solid #1d4ed8;
  outline-offset: -2px;
}

.shot-button {
  padding: 0.2em 0.45em;
  border-radius: 0.25em;
  background: #f7c98f;
  color: #fff7ec;
  font-size: 0.6em;
  font-weight: 700;
}

.shot-label {
  font-size: 0.85em;
  font-weight: 600;
}

.shot-label b {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.2em;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.85em;
}

.field {
  min-height: 3.6em;
  padding: 0.5em 0.6em;
  border: 1px solid #8b8b94;
  border-radius: 0.4em;
  font-size: 0.9em;
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: #18181b;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.send {
  align-self: flex-end;
  padding: 0.45em 1em;
  border-radius: 0.4em;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.9em;
  font-weight: 700;
  transition: transform 0.15s;
}

.send.pressed {
  transform: scale(0.94);
}

.thanks {
  align-items: center;
  padding-block: 0.6em;
  text-align: center;
}

.check {
  display: grid;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: #f0fdf4;
}

.check svg {
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: #166534;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.panel[data-show='thanks'] .check svg {
  animation: draw 0.5s 0.15s ease-out forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* The element picker: an outline that follows the pointer, and a numbered pin. */
.pick {
  position: absolute;
  border: 2px solid #1d4ed8;
  border-radius: 0.4em;
  background: rgb(29 78 216 / 0.08);
  opacity: 0;
  pointer-events: none;
  transition:
    left 0.35s cubic-bezier(0.3, 0.7, 0.2, 1),
    top 0.35s cubic-bezier(0.3, 0.7, 0.2, 1),
    width 0.35s cubic-bezier(0.3, 0.7, 0.2, 1),
    height 0.35s cubic-bezier(0.3, 0.7, 0.2, 1),
    opacity 0.2s;
}

.pick.on {
  opacity: 1;
}

.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  margin: -0.95em 0 0 -0.95em;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9em;
  box-shadow: 0 0.3em 0.8em rgb(29 78 216 / 0.45);
  opacity: 0;
  transform: scale(0.2);
  transition:
    opacity 0.2s,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin.on {
  opacity: 1;
  transform: none;
}

/* The screenshot being taken. */
.flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.flash.on {
  animation: flash 0.45s ease-out;
}

@keyframes flash {
  from {
    opacity: 0.75;
  }
  to {
    opacity: 0;
  }
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.7em;
  height: 1.7em;
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.2, 1);
  filter: drop-shadow(0 0.1em 0.15em rgb(0 0 0 / 0.3));
}

.cursor svg {
  width: 100%;
  height: 100%;
  fill: #18181b;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.cursor.click svg {
  transform: scale(0.85);
  transform-origin: 20% 15%;
}

/* What the site owner sees: a new item in the dashboard. */
.toast {
  position: absolute;
  top: 3.5rem;
  left: -0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.35;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(0.75rem);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.toast.on {
  opacity: 1;
  transform: none;
}

.toast-dot {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.pause {
  flex: none;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pause:hover {
  border-color: var(--text-muted);
}

/* Features */

.features {
  padding-top: 5rem;
}

h2 {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background: var(--accent-subtle);
  color: var(--accent-text);
}

.icon svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h3 {
  margin: 1rem 0 0.375rem;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.975rem;
}

/* Install */

.install {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: center;
  margin-top: 5rem;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--bg-subtle);
}

.install p {
  margin: 1rem 0 0;
  color: var(--text-muted);
}

.code {
  margin: 0;
  padding: 1.25rem 1.5rem;
  /* Wraps instead of scrolling, so it needs no keyboard access on narrow screens. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-lg);
  background: #18181b;
  color: #e4e4e7;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
}

.code .t {
  color: #93c5fd;
}

.code .a {
  color: #c4b5fd;
}

.code .s {
  color: #86efac;
}

/* Small screens */

@media (max-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 2rem;
  }

  .install {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.5rem;
  }

  .toast {
    left: 0.5rem;
  }
}

@media (max-width: 30rem) {
  figcaption {
    flex-direction: column;
  }

  .toast {
    display: none;
  }
}

/* Paused by the visitor, or less motion wanted: everything stands still. */
:root[data-paused] .glow::before,
:root[data-paused] .dot::after,
:root[data-paused] .caret {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .glow::before,
  .dot::after,
  .caret {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .shine {
    background: none;
    color: CanvasText;
  }

  .glow {
    display: none;
  }
}
