/* Colours match the app's (ui/src/app.css), so the site and the product look like one thing. Each is
   light-dark(light, dark), picked by color-scheme: the system's, unless the toggle chose one. */
:root {
  color-scheme: light dark;
  --background: light-dark(oklch(0.985 0.001 95), oklch(0.16 0.003 264));
  --foreground: light-dark(oklch(0.205 0.005 95), oklch(0.985 0.001 95));
  --muted-foreground: light-dark(oklch(0.55 0.005 95), oklch(0.72 0.005 95));
  --primary: light-dark(oklch(0.62 0.12 180), oklch(0.66 0.12 180));
  --border: light-dark(oklch(0.9 0.003 95), oklch(0.28 0.004 264));
  --code-bg: #0b0d10;
  --code-fg: #e6e6e6;
}

:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

/* The logo is an image, which light-dark() cannot swap, so it follows the same choice by hand. */
.logo-dark,
:root[data-theme='dark'] .logo-light {
  display: none;
}

:root[data-theme='dark'] .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-light {
    display: none;
  }

  :root:not([data-theme='light']) .logo-dark {
    display: block;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--primary);
}

.header,
main,
.footer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 24px;
}

.brand {
  display: inline-flex;
}

/* Both buttons stay hidden until the script has wired them up. */
.theme-toggle,
.copy {
  display: none;
}

.theme-toggle.ready {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--foreground);
  cursor: pointer;
}

/* The icon shows the theme a click switches to. */
.icon-sun,
:root[data-theme='dark'] .icon-moon {
  display: none;
}

:root[data-theme='dark'] .icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-moon {
    display: none;
  }

  :root:not([data-theme='light']) .icon-sun {
    display: block;
  }
}

main {
  flex: 1;
}

.hero {
  padding: 64px 0;
}

.hero h1 {
  max-width: 18ch;
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 56ch;
  margin: 0 0 40px;
  color: var(--muted-foreground);
  font-size: 1.125rem;
}

.install p {
  margin: 0 0 8px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.command {
  position: relative;
  margin: 0 0 24px;
}

.command .copy.ready {
  display: block;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 4px 10px;
  border: 1px solid #2a2e35;
  border-radius: 6px;
  background: #16191e;
  color: var(--code-fg);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.install pre {
  margin: 0;
  padding: 14px 96px 14px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 0.9375rem;
}

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

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.feature h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.feature p,
.steps p,
.runtimes dd {
  margin: 0;
  color: var(--muted-foreground);
}

.remote,
.steps,
.runtimes {
  padding-bottom: 64px;
}

.remote p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

.remote h2,
.steps h2,
.runtimes h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.steps ol {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 48px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--background);
  font-weight: 600;
}

.steps h3 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.runtimes dl {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 12px 32px;
  margin: 0;
}

.runtimes dt {
  font-weight: 600;
}

@media (max-width: 600px) {
  .runtimes dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .runtimes dd {
    margin-bottom: 12px;
  }
}

.page-intro {
  padding: 64px 0;
}

.footer {
  padding-bottom: 32px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* A rule the width of the content, not of the padded box around it. */
.footer::before {
  content: '';
  display: block;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0;
}
