/* Ruedi website — colors taken from the app icon (assets/appicon in the Ruedi repo). */

:root {
  --bg: #f4f7f6;
  --bg-soft: #eaf0ee;
  --surface: #ffffff;
  --border: #dde4e2;
  --text: #0f1a17;
  --muted: #5a6b66;
  --accent: #0e9f55;        /* the "R" on the light icon */
  --accent-strong: #0c8a4a; /* keycap base */
  --accent-soft: rgba(14, 159, 85, 0.1);
  --on-accent: #ffffff;
  --key-face: #fbfcfc;
  --key-edge: #c9d2d0;
  --shadow: 0 1px 2px rgba(15, 26, 23, 0.04), 0 8px 24px rgba(15, 26, 23, 0.06);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1615;
    --bg-soft: #131b1a;
    --surface: #18201f;
    --border: #26302e;
    --text: #e8f0ee;
    --muted: #94a3a0;
    --accent: #26ff8d;        /* the "R" on the dark icon */
    --accent-strong: #1dce72;
    --accent-soft: rgba(38, 255, 141, 0.09);
    --on-accent: #06210f;
    --key-face: #1f2626;
    --key-edge: #101716;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--bg); }

/* Set by the inline script in <head> until i18n.js has translated the page: no English flash. */
html.i18n-pending body { visibility: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

code {
  font-family: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}

/* Keycaps, styled after the icon: a light face on a green base. */
kbd {
  display: inline-block;
  min-width: 1.75em;
  padding: 0.12em 0.45em 0.08em;
  font-family: inherit;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--text);
  background: var(--key-face);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 2px 0 var(--accent-strong);
  vertical-align: baseline;
  white-space: nowrap;
}

/* A shortcut like Ctrl+K never breaks across lines. */
.keys { white-space: nowrap; }
.plus { color: var(--muted); margin: 0 0.2em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.accent { color: var(--accent); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand { flex: none; }
/* Phones: no room for the section links next to the language switch; the page is a short scroll anyway. */
@media (max-width: 520px) {
  .nav-links > a[href^="#"] { display: none; }
}
.brand img { width: 32px; height: 32px; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-gh { display: flex; }

/* Language switcher: two small keys, the active one pressed in green. */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.lang-switch button {
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.4;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  cursor: default;
}

/* Hero */
.hero { text-align: center; padding-top: 96px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 750; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 760px; text-wrap: balance; margin: 20px auto 0; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.fineprint { color: var(--muted); font-size: 0.88rem; margin: 18px 0 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 6px;
  max-width: 100%;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.12s, background 0.2s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 3px 0 var(--accent-strong);
}
.btn-primary:not(.is-disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--accent-strong); }
.btn-primary:not(.is-disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-strong); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 3px 0 var(--border);
}
.btn-secondary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--border); }
.btn-secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.btn.is-disabled { cursor: default; opacity: 0.85; }
.btn-label, .badge { white-space: nowrap; }
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-accent) 18%, transparent);
}

/* Media placeholders */
.media { margin: 0; }
.media-hero { margin-top: 8px; }
.media-placeholder,
.media img,
.media video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  background:
    radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--border) 45%, transparent) 14px 15px),
    var(--surface);
}
.media-hero .media-placeholder { aspect-ratio: 16 / 9; }
/* Screenshots are 2x captures (srcset "2x"), shown at their real on-screen size, anchored top left;
   the frame crops the rest. */
.gallery .media img {
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: none;
  /* Shifted up and left a little to hide the window border captured in the screenshots. */
  object-position: -3px -3px;
  background: var(--surface);
  transition: transform 0.15s, border-color 0.15s;
}
.gallery .media a { display: block; border-radius: var(--radius); }
.gallery .media a:hover img { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.media figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 12px; text-align: center; }

/* Sections */
.section { padding-top: 96px; }
.section > h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); text-align: center; font-weight: 700; }
.section-lead { color: var(--muted); text-align: center; margin: 14px auto 0; max-width: 620px; }

/* Feature grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card h3 { font-size: 1.08rem; font-weight: 650; margin-top: 14px; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.75; }
.card-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg,
.copy svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 44px;
}

/* ueli story */
.reasons {
  list-style: none;
  padding: 0;
  margin: 44px auto 0;
  max-width: 720px;
  display: grid;
  gap: 12px;
}
.reasons li {
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
}
.reasons li strong { color: var(--text); font-weight: 650; }
.subhead { text-align: center; font-size: 1.3rem; margin-top: 56px; }
.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.platform {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.platform h4 { margin: 0; font-size: 1.02rem; }
.platform-head { display: flex; align-items: center; gap: 12px; }
.platform p { margin-top: 12px; }
/* Brand marks are solid shapes, not outlines like the feature icons. */
.platform-icon { width: 36px; height: 36px; border-radius: 10px; }
.platform-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.platform p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }
.signoff { text-align: center; color: var(--muted); font-style: italic; margin: 28px 0 0; }

/* Screenshot viewer */
/* While it's open, the page behind it doesn't scroll. The gutter keeps the layout from
   shifting when the scrollbar goes away. */
html { scrollbar-gutter: stable; }
html:has(.viewer[open]) { overflow: hidden; }
.viewer {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.viewer[open] { display: flex; animation: viewer-in 0.18s ease-out; }
.viewer::backdrop {
  background: rgba(5, 9, 8, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.viewer-img {
  max-width: min(92vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  /* Trim the window border captured in the screenshots, as in the gallery. */
  clip-path: inset(2px round 10px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.viewer-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.viewer-close:hover { background: rgba(255, 255, 255, 0.16); }
@keyframes viewer-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: none; }
}
.gallery .media a { cursor: zoom-in; }

/* Privacy callout */
.callout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.callout h3 { font-size: 1.15rem; }
.callout p { margin: 6px 0 0; color: var(--muted); }
.callout p + p { margin-top: 10px; }
.callouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.callout-ai {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background:
    radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
}

/* Install */
.install {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 44px;
}
/* Side by side on wide screens; the winget card gets more room so the command fits on one line. */
@media (min-width: 1000px) {
  .install { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
.install-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  min-width: 0;
}
.install-option > div { min-width: 0; }
.install-option h3 { font-size: 1.25rem; }
.install-option p { margin: 10px 0 24px; color: var(--muted); }
.install-option p.small { margin: 18px 0 0; }
.nowrap { white-space: nowrap; }
.code {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
}
.code code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  background: none;
  border: 0;
  padding: 8px 0;
  font-size: 0.9rem;
}
.copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.copy svg { width: 17px; height: 17px; grid-area: 1 / 1; }
.copy .copy-done-icon { stroke-width: 2.2; opacity: 0; }
.copy.is-copied .copy-icon { opacity: 0; }
.copy.is-copied .copy-done-icon { opacity: 1; }
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.is-copied { color: var(--accent); border-color: var(--accent); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.after-install { text-align: center; color: var(--muted); margin: 32px 0 0; font-size: 1.05rem; }

/* Footer */
.footer { margin-top: 112px; border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

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

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-links { gap: 16px; }
  .hero { padding-top: 56px; }
  .section { padding-top: 72px; }
  .callout, .install-option { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
