@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

.landing {
  --display-font: "Space Grotesk", system-ui, sans-serif;
  --panel-radius: 22px;
  --action: var(--text);
  --action-text: var(--bg);
}

.landing :is(h1, h2, h3, .brand) { font-family: var(--display-font); }

.landing-header, .hero-band, .closing {
  --text: var(--hero-text);
  --muted: var(--hero-muted);
  --surface: rgb(255 255 255 / 7%);
  --surface-2: rgb(255 255 255 / 13%);
  --line: rgb(159 176 199 / 24%);
  --code-bg: rgb(255 255 255 / 13%);
  --blue: #65d7ff;
  --action: #a9e6ff;
  --action-text: #071c2b;
  color: var(--text);
}

.hero-band {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(38px, 6vw, 84px);
  background:
    radial-gradient(ellipse at 77% 10%, rgb(46 134 250 / 22%), transparent 56%),
    radial-gradient(ellipse at 12% 34%, rgb(11 184 158 / 18%), transparent 47%),
    var(--hero-bg);
}

.hero-band::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(159 176 199 / 9%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(159 176 199 / 9%) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(transparent, #000 19%, transparent 66%);
  pointer-events: none;
}

.landing .wrap, .landing .site-footer {
  max-width: 1320px;
  padding-inline: clamp(20px, 4vw, 60px);
}

.skip-link {
  position: fixed;
  z-index: 20;
  inset: 12px auto auto 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transform: translateY(calc(-100% - 14px));
}
.skip-link:focus { transform: none; }

.landing-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--hero-bg);
  background: color-mix(in srgb, var(--hero-bg) 88%, transparent);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.landing-header .site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: 68px;
  max-width: 1320px;
  gap: 24px;
  padding: 8px clamp(20px, 4vw, 60px);
}

.landing-header .brand { justify-self: start; font-size: 1.12rem; }
.landing-header .brand img { width: 30px; height: 30px; }
.landing-header .site-header > nav:first-of-type {
  justify-content: center;
  gap: 4px;
  margin: 0;
}
.landing-header .site-header > nav:first-of-type a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.landing-header .site-header nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.header-tools { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.landing-header .language-switch { border: 0; padding: 0; font-size: 0.8rem; gap: 4px; }
.landing-header .language-switch a { display: grid; place-items: center; min-height: 44px; font-size: inherit; border-radius: 8px; padding: 0 8px; }
.landing-header .language-switch span { color: var(--text); }
.header-download {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 650;
}
.header-download:hover { border-color: var(--blue); text-decoration: none; }

.hero {
  margin-inline: auto;
  padding-block: clamp(36px, 5.3vw, 68px) clamp(26px, 3.7vw, 47px);
  text-align: center;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6.05vw, 5.4rem);
  font-weight: 650;
  letter-spacing: -0.016em;
  line-height: 1.02;
  text-wrap: balance;
}
.hero h1 em { color: #9fe4f8; font-style: normal; }
.hero .lede {
  max-width: 55ch;
  margin: 18px auto 24px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.48;
  text-wrap: pretty;
}
.hero-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; }

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}
.action svg { width: 17px; height: 17px; }
.action:hover { text-decoration: none; }
.primary-action { color: var(--action-text); background: var(--action); }
.primary-action:hover { background: color-mix(in srgb, var(--action) 87%, var(--bg)); }

.requirements { margin: 0; color: var(--muted); font-size: 0.83rem; }
.hero-note { margin: 10px auto 0; max-width: 65ch; font-size: 0.75rem; color: var(--muted); }

.product-demo, .landing-section, #languages-title, #main-content, #menu-bar, #download { scroll-margin-top: 88px; }
.title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4.3vw, 3.55rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.016em;
  text-wrap: balance;
}

.product-demo {
  padding: clamp(7px, 1.2vw, 14px);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: 0 30px 95px rgb(0 0 0 / 36%);
}
.demo-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 0 0 10px 10px;
}
.demo-heading .title { margin: 0; font-size: 1.08rem; font-weight: 650; }
.demo-controls, .demo-actions, .chapters { display: flex; align-items: center; }
.demo-controls { gap: 12px; }
.demo-actions { gap: 5px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.chapters { gap: 3px; flex-wrap: wrap; padding: 3px; background: rgb(6 12 22 / 32%); border-radius: 12px; }
.demo-controls[hidden] { display: none; }
.chapters button {
  min-height: 44px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.chapters button:hover { color: var(--text); background: var(--surface-2); }
.chapters button[aria-pressed="true"] {
  color: var(--text);
  background: rgb(46 158 199 / 23%);
  border-color: rgb(101 215 255 / 50%);
}
.demo-play, .demo-zoom {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
}
.demo-actions .demo-zoom {
  position: relative;
  color: var(--text);
}
.demo-zoom:hover { background: var(--surface-2); }
.demo-zoom::before {
  content: "";
  width: 12px;
  height: 12px;
  margin: 0 4px 4px 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.demo-zoom::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 1.5px;
  transform: translate(6px, 6px) rotate(45deg);
  background: currentColor;
}
.demo-play {
  border: 1px solid rgb(101 215 255 / 60%);
  color: var(--blue);
  background: rgb(46 158 199 / 17%);
  cursor: pointer;
}
.demo-play:hover { background: rgb(46 158 199 / 32%); }
.demo-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-block: 7px solid transparent;
  border-left: 11px solid currentColor;
}
.demo-play[data-playing="true"]::before {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-inline: 4px solid currentColor;
  box-sizing: border-box;
}
.landing :is(a,button):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.demo-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(8px, 3vw, 42px);
  align-items: start;
  padding: clamp(16px, 2vw, 26px) clamp(8px, 1.4vw, 16px) 8px;
}
.demo-detail[hidden] { display: none; }

.shot-stage {
  position: relative;
  aspect-ratio: 1920 / 1140;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--hero-bg);
}
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity 0.28s ease; }
.shot.on { opacity: 1; }
.shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.demo-click {
  position: absolute;
  z-index: 1;
  width: clamp(15px, 3%, 28px);
  aspect-ratio: 1;
  opacity: 0;
  border: 2px solid #65d7ff;
  box-shadow: 0 0 0 1px #006c94, inset 0 0 0 1px #006c94;
  border-radius: 50%;
  pointer-events: none;
}

.landing-section {
  padding-block: clamp(44px, 6.4vw, 86px);
  border-bottom: 1px solid var(--line);
}
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: end;
  gap: 14px 32px;
  margin-bottom: clamp(22px, 3vw, 36px);
}
.section-heading .title, .section-heading .sub { margin: 0; }
.section-heading .title { text-wrap: pretty; }
.sub { max-width: 58ch; margin: 0 0 24px; color: var(--muted); font-size: 1.04rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 22px);
}
.feature-card {
  display: grid;
  min-width: 0;
  gap: clamp(18px, 2.3vw, 30px);
  padding: clamp(18px, 2.8vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}
.pull-requests-card, .security-card { grid-column: 1 / -1; }
.pull-requests-card {
  background: linear-gradient(145deg, color-mix(in srgb, var(--blue) 7%, var(--surface)), var(--surface) 60%);
}
.pull-requests-card .feature-copy, .security-card {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
}
.pull-requests-card .feature-copy { display: grid; gap: 12px 30px; }
.security-card { gap: clamp(20px, 4vw, 54px); }
.feature-copy h3, .demo-detail h3 {
  margin: 0 0 7px;
  font-size: clamp(1.35rem, 2.5vw, 1.93rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.012em;
}
:is(.feature-copy, .demo-detail) :is(p, ul) { color: var(--muted); font-size: 0.925rem; }
:is(.feature-copy, .demo-detail) p { margin: 0; }
.feature-copy > p + ul, .security-card .feature-copy ul { margin-top: 12px; }
:is(.feature-copy, .demo-detail) ul { margin-bottom: 0; padding-inline-start: 18px; }
:is(.feature-copy, .demo-detail) li + li { margin-top: 4px; }
:is(.feature-copy, .demo-detail) li::marker { color: var(--blue); }
.pull-requests-card .feature-copy ul, .demo-detail ul { margin-top: 0; }

:where(.screenshot-link) {
  display: block;
  min-width: 0;
  color: var(--muted);
  cursor: zoom-in;
}
.screenshot-link:hover { color: var(--blue); text-decoration: none; }
.feature-image {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 11px 28px rgb(8 24 42 / 12%);
}
.feature-image img { display: block; width: 100%; height: auto; }
.screenshot-link:is(:hover, :focus-visible) .feature-image { border-color: var(--blue); }

.menu-bar-card {
  grid-column: span 5;
  grid-template-rows: auto 1fr;
  background: radial-gradient(ellipse at 50% 86%, color-mix(in srgb, var(--blue) 13%, var(--surface)), var(--surface) 75%);
}
.menu-bar-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.menu-bar-heading img { flex: none; width: 24px; height: 24px; }
.menu-bar-heading h3 { margin: 0; }
.menu-bar-visual { display: grid; align-items: end; justify-items: center; }
.menu-bar-image { width: min(100%, 258px); }

.quick-open-card {
  grid-column: span 7;
  grid-template-rows: auto auto 1fr;
  background: radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--blue) 12%, var(--surface)), var(--surface) 72%);
}
.quick-open-image { width: min(100%, 520px); justify-self: center; }
.feature-copy kbd {
  display: inline-grid;
  min-width: 1.65em;
  min-height: 1.65em;
  place-items: center;
  margin-inline-end: 3px;
  padding-inline: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: 0.82em/1 system-ui, sans-serif;
}

.screenshot-preview {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--hero-text);
  background: transparent;
}
.screenshot-preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.screenshot-preview::backdrop { background: rgb(7 12 22 / 90%); }
.screenshot-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px clamp(12px, 3vw, 36px) 0;
}
.screenshot-preview-toolbar button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 10px;
  font: 600 0.88rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.screenshot-preview-toolbar .screenshot-close { font-size: 1.45rem; font-weight: 400; }
.screenshot-preview-toolbar button:hover { background: rgb(255 255 255 / 14%); }
.screenshot-preview-toolbar button[aria-pressed="true"] { color: #65d7ff; border-color: #65d7ff; }
.screenshot-preview-content {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 12px clamp(12px, 3vw, 36px) 24px;
}
.screenshot-preview-content:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.screenshot-preview-content img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.screenshot-preview[data-actual-size] .screenshot-preview-content { display: block; overflow: auto; }
.screenshot-preview[data-actual-size] img { max-width: none; max-height: none; margin-inline: auto; }
html:has(.screenshot-preview[open]) { overflow: hidden; }

.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}
.integration-group {
  padding: clamp(16px, 2.25vw, 30px);
}
.integration-group + .integration-group { border-inline-start: 1px solid var(--line); }
.integration-group h3 {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 650;
}
.integration-group ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.integration-group li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 3px 12px;
  padding: 12px 0;
}
.integration-group li + li { border-top: 1px solid var(--line); }
.integration-group li:last-child { padding-bottom: 0; }
.integration-group h4 { margin: 0; font-size: 1.05rem; }
.integration-group p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}
.integration-logo {
  grid-row: span 2;
  box-sizing: content-box;
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
.supported-languages { margin-top: clamp(28px, 4.6vw, 52px); }
.supported-languages h3 { margin: 0 0 6px; font-size: clamp(1.3rem, 2.15vw, 1.6rem); letter-spacing: -0.01em; }
.supported-languages .sub { margin-bottom: 18px; font-size: 0.96rem; }
.language-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px 12px;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.language-list li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.language-list img { display: block; object-fit: contain; }
.language-list small { margin-top: -3px; color: var(--muted); font-weight: 400; line-height: 1.3; }

.detail-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.22fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
}
.detail-section > .screenshot-link {
  padding: clamp(10px, 1.7vw, 25px);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
}
.detail-section .sub { margin-bottom: 0; }
.section-link { margin: 20px 0 0; font-size: 0.95rem; font-weight: 600; }
.everywhere, .promises {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  align-content: start;
}
.everywhere { align-self: end; }
:is(.everywhere, .promises) > div { padding: 14px 0 18px; border-top: 1px solid var(--line); }
:is(.everywhere, .promises) b { display: block; margin-bottom: 4px; font-size: 0.96rem; }
:is(.everywhere, .promises) span { display: block; color: var(--muted); font-size: 0.9rem; }

.closing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: clamp(30px, 5vw, 64px) 0;
  padding: clamp(24px, 4.6vw, 56px);
  background:
    radial-gradient(ellipse at 0% 0%, rgb(46 134 250 / 29%), transparent 68%),
    radial-gradient(ellipse at 100% 100%, rgb(11 184 158 / 16%), transparent 62%),
    var(--hero-bg);
  border-radius: var(--panel-radius);
}
.closing h2 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.75rem, 3.4vw, 2.9rem);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.012em;
}
.closing p { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.closing .primary-action { flex: none; }

@media (max-width: 840px) {
  .landing-header .site-header { grid-template-columns: 1fr auto; gap: 0 16px; padding-block: 4px; }
  .landing-header .site-header > nav:first-of-type { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .header-download { display: none; }
  .product-demo, .landing-section, #languages-title, #main-content, #menu-bar, #download { scroll-margin-top: 106px; }
  .demo-heading { align-items: flex-start; }
  .demo-controls { justify-content: space-between; flex: 1 0 100%; }
}

@media (max-width: 700px) {
  .section-heading, .detail-section, .pull-requests-card .feature-copy, .security-card, .demo-detail, .integration-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.52rem, 8.7vw, 4rem); }
  .hero h1 em { display: block; }
  .hero .lede { margin: 14px auto 18px; }
  .demo-detail { gap: 10px; }
  .menu-bar-card, .quick-open-card { grid-column: 1 / -1; }
  .integration-group + .integration-group { border-inline-start: 0; border-top: 1px solid var(--line); }
  .closing { flex-direction: column; align-items: flex-start; }
  .language-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .hero-band > .wrap { padding-inline: 12px; }
  .hero { padding-inline: 8px; }
  .landing-header .site-header > nav:first-of-type { justify-content: space-between; gap: 0; }
  .landing-header .site-header > nav:first-of-type a { padding-inline: 5px; font-size: 0.84rem; }
  .product-demo .demo-heading { padding-inline: 3px; }
  .demo-controls { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
  .demo-actions { flex-direction: column; gap: 2px; border: 0; padding-inline-start: 0; }
  .chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
  .chapters button { padding: 4px; font-size: 0.78rem; line-height: 1.2; text-align: left; }
  .everywhere, .promises { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.landing) { scroll-behavior: auto; }
  .shot { transition: none; }
}

@media (prefers-color-scheme: dark) {
  .menu-bar-heading img, .rust-logo { filter: invert(1); }
}
