:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6b7a;
  --line: #d9e1ea;
  --surface: #ffffff;
  --soft: #eef4f8;
  --accent: #0f766e;
  --accent-dark: #0b5e58;
  --amber: #f5b84b;
  --code: #101820;
  --body-bg: #f8faf9;
  --topbar-bg: rgba(248, 250, 249, 0.94);
  --hero-gradient-1: rgba(15, 118, 110, 0.12);
  --hero-gradient-2: rgba(245, 184, 75, 0.1);
  --terminal-border: rgba(16, 24, 32, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --surface: #1e293b;
  --soft: #0f172a;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --amber: #f5b84b;
  --code: #0b0f19;
  --body-bg: #0b1329;
  --topbar-bg: rgba(11, 19, 41, 0.92);
  --hero-gradient-1: rgba(20, 184, 166, 0.18);
  --hero-gradient-2: rgba(245, 184, 75, 0.08);
  --terminal-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--body-bg);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--ink);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100vh - 68px);
  padding: 72px 40px 48px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, var(--hero-gradient-1), var(--hero-gradient-2)),
    var(--body-bg);
}

.hero-copy,
.section {
  width: min(1180px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(52px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--accent);
}

.button.primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

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

.terminal {
  justify-self: stretch;
  min-width: 0;
  border: 1px solid var(--terminal-border);
  border-radius: 8px;
  background: var(--code);
  box-shadow: 0 24px 70px rgba(16, 24, 32, 0.2);
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #ff5f57;
}

.terminal-bar span:nth-child(2) {
  background: var(--amber);
}

.terminal-bar span:nth-child(3) {
  background: #28c840;
}

pre {
  margin: 0;
  overflow-x: auto;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.terminal pre {
  padding: 22px;
  color: #e7f2ef;
  font-size: 15px;
  line-height: 1.7;
}

.section {
  margin: 0 auto;
  padding: 72px 40px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.download-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.download-card code {
  display: block;
  margin-top: auto;
  padding: 12px;
  border-radius: 6px;
  color: #dce9e6;
  background: var(--code);
  font-size: 12px;
  white-space: normal;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 36px;
  border-top: 1px solid var(--line);
}

.split p,
.verify p {
  color: var(--muted);
  line-height: 1.6;
}

.commands {
  display: grid;
  gap: 14px;
}

.commands div,
.verify {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.commands div {
  padding: 20px;
}

.commands h3 {
  margin-bottom: 12px;
}

.commands pre,
.verify pre {
  padding: 16px;
  border-radius: 6px;
  color: #dce9e6;
  background: var(--code);
}

.verify {
  margin-bottom: 72px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer a {
  color: var(--accent-dark);
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 20px;
    gap: 16px;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }

  .hero,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }

  h1 {
    font-size: 52px;
  }

  .lead {
    font-size: 18px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  footer {
    flex-direction: column;
    padding: 24px 20px;
  }
}

/* Custom additions for download options */
.action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

@media (min-width: 641px) {
  .action-group {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .action-group {
    width: 100%;
  }
}

.action-subtext {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 641px) {
  .action-subtext {
    text-align: left;
  }
}

.action-subtext a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--accent);
}

.action-subtext a:hover {
  color: var(--accent-dark);
  border-bottom-style: solid;
}

.copy-cmd-inline {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
  position: relative;
}

.copy-cmd-inline:hover {
  background: var(--line);
  color: var(--ink);
}

.sub-link-container {
  margin-top: 4px;
  text-align: center;
  font-size: 13px;
}

.sub-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dotted var(--accent);
}

.sub-link:hover {
  color: var(--accent-dark);
  border-bottom-style: solid;
}

/* Tooltip style */
.copy-tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--ink);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  animation: fadeIn 0.15s ease-out;
}

.copy-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

.copyable-pre {
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease;
}

.copyable-pre:hover {
  border-color: var(--accent);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Header right-side actions & Dark mode toggle slider */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.github-link {
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.github-link:hover {
  color: var(--ink);
  transform: scale(1.08);
}

.github-link svg {
  width: 20px;
  height: 20px;
}

.theme-selector {
  position: relative;
  display: flex;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  align-items: center;
}

.theme-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 2;
  transition: color 0.2s ease;
  padding: 0;
}

.theme-btn svg {
  width: 15px;
  height: 15px;
}

.theme-btn:hover {
  color: var(--ink);
}

.theme-btn.active {
  color: var(--accent);
}

.theme-slider-bg {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  z-index: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.theme-selector:has([data-theme="light"].active) .theme-slider-bg {
  transform: translateX(0);
}
.theme-selector:has([data-theme="system"].active) .theme-slider-bg {
  transform: translateX(28px);
}
.theme-selector:has([data-theme="dark"].active) .theme-slider-bg {
  transform: translateX(56px);
}
