@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #111;
  --panel-2: #292726;
  --panel-3: #34302c;
  --text: #f8f0df;
  --heading: #facc14;
  --muted: #c8bdad;
  --line: #393531;
  --line-strong: #514a43;
  --code: #161819;
  --code-inline: #ffdd85;
  --accent: #facc14;
  --link: #fd8041;
  --accent-soft: rgba(247, 214, 84, 0.12);
  --max: 1180px;

  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-docs-body: "Open Sans", sans-serif;
  --font-docs-heading: "Quicksand", sans-serif;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: var(--link);
}

pre {
  overflow: auto;
}

/* Inline code, everywhere except inside a code block. */
:not(pre) > code {
  padding: 0.14em 0.38em;
  border-radius: 4px;
  color: var(--code-inline);
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  color: var(--text);
  /* Add the yellow gradient at the top */
  background:
    radial-gradient(
      circle at 50% -120px,
      rgba(247, 214, 84, 0.13),
      transparent 360px
    ),
    var(--bg);
  line-height: 1.6;
}

main {
  flex: 1;
}

header.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  z-index: 20;
  background-color: var(--bg);

  .site-nav {
    display: flex;
    gap: 30px;
  }
  a {
    color: var(--text);
    &:hover {
      color: var(--accent);
    }
  }

  .brand {
    display: flex;
    align-items: center;
    min-width: 100px;
    margin: -10px;

    img {
      display: block;
      width: 100px;
      height: auto;
    }
  }

  .github-nav {
    font-weight: 700;
  }

  @media (max-width: 920px) {
    .github-nav {
      display: none;
    }
    .site-nav {
      gap: 20px;
    }
  }

  @media (max-width: 760px) {
    padding: 14px 18px;

    .site-nav {
      gap: 14px;
      font-size: 0.88rem;
    }
    .brand {
      min-width: 94px;
    }
    .brand img {
      width: 94px;
    }
  }

  /* Too narrow for logo + full nav: drop the logo first, keep the nav
     right-aligned where it already sat so it doesn't jump to the left. */
  @media (max-width: 520px) {
    justify-content: flex-end;
    .brand {
      display: none;
    }
  }

  /* Even narrower: shed the Install tab (no hamburger). */
  @media (max-width: 400px) {
    .nav-install {
      display: none;
    }
  }
}

section {
  width: min(100% - 48px, var(--max));
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  place-items: center;
  padding: 20px 0 68px;
  text-align: center;
  gap: 20px;
  max-width: 820px;

  .hero-img {
    width: min(300px, 58vw);
  }
  h1 {
    margin: 0;
    font-size: clamp(2.45rem, 5.2vw, 4.25rem);
    line-height: 1.04;
    span {
      display: block;
      color: var(--heading);
    }
  }
}

section.install-section {
  width: min(100% - 48px, 760px);
  margin: -6px auto 78px;
  scroll-margin-top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 45%), var(--panel);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);

  .install-option {
    width: 100%;
    margin: 0;
  }

  .install-method-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);

    button {
      padding: 7px 11px;
      border: 0;
      border-radius: 5px;
      color: var(--muted);
      background: transparent;
      cursor: pointer;
      font-family: var(--font-mono);
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.02em;

      &:hover,
      &:focus-visible {
        color: var(--text);
        background: rgba(255, 255, 255, 0.06);
      }
      &[aria-selected="true"] {
        color: #221b04;
        background: var(--accent);
      }
    }
  }

  .install-command-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
    margin-top: 12px;
  }

  .install-command-row[hidden],
  .install-option[hidden] {
    display: none;
  }

  .install-command {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--code);

    pre {
      margin: 0;
      padding: 13px 15px;
      color: var(--text);
      font-size: 0.78rem;
      line-height: 1.5;
    }
    pre code {
      white-space: pre;
    }
  }

  .copy-button {
    display: grid;
    min-width: 74px;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    background: transparent;
    cursor: pointer;
    text-transform: uppercase;

    &:hover,
    &:focus-visible,
    &.is-copied {
      border-color: var(--accent);
      color: var(--accent);
    }
  }

  .install-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    margin-top: 16px;
  }

  .install-options-link {
    color: var(--link);
    font-size: 0.88rem;
    font-weight: 650;
  }

  .arch-select {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    select {
      max-width: 220px;
      padding: 7px 30px 7px 10px;
      border: 1px solid var(--line-strong);
      border-radius: 6px;
      color: var(--text);
      background: var(--panel-2);
      font: inherit;
      letter-spacing: 0;
      text-transform: none;
    }
  }

  @media (max-width: 600px) {
    width: min(100% - 32px, 760px);
    margin-bottom: 56px;
    padding: 12px;

    .install-command-row {
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .copy-button {
      min-height: 36px;
    }
    .install-footer {
      align-items: flex-start;
      flex-direction: column-reverse;
    }
    .arch-select {
      width: 100%;
      justify-content: space-between;
    }
    .arch-select select {
      max-width: 70%;
    }
  }
}

section.concept-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2em;
  margin-bottom: 3em;

  h2 {
    font-family: var(--font-docs-heading);
  }

  @media (max-width: 1000px) {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

.code-window {
  overflow: hidden;
  border: 1px solid #42403b;
  border-radius: 9px;
  background: var(--code);

  pre {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
  }

  .window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 14px;
    color: #f3ead8;
    background: #3a3834;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 900;
    span {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      &:nth-child(1) {
        background: #ff7a6d;
      }
      &:nth-child(2) {
        background: #f7bf4f;
      }
      &:nth-child(3) {
        background: #61ca67;
      }
    }
    strong {
      margin-left: 16px;
    }
  }
}

section.details-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;

  > article:nth-child(3),
  > article:nth-child(4) {
    grid-column: 1 / -1;
  }

  article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    padding: 20px;

    h2 {
      padding: unset;
      margin: unset;
      color: var(--heading);
      font-family: var(--font-docs-heading);
    }
  }

  article.card-multiplatform {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;

    .platform-list {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: flex-end;
    }

    .platform-list span {
      display: grid;
      place-items: center;
      width: 96px;
      min-height: 78px;
      border: 1px solid var(--line-strong);
      border-radius: 7px;
      color: var(--text);
      background: var(--panel-3);
      font-family: var(--font-mono);
    }
  }

  @media (max-width: 760px) {
    grid-template-columns: 1fr;

    > article:nth-child(3),
    > article:nth-child(4) {
      grid-column: auto;
    }

    article.card-multiplatform {
      grid-template-columns: 1fr;

      .platform-list {
        justify-content: flex-start;
      }
    }
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 20px max(24px, calc((100vw - var(--max)) / 2));
  background: #1f1e1d;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;

  nav {
    display: flex;
    gap: 28px;
  }
}

.page-heading {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 48px);
  text-align: center;

  h1 {
    margin: 0.25rem 0 0.5rem;
    color: var(--heading);
    font-family: var(--font-docs-heading);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1;
  }

  > p:last-child {
    margin: 0;
    color: var(--muted);
  }

  @media (max-width: 760px) {
    padding-top: 46px;
    text-align: left;
  }
}

.funding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 330px));
  justify-content: center;
  gap: clamp(18px, 3vw, 32px);
  width: min(100% - 48px, 760px);
  margin: 4px auto 108px;

  @media (max-width: 760px) {
    grid-template-columns: minmax(0, 440px);
    width: min(100% - 40px, 440px);
    margin-bottom: 68px;
  }
}

.funding-card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;

  h2 {
    margin: 0 0 8px;
    color: var(--heading);
    font-family: var(--font-docs-heading);
    font-size: 1.5rem;
    line-height: 1.2;
  }
  p {
    margin: 0;
    color: var(--muted);
  }

  &::after {
    position: absolute;
    right: 22px;
    bottom: 18px;
    color: var(--link);
    content: "↗";
    font-size: 1.25rem;
  }

  &:hover,
  &:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
    transform: translateY(-5px);
  }
}
