/* The colours are the app's own (Theme.cs), so the page and the window look like one thing. */
:root {
  color-scheme: dark;
  --window: #1e1f24;
  --surface: #2c2d34;
  --surface-hover: #383942;
  --stroke: #3a3b44;
  --text: #f4f4f6;
  --dim: #a9abb4;
  --faint: #8a8c96;
  --accent: #8fa0ff;
  --accent-hover: #a4b2ff;
  --on-accent: #101222;
  --warning: #ffc16b;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* So the bar doesn't cover a section's heading when a link jumps to it. */
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--window);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

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

code,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

.wrap {
  width: min(1080px, 100% - 3rem);
  margin-inline: auto;
}

/* Header */

/* Stays at the top while the page scrolls. Nearly opaque, so the text under it never shows through. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(30, 31, 36, 0.94);
  border-bottom: 1px solid var(--stroke);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header {
    background: rgba(30, 31, 36, 0.92);
    backdrop-filter: blur(12px);
  }
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

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

.brand img {
  width: 32px;
  height: 32px;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a:hover {
  color: var(--text);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

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

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

.button-quiet {
  background: var(--surface);
  border-color: var(--stroke);
  color: var(--text);
}

.button-quiet:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: 3rem;
  align-items: center;
  padding-block: 3rem 5rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--dim);
  font-size: 1.25rem;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.meta {
  margin: 0 0 0.5rem;
  color: var(--dim);
  font-size: 0.95rem;
}

.fine {
  margin: 0;
  max-width: 34rem;
  color: var(--faint);
  font-size: 0.9rem;
  line-height: 1.55;
}

.hero-visual {
  position: relative;
  /* The countdown is 196px tall, so this leaves it overlapping only the window's footer strip, not its buttons. */
  padding-bottom: 9rem;
}

.hero-visual .window {
  width: min(100%, 400px);
}

.hero-visual .countdown {
  position: absolute;
  right: -1.5rem;
  bottom: 0;
  width: min(372px, 88%);
}

/* The app's windows. The title bar is drawn here, in the app's own dark title bar colour. */

.window,
.countdown {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--window);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding-inline: 0.7rem;
  color: var(--dim);
  font-size: 0.75rem;
}

.titlebar img {
  width: 16px;
  height: 16px;
}

/* Sections */

.section {
  padding-block: 4.5rem;
  border-top: 1px solid var(--stroke);
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.section-intro {
  max-width: 40rem;
  margin: 0 0 3rem;
  color: var(--dim);
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.feature + .feature {
  margin-top: 5rem;
}

.feature:nth-of-type(even) .visual {
  order: -1;
}

.feature .visual {
  display: flex;
  justify-content: center;
}

.feature .window {
  width: min(100%, 400px);
}

.feature .countdown {
  width: min(100%, 372px);
}

.feature p {
  max-width: 32rem;
  color: var(--dim);
}

.feature p strong,
.feature h3 {
  color: var(--text);
}

.feature h3 {
  font-size: 1.5rem;
  line-height: 1.25;
}

.amber {
  color: var(--warning);
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards li {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}

.cards p {
  margin: 0;
  color: var(--dim);
  font-size: 1rem;
}

/* Limits */

.limits {
  max-width: 44rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.limits li {
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--warning);
  color: var(--dim);
}

.limits strong {
  color: var(--text);
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--dim);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.steps strong {
  color: var(--text);
}

.steps li > strong:first-child {
  display: block;
  margin-bottom: 0.25rem;
}

.remove {
  max-width: 44rem;
  color: var(--dim);
}

/* Footer */

.site-footer {
  padding-block: 3rem 4rem;
  border-top: 1px solid var(--stroke);
  color: var(--faint);
  font-size: 0.9rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.site-footer p {
  max-width: 46rem;
  margin-bottom: 0.75rem;
}

/* Narrow screens */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding-block: 1.5rem 3.5rem;
  }

  .hero-visual {
    width: min(100%, 460px);
    margin-inline: auto;
  }

  .hero-visual .countdown {
    right: 0;
  }

  .feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .feature + .feature {
    margin-top: 4rem;
  }

  .feature:nth-of-type(even) .visual {
    order: 0;
  }

  .section {
    padding-block: 3.5rem;
  }
}

/* The logo and four links need about 630px, so below that the links go and the logo stays. */
@media (max-width: 640px) {
  .site-header nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .actions .button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
