/*
 * Patchwork site. Dark IDE graphite: surfaces come from one neutral ramp, chrome stays quiet,
 * and colour lives in the product views and the agent marks. All spacing on the 4px scale.
 */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  /* Graphite ramp */
  --bg: #131314;
  --panel: #19191b;
  --raised: #232325;
  --sunk: #101011;

  /* Text roles */
  --fg: #ededed;
  --fg-2: #a1a1a6;
  --fg-3: #85858b;

  /* Lines and depth */
  --line: rgba(237, 237, 237, 0.08);
  --line-strong: rgba(237, 237, 237, 0.14);

  /* Accent, from the app's blue; used for focus and the active row only */
  --accent: #7aa7ff;
  --accent-fill: #2e436e;

  --font-ui: "Inter Variable", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure,
ul,
pre {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  font-size: 14px;
  transition: top 140ms var(--ease);
}

.skip:focus-visible {
  top: 12px;
}

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

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-right: auto;
  font-size: 14px;
  color: var(--fg-2);
}

.nav-links a {
  transition: color 140ms var(--ease);
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle .i-close {
  display: none;
}

.nav.is-open .nav-toggle .i-close {
  display: block;
}

.nav.is-open .nav-toggle .i-menu {
  display: none;
}

/* ---------- Icons ---------- */

.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition:
    background-color 140ms var(--ease),
    border-color 140ms var(--ease),
    color 140ms var(--ease),
    transform 140ms var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

/* Lighter than the raised panels, so a button's edge shows against the page; the secondary a step
   darker than the primary. */
.btn-primary {
  background: #2c2c2f;
  color: var(--fg);
}

.btn-primary:hover {
  background: #343438;
}

.btn-secondary {
  background: #232326;
  color: var(--fg);
}

.btn-secondary:hover {
  background: #2b2b2e;
}

.btn-small {
  height: 34px;
  padding: 0 14px;
  font-size: 14px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 80px;
}

.hero-grid {
  display: grid;
  gap: 56px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--fg-3);
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.lede {
  margin-top: 20px;
  max-width: 36ch;
  font-size: 18px;
  line-height: 28px;
  color: var(--fg-2);
}

/* Both buttons take the wider one's width, whatever label the primary gets for the visitor's system. */
.hero-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: max-content;
  max-width: 100%;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Product shot ---------- */

.hero-shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

/* ---------- Sections ---------- */

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 60px;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 48px;
}

.section h2 {
  margin-top: 16px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-lede {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 16px;
  line-height: 26px;
  color: var(--fg-2);
}

.note {
  margin-top: 24px;
  max-width: 60ch;
  font-size: 14px;
  line-height: 22px;
  color: var(--fg-3);
}

/* Screenshots */

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
}

.shot {
  display: flex;
  flex-direction: column;
}

.shot:nth-child(1),
.shot:nth-child(4) {
  grid-column: 1 / -1;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.shot figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--fg-3);
}

.shot figcaption .mono {
  font-size: 11px;
  color: var(--fg-3);
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 48px;
}

.features h3 {
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.features p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 24px;
  color: var(--fg-2);
}

.features code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--raised);
  font-size: 13px;
  color: var(--fg);
}

/* Agents */

.agents {
  border-top: 1px solid var(--line);
}

.agents li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.agent-logo {
  width: 20px;
  height: 20px;
  color: var(--fg-2);
}

.agent-name {
  font-size: 15px;
  font-weight: 500;
}

.agent-vendor {
  font-size: 13px;
  color: var(--fg-3);
}

.agents code {
  justify-self: end;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  font-size: 12px;
  color: var(--fg-2);
}

/* Download */

.downloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.dl {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.dl h3 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dl-file {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
  color: var(--fg-2);
  word-break: break-word;
}

.dl-note {
  margin-top: 12px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 20px;
  color: var(--fg-3);
}

.dl pre {
  margin: 0 0 20px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sunk);
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 18px;
  color: var(--fg-2);
}

.dl .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Cards hold different amounts of copy, so the buttons line up on a shared bottom edge. */
.dl-note,
.dl pre {
  flex: none;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.footer-brand .brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.footer-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-visual {
    animation: rise 420ms var(--ease) both;
  }

  .hero-visual {
    animation-delay: 60ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 1000px) {
  .hero-grid {
    gap: 48px;
  }

  .hero {
    padding: 56px 0 72px;
  }

  .hero h1 {
    max-width: 20ch;
  }

  .lede {
    max-width: 46ch;
  }

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

  .dl .btn {
    align-self: stretch;
  }
}

@media (max-width: 860px) {
  .wrap {
    padding: 0 20px;
  }

  .nav-inner {
    gap: 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
  }

  .nav.is-open .nav-links {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 60px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open .nav-links a {
    padding: 12px 0;
    font-size: 15px;
    color: var(--fg);
  }

  .nav-actions {
    margin-left: auto;
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    margin-bottom: 32px;
  }

  .shots,
  .features {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .features {
    gap: 32px;
  }

  .shot:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .hero-actions {
    grid-auto-flow: row;
    width: auto;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .agents li {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    row-gap: 2px;
  }

  .agent-vendor {
    display: none;
  }
}
