/* Styles of the landing page (index.html and de/index.html). Colors follow
   the app's palette, internal/gui/theme/palette.go. */

:root {
  --primary: #2f6b8a;
  --primary-hover: #255a76;
  --text: #1c2a33;
  --text-muted: #4d5f6b;
  --bg: #ffffff;
  --bg-alt: #f4f7f9;
  --border: #d5dde3;
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Hero ── */
header {
  background: #1b1f23;
  color: #e3e9ed;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

header h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

header h1 span {
  color: #7fb3cf;
}

.app-name {
  font-size: 1rem;
  font-weight: 600;
  color: #a8b6c1;
  margin: -0.5rem 0 1rem;
}

.tagline {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: #a8b6c1;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: #e3e9ed;
  border: 1px solid #6b7a85;
}
.btn-outline:hover { background: #242a30; text-decoration: none; }

/* ── Sections ── */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.version-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.5rem;
  letter-spacing: 0.01em;
}
.version-badge:empty { display: none; }

.version-badge:hover { background: var(--primary-hover); text-decoration: none; }

/* ── Features ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Download ── */
#download {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#download .section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.download-intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
}

/* Platform picker without JS: one radio per platform (visually hidden,
   but focusable, so the arrow keys switch), labels as tabs, and the
   panel of the checked radio is shown. */
.dl > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* One row of tabs, never wrapped; if more platforms do not fit, the row
   scrolls sideways. Phones get a list instead, see the end of this part. */
.dl-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.dl-tabs label {
  flex: 1 1 0;
  min-width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.8rem 0.4rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}

.dl-tabs label:hover { border-color: var(--primary); }

.dl-tabs .tab-icon { font-size: 1.6rem; }


.dl-panel {
  display: none;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
  margin-bottom: 1.5rem;
}

#dl-macos:checked ~ .dl-tabs label[for="dl-macos"],
#dl-windows:checked ~ .dl-tabs label[for="dl-windows"],
#dl-linux:checked ~ .dl-tabs label[for="dl-linux"],
#dl-android:checked ~ .dl-tabs label[for="dl-android"],
#dl-docker:checked ~ .dl-tabs label[for="dl-docker"] {
  color: var(--primary);
  border-color: var(--primary);
  border-bottom-color: var(--primary);
  background: #eaf2f6;
}

#dl-macos:focus-visible ~ .dl-tabs label[for="dl-macos"],
#dl-windows:focus-visible ~ .dl-tabs label[for="dl-windows"],
#dl-linux:focus-visible ~ .dl-tabs label[for="dl-linux"],
#dl-android:focus-visible ~ .dl-tabs label[for="dl-android"],
#dl-docker:focus-visible ~ .dl-tabs label[for="dl-docker"] {
  outline: 3px solid rgba(47,107,138,0.4);
  outline-offset: 2px;
}

#dl-macos:checked ~ #panel-macos,
#dl-windows:checked ~ #panel-windows,
#dl-linux:checked ~ #panel-linux,
#dl-android:checked ~ #panel-android,
#dl-docker:checked ~ #panel-docker {
  display: block;
}

/* Phones: the platforms as a list of full-width buttons, the downloads of
   the chosen one right below its button. The tab row dissolves
   (display: contents) and order puts each panel after its label; the
   panel's heading would repeat the button. */
@media (max-width: 480px) {
  .dl { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
  .dl-tabs { display: contents; }
  .dl-tabs label {
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
  }
  .dl-tabs .tab-icon { font-size: 1.4rem; }
  .dl-tabs label::after {
    content: "\25BE";
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.15s;
  }
  .dl-panel { margin: -0.5rem 0 0; border-top: none; padding: 1rem 1.25rem 1.25rem; }
  .dl-panel h3 { display: none; }

  #dl-macos:checked ~ .dl-tabs label[for="dl-macos"],
  #dl-windows:checked ~ .dl-tabs label[for="dl-windows"],
  #dl-linux:checked ~ .dl-tabs label[for="dl-linux"],
  #dl-android:checked ~ .dl-tabs label[for="dl-android"],
  #dl-docker:checked ~ .dl-tabs label[for="dl-docker"] {
    border-radius: var(--radius) var(--radius) 0 0;
  }
  #dl-macos:checked ~ .dl-tabs label[for="dl-macos"]::after,
  #dl-windows:checked ~ .dl-tabs label[for="dl-windows"]::after,
  #dl-linux:checked ~ .dl-tabs label[for="dl-linux"]::after,
  #dl-android:checked ~ .dl-tabs label[for="dl-android"]::after,
  #dl-docker:checked ~ .dl-tabs label[for="dl-docker"]::after {
    transform: rotate(180deg);
    color: var(--primary);
  }

  .dl-tabs label[for="dl-macos"] { order: 1; }
  #panel-macos { order: 2; }
  .dl-tabs label[for="dl-windows"] { order: 3; }
  #panel-windows { order: 4; }
  .dl-tabs label[for="dl-linux"] { order: 5; }
  #panel-linux { order: 6; }
  .dl-tabs label[for="dl-android"] { order: 7; }
  #panel-android { order: 8; }
  .dl-tabs label[for="dl-docker"] { order: 9; }
  #panel-docker { order: 10; }
}

.dl-panel h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.dl-panel .panel-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
}

.dl-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.dl-btn {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
}

.dl-btn small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dl-btn:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.dl-btn:hover small { color: #e6f0f5; }

.dl-cli {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.dl-cli a { margin-left: 0.6rem; }

.dl-hint {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: #fff8e6;
  border: 1px solid #f0d58a;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text);
}

.dl-hint .hint-icon { font-size: 1.1rem; line-height: 1.4; }

.dl-hint p + p { margin-top: 0.4rem; }

.cli-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.releases-link {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── How it works ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 600px;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.step-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--primary); }

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* The web app, below the platform picker. */
.dl-web {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}

.dl-web-icon { font-size: 2rem; }

.dl-web-text { flex: 1 1 260px; }

.dl-web-text strong { display: block; font-size: 1.05rem; }

.dl-web-text span { color: var(--text-muted); font-size: 0.9rem; }

/* Language switch, top right of the header. */
header { position: relative; }

.lang-switch {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  display: flex;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.lang-switch a {
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  color: #dfe8ee;
}

.lang-switch a[aria-current="page"] {
  background: #fff;
  color: var(--text);
  border-color: #fff;
}

/* Sponsoring. */
.sponsor-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.sponsor-text {
  max-width: 640px;
  color: var(--text-muted);
}

.sponsor-text + .sponsor-text { margin-top: 0.75rem; }

/* A command to copy, in the Docker panel. */
.dl-cmd {
  margin: 0.25rem 0 0.75rem;
  padding: 0.75rem 1rem;
  background: #1e2a31;
  color: #e6f0f5;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
}

/* "untested" and similar marks on a download button. */
.dl-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #fff1cc;
  color: #7a5b00;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

/* Help & contact. */
.contact-text {
  max-width: 640px;
  color: var(--text-muted);
}

.contact-text + .contact-text { margin-top: 0.75rem; }

/* ── Downloads not public yet ──
   Until the repository and its releases are public, every download (and
   every link to GitHub) is a button that opens the popover #dl-pending,
   no JavaScript. The URL waits in data-link: turning a button back into
   <a href="..."> is one change. */
.dl-pending-note {
  display: flex;
  gap: 0.6rem;
  max-width: 640px;
  margin: -0.75rem 0 1.25rem;
  padding: 0.85rem 1rem;
  background: #fff8e6;
  border: 1px solid #f0d58a;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.dl-pending-note .hint-icon { font-size: 1.1rem; line-height: 1.4; }

/* The web app is what works today: above the platforms, and marked. */
.dl-web {
  border-width: 2px;
  box-shadow: 0 2px 10px rgba(47,107,138,0.12);
}

.dl-web-text .dl-now {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: #dcefe3;
  color: #1f6b3b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

button.btn, button.dl-btn, .dl-cli button, .link-btn {
  font: inherit;
  cursor: pointer;
}

button.btn { font-size: 0.95rem; font-weight: 600; }

button.dl-btn {
  position: relative;
  width: 100%;
  text-align: left;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px dashed #9fb2bf;
  font-weight: 600;
  padding-right: 2.2rem;
}

/* A lock instead of the download. */
button.dl-btn::after {
  content: "\1F512";
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  font-size: 0.85rem;
  opacity: 0.6;
}

button.dl-btn:hover {
  background: #eaf2f6;
  color: var(--text);
  border-color: var(--primary);
}

button.dl-btn:hover small { color: var(--text-muted); }

.dl-cli button, .link-btn {
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  color: var(--text-muted);
}

.dl-cli button { margin-left: 0.6rem; }

.dl-cli button::before {
  content: "\1F512";
  font-size: 0.7em;
  margin-right: 0.2rem;
  opacity: 0.6;
}

.dl-cli button:hover, .link-btn:hover { color: var(--primary); }

button:focus-visible {
  outline: 3px solid rgba(47,107,138,0.4);
  outline-offset: 2px;
}

.dl-pop {
  margin: auto;
  width: min(28rem, calc(100% - 2rem));
  padding: 1.5rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.dl-pop::backdrop { background: rgba(27,31,35,0.45); }

.dl-pop h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

.dl-pop p { color: var(--text-muted); margin-bottom: 0.75rem; }

.dl-pop .btn { margin-top: 0.25rem; border: 0; }
