:root {
  --page: #0f1430;
  --page-end: #1d1238;
  --card: rgba(255, 255, 255, 0.05);
  --card-hover: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-hover: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-muted: #c8cbe0;
  --accent: #60cdff;
  --accent-hover: #8adbff;
  --on-accent: #001a33;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Moving between this page and the privacy policy: the header stays put while the page
     under it fades out and the new one rises in. Browsers without this change pages as usual. */
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  ::view-transition-old(root) { animation: page-out 0.18s ease-in both; }
  ::view-transition-new(root) { animation: page-in 0.42s var(--ease) both; }

  /* The opening of each page rises in, one piece after another. */
  .hero > *, .document > * { animation: rise 0.6s var(--ease) both; }
  .hero > :nth-child(2), .document > :nth-child(2) { animation-delay: 0.08s; }
  .hero > :nth-child(3), .document > :nth-child(3) { animation-delay: 0.16s; }
  .document > :nth-child(n+4) { animation-delay: 0.24s; }

  /* Sections further down rise in as they scroll into view. site.js adds .motion to the page
     first, so without it nothing is ever hidden. */
  .motion main > section:not(.hero) {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }

  .motion main > section.shown { opacity: 1; transform: none; }

  /* A section reached from the menu flashes its heading, to show where the page landed. */
  section.arrived h2 { animation: arrived 1.2s var(--ease); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes page-out { to { opacity: 0; } }

@keyframes page-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes arrived {
  0% { color: var(--text); }
  25% { color: var(--accent); transform: translateX(6px); }
  100% { color: var(--text); transform: none; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(180deg, var(--page), var(--page-end)) fixed;
}

a { color: var(--accent); transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

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

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100% - 1040px) / 2));
  background: rgba(15, 20, 48, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.brand img { transition: transform 0.4s var(--ease); }
.brand:hover { color: var(--text); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }

nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }

nav a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
}

/* An underline that grows from the middle on hover. */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

nav a:hover, nav a.current { color: var(--text); }
nav a:hover::after, nav a.current::after { transform: scaleX(1); }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
section { padding: 48px 0 8px; scroll-margin-top: 56px; }

.hero { text-align: center; padding-top: 64px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.25; margin: 0 0 16px; }
.hero p { max-width: 640px; margin: 0 auto 16px; color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
}

.shot {
  display: block;
  width: 100%;
  margin: 32px auto 0;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.shot.small { margin-top: 16px; }

h2 { font-size: 28px; margin: 0 0 20px; }
h3 { font-size: 18px; margin: 0 0 8px; }

/* The demo of adding an app. Its frame keeps the window's own shape at any width. */
.tour { padding-top: 32px; }
.tour h2 { text-align: center; }

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  aspect-ratio: 1344 / 850;
  background: #1c2029;
}

.demo-frame { display: block; width: 100%; height: 100%; border: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.steps article, .guide article, details {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--card);
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}

.steps article:hover, .guide article:hover, details:hover {
  border-color: var(--stroke-hover);
  background: var(--card-hover);
}

.steps article:hover { transform: translateY(-3px); }

.steps p, .guide p, details p { margin: 0; color: var(--text-muted); }

.number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  transition: transform 0.3s var(--ease);
}

.steps article:hover .number { transform: scale(1.12); }

.guide { display: grid; gap: 16px; }
.guide ul { margin: 12px 0 0; padding-left: 20px; color: var(--text-muted); }

.questions { display: grid; gap: 8px; }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker { display: none; }

/* A chevron that turns over when the question opens. It is drawn centered in its box, so it
   turns in place instead of wobbling around a corner. */
summary::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 5.75l4.5 4.5 4.5-4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 5.75l4.5 4.5 4.5-4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform 0.3s var(--ease), background 0.2s;
  will-change: transform;
}

summary { transition: color 0.2s; }
summary:hover { color: var(--accent); }
summary:hover::after { background: var(--accent); }
details.opening summary::after { transform: rotate(180deg); }

/* site.js slides the answer open and closed. */
.answer { overflow: hidden; }
.answer > p { padding-top: 8px; }

.feedback p, .sponsor p { color: var(--text-muted); }

/* Sponsor buttons with an icon. ".button" sets inline-block, so these need the extra class to
   win and line the icon up with the text. */
.button.icon-button { display: inline-flex; align-items: center; gap: 10px; }
.icon-button svg { flex: none; width: 18px; height: 18px; }

/* GitHub's pink heart, which beats on hover. */
.heart { fill: #db61a2; }
.sponsor-button:hover { border-color: rgba(219, 97, 162, 0.6); }
.sponsor-button:hover .heart { animation: heartbeat 0.9s ease-in-out infinite; }

/* A Ko-fi style cup whose steam rises on hover. */
.cup { fill: #ff5e5b; stroke: #ff5e5b; stroke-width: 1.6; stroke-linecap: round; }
.cup .cup-handle, .cup .steam { fill: none; }
.cup .cup-heart { fill: #fff; stroke: none; }
.cup .steam { opacity: 0.5; }
.kofi-button:hover { border-color: rgba(255, 94, 91, 0.6); }
.kofi-button:hover .steam { animation: steam 1.2s ease-in-out infinite; }

@keyframes steam {
  0% { opacity: 0; transform: translateY(2px); }
  50% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-2px); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.18); }
}
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease), box-shadow 0.2s;
}

.button:hover { color: var(--text); background: var(--card-hover); border-color: var(--stroke-hover); transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(0.97); }
.button.primary { color: var(--on-accent); background: var(--accent); border-color: transparent; }

.button.primary:hover {
  color: var(--on-accent);
  background: var(--accent-hover);
  box-shadow: 0 8px 24px rgba(96, 205, 255, 0.35);
}

.document { max-width: 760px; padding-top: 48px; }
.document h2 { font-size: 20px; margin: 32px 0 8px; }
.muted { color: var(--text-muted); }

.bottom {
  margin-top: 32px;
  padding: 32px max(16px, calc((100% - 1040px) / 2)) 28px;
  color: var(--text-muted);
  border-top: 1px solid var(--stroke);
  background: rgba(8, 10, 28, 0.35);
}

.bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
}

.bottom-brand p { margin: 6px 0 0; font-size: 14px; }
.bottom-links { gap: 8px 24px; font-size: 15px; }

.copyright {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  font-size: 13px;
}

@media (max-width: 560px) {
  .bottom-row { flex-direction: column; }
}

/* A slim scrollbar in the page's own colors: the standard properties, then the WebKit ones
   for Safari and older Chromium. */
html { scrollbar-width: thin; scrollbar-color: rgba(96, 205, 255, 0.45) var(--page); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--page); }

::-webkit-scrollbar-thumb {
  border: 3px solid var(--page);
  border-radius: 999px;
  background: rgba(96, 205, 255, 0.4);
}

::-webkit-scrollbar-thumb:hover { background: rgba(96, 205, 255, 0.7); }

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