/* PC Companion website. Colors come from the app icon. The page follows the system's light or dark
   mode, or the theme chosen with the switch in the header: each color is light-dark(light, dark),
   so choosing a theme only sets color-scheme. The checked radio button sets it; theme.js also sets
   data-theme on <html> from the remembered choice before the page is drawn, and keeps it in step. */

:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f8fc, #0f131a);
  --surface: light-dark(#ffffff, #171c25);
  --surface-alt: light-dark(#eef2fa, #131821);
  --text: light-dark(#141821, #e9edf4);
  --text-muted: light-dark(#4a5366, #a8b1c2);
  --border: light-dark(#dde3ee, #283041);
  --accent: light-dark(#2155dc, #8ab0ff);
  --accent-hover: light-dark(#1a46ba, #a9c4ff);
  --accent-soft: light-dark(#e3ebfd, #1c2741);
  --primary: #2155dc;
  --primary-hover: #1a46ba;
  --highlight: #fbbf24;
  --shadow: drop-shadow(0 2px 3px light-dark(rgb(20 24 33 / 0.10), rgb(0 0 0 / 0.40))) drop-shadow(0 18px 36px light-dark(rgb(20 24 33 / 0.18), rgb(0 0 0 / 0.55)));
  --radius: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

:root:has(#theme-light:checked),
:root[data-theme="light"] {
  color-scheme: light;
}

:root:has(#theme-dark:checked),
:root[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  overflow-wrap: break-word;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  text-align: center;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
}

.skip-link:focus {
  top: 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  min-height: 64px;
  padding-block: 8px;
}

.header-row .brand {
  margin-inline-end: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-small {
  font-size: 1rem;
}

.nav-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-block;
  padding-block: 8px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Theme switch: System, Light or Dark radio buttons, styled as one control. */

.theme-switch {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
}

.theme-switch label {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
}

.theme-switch label:hover {
  color: var(--text);
}

.theme-switch svg {
  width: 18px;
  height: 18px;
}

.theme-switch input:checked + label {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px light-dark(rgb(20 24 33 / 0.15), rgb(0 0 0 / 0.5));
}

.theme-switch input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Without :has(), the rules above that mention it are dropped, so the switch couldn't change anything;
   it's hidden and the system mode applies. */
@supports not selector(:has(*)) {
  .theme-switch {
    display: none;
  }
}

/* Hero */

.hero {
  padding-block: 64px 40px;
  background:
    radial-gradient(circle at 85% 10%, rgb(251 191 36 / 0.16), transparent 32%),
    radial-gradient(circle at 10% 0%, rgb(54 122 241 / 0.16), transparent 45%),
    var(--bg);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 0.5em;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead {
  max-width: 36em;
  color: var(--text-muted);
  font-size: 1.1875rem;
}

.fine-print {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 28px 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: #ffffff;
}

/* Screenshots fade into the page at their edges, so neither the window's outline nor the desktop
   shows, and a shadow raises them off it. The fade covers only the outer edge, inside the app's own
   margin, so the content stays sharp. The shadow is a filter on the wrapper, which follows the faded
   edges; a box-shadow would be cut off by the mask. The top screenshot is the whole window: it fades
   less, and its rounded corners, which show the desktop behind them, are clipped. */

.shot {
  display: block;
  margin: 0;
  filter: var(--shadow);
}

.shot img {
  --fade: 1.5%;
  display: block;
  width: 100%;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-composite: intersect;
}

.hero-shot img {
  --fade: 0.75%;
  border-radius: var(--radius);
}

/* Each screenshot has a light and a dark image. The hidden one is lazy and never comes into view, so
   it's never downloaded. */
.shot .shot-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .shot .shot-light {
    display: none;
  }

  .shot .shot-dark {
    display: block;
  }
}

:root:has(#theme-light:checked) .shot .shot-light,
:root[data-theme="light"] .shot .shot-light,
:root:has(#theme-dark:checked) .shot .shot-dark,
:root[data-theme="dark"] .shot .shot-dark {
  display: block;
}

:root:has(#theme-light:checked) .shot .shot-dark,
:root[data-theme="light"] .shot .shot-dark,
:root:has(#theme-dark:checked) .shot .shot-light,
:root[data-theme="dark"] .shot .shot-light {
  display: none;
}

/* Sections */

.section {
  padding-block: 72px;
}

.section-alt {
  border-block: 1px solid var(--border);
  background: var(--surface-alt);
}

.section-lead {
  max-width: 40em;
  margin-bottom: 40px;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.feature {
  display: grid;
  gap: 32px;
  align-items: center;
  padding-block: 32px;
}

.feature h3 {
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
}

.points {
  margin: 0;
  padding-inline-start: 1.25em;
}

.points li {
  margin-bottom: 0.5em;
}

.points li::marker {
  color: var(--accent);
}

.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.languages li {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1.125rem;
  font-weight: 600;
}

.languages span {
  align-self: flex-start;
}

.languages small {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  font-size: 1.125rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.steps h3 {
  font-size: 1.125rem;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

.callout {
  margin-bottom: 24px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--highlight);
  border-radius: var(--radius);
  background: var(--surface);
}

.callout p {
  margin: 0;
}

/* Footer */

.site-footer {
  padding-block: 32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-row {
  display: grid;
  gap: 16px;
}

.footer-row .fine-print {
  margin: 0;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 5fr 7fr;
  }

  /* Two equal columns, so a screenshot is the same size on either side; reverse rows swap them. */
  .feature {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "text shot";
    gap: 80px;
    padding-block: 56px;
  }

  .feature-reverse {
    grid-template-areas: "shot text";
  }

  .feature-text {
    grid-area: text;
  }

  .feature .shot {
    grid-area: shot;
  }

  .footer-row {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .footer-links {
    justify-content: flex-end;
  }

  .footer-row .fine-print {
    grid-column: 1 / -1;
  }
}

@media (max-width: 599px) {
  .wrap {
    padding-inline: 16px;
  }

  /* The theme switch stays beside the name, and the links get a row of their own. */
  .header-row nav {
    order: 1;
    width: 100%;
  }

  .hero {
    padding-block: 40px 24px;
  }

  .section {
    padding-block: 48px;
  }

  .actions .button {
    flex: 1 1 100%;
  }
}

@media (forced-colors: active) {
  .button-primary {
    border-color: ButtonText;
  }

  .theme-switch input:checked + label {
    outline: 2px solid Highlight;
  }
}
