/* ============================================================
   Fonts
   ============================================================ */
@font-face {
  font-family: 'Inter Display';
  src: url('assets/fonts/InterDisplay-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Display';
  src: url('assets/fonts/InterDisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Display';
  src: url('assets/fonts/InterDisplay-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Iosevka';
  src: url('assets/fonts/Iosevka-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Design tokens — computed from the viewport so that:
     * content caps at 1920px wide (centered beyond that),
     * the 5 inner columns stay ≤ 256px wide,
     * side margins grow up to 320px as space allows,
     * everything degrades smoothly down to 1024px.
   Use `100%` (not `100vw`) so the math resolves against body's
   content-box width, which is what `.site-header` / `.site-main` also
   measure against — `100vw` would include the scrollbar and drift the
   body::after overlay by the scrollbar width on Windows / "always
   show" macOS. Custom properties are text-substituted, so `100%`
   resolves in each consumer's context; for body::after that's body
   width, which is what we want.
   ============================================================ */
:root {
  --content-width: min(100%, 1920px);
  --content-offset: calc((100% - var(--content-width)) / 2);
  --col-width: min(256px, calc(var(--content-width) / 5));
  --side-margin: calc((var(--content-width) - 5 * var(--col-width)) / 2);
}

/* ============================================================
   Base
   ============================================================ */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: -0.25px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  overflow-wrap: break-word;
}

/* Faint grid guides — align to actual column positions at any width */
body::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background:
    /* horizontal y=142 (inside header) */
    linear-gradient(rgba(128,128,128,0.2), rgba(128,128,128,0.2)) 0 142px / 100% 1px no-repeat,
    /* horizontal y=286 (bottom of header) */
    linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)) 0 286px / 100% 1px no-repeat,
    /* 6 verticals along the column grid */
    linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1))
      calc(var(--content-offset) + var(--side-margin)) 0 / 1px 100% no-repeat,
    linear-gradient(rgba(128,128,128,0.2), rgba(128,128,128,0.2))
      calc(var(--content-offset) + var(--side-margin) + var(--col-width)) 0 / 1px 100% no-repeat,
    linear-gradient(rgba(128,128,128,0.1), rgba(128,128,128,0.1))
      calc(var(--content-offset) + var(--side-margin) + 2 * var(--col-width)) 0 / 1px 100% no-repeat,
    linear-gradient(rgba(128,128,128,0.1), rgba(128,128,128,0.1))
      calc(var(--content-offset) + var(--side-margin) + 3 * var(--col-width)) 0 / 1px 100% no-repeat,
    linear-gradient(rgba(128,128,128,0.2), rgba(128,128,128,0.2))
      calc(var(--content-offset) + var(--side-margin) + 4 * var(--col-width)) 0 / 1px 100% no-repeat,
    linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1))
      calc(var(--content-offset) + var(--side-margin) + 5 * var(--col-width)) 0 / 1px 100% no-repeat;
}

/* ============================================================
   Site header (dark nav band)
   ============================================================ */
.site-header {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    repeat(5, minmax(0, 256px))
    minmax(0, 1fr);
  grid-template-rows: 286px;
  color: #ffffff;
}

.site-header__bg {
  grid-column: 2 / span 5;
  grid-row: 1;
  background: #000000;
  z-index: 0;
}

/* ============================================================
   Columns
   ============================================================ */
.col {
  grid-row: 1;
  position: relative;
  z-index: 1;
  min-width: 0; /* allow text to shrink/wrap */
}

.col--brand    { grid-column: 2; padding-left: 18px; padding-right: 18px; }
.col--news     { grid-column: 3; padding-left: 24px; padding-right: 24px; }
.col--download { grid-column: 4; padding-left: 22px; padding-right: 24px; }
.col--changelog{ grid-column: 5; padding-left: 23px; padding-right: 24px; }
.col--social   { grid-column: 6; padding-left: 23px; padding-right: 24px; }

/* ============================================================
   Logo (brand column)
   ============================================================ */
.logo {
  position: absolute;
  top: 16px;
  left: 18px;
  display: block;
}

.logo__word {
  display: block;
  font-weight: 300;
  font-size: 36px;
  letter-spacing: -1px;
  line-height: 1;
  color: #ffffff;
}

.logo__smile {
  display: block;
  width: 99px;
  height: auto;
  margin: 7px 0 0 4px;
  overflow: visible;
}

/* ============================================================
   Column titles, tagline, and lists
   ============================================================ */
.col__title,
.tagline {
  padding-top: 151px;
  font-size: 12px;
  font-weight: 400;
  color: #808080;
  letter-spacing: -0.25px;
}

.col__title {
  line-height: 30px;
}

.tagline {
  line-height: 1.5;
  margin-top: 0.5em;
}

.col__list {
  font-size: 12px;
  letter-spacing: -0.25px;
}

.col__list li {
  line-height: 1.5;
  padding: 0.5em 0;
}

.col__list--standalone {
  padding-top: 151px;
}

.col__link {
  font-weight: 500;
  color: #808080;
  transition: color 120ms ease;
}

.col__link:hover {
  color: #ffffff;
}

.col__link--active {
  color: #ffffff;
}

.col__link--light {
  font-weight: 400;
}

.col__title--mobile-only {
  display: none;
}

/* ============================================================
   Main content
   ============================================================ */
.site-main {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  min-height: calc(100vh - 286px);
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    repeat(5, minmax(0, 256px))
    minmax(0, 1fr);
  padding-bottom: 120px;
}

.article {
  grid-column: 3 / span 3;
  padding: 26px 24px 0;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.article__breadcrumb {
  display: block;
  font-size: 12px;
  line-height: 1;
  color: #808080;
  letter-spacing: -0.25px;
  margin-bottom: 22px;
}

.article__breadcrumb a {
  transition: color 120ms ease;
}

.article__breadcrumb a:hover {
  color: #000000;
}

.article__title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.25px;
  color: #000000;
  margin-bottom: 17px;
}

.article__body {
  font-size: 14px;
  line-height: 1.5;
  color: #666666;
  letter-spacing: 0;
}

.article__body h2 {
  color: #000000;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.25px;
  margin-bottom: 0.5em;
  margin-top: 1.5em;
}

.article__body h3 {
  color: #000000;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.25px;
  margin-bottom: 1.0em;
  margin-top: 1.5em;
}

/* Target `code` broadly so the rule covers <code> nested inside <pre> too —
   UA stylesheets set `code { font-family: monospace }` which otherwise shadows
   the Iosevka font-family inherited from the parent <pre>. */
.article__body pre.code-block,
.article__body code {
  font-family: 'Iosevka', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article__body pre.code-block {
  position: relative;
  font-size: 0.9em;
  letter-spacing: -0.045em;
  padding: 0.5em 2.4em 0.5em 0.8em;
  background-color: #f5f5f5;
  border-radius: .35em;
  color: #333333;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.article__body pre.code-block:hover {
  background-color: #ececec;
}

.article__body p > code,
.article__body li > code
{
  font-size: 0.9em;
  letter-spacing: -0.045em;
  padding: 0.2em 0.4em;
  background-color: #f5f5f5;
  border-radius: .35em;
  color: #333333;
}

/* Copy icon sits in the top-right of code-blocks. Pointer events stay off so
   the whole <pre> remains the single click target wired up in copy-code.js. */
.code-block__copy {
  position: absolute;
  top: 0.6em;
  right: 0.55em;
  display: inline-flex;
  color: #999;
  pointer-events: none;
  transition: color 120ms ease;
}

.code-block__copy > svg {
  width: 1.3em;
  height: 1.3em;
}

.article__body pre.code-block:hover .code-block__copy {
  color: #333;
}

/* Transient confirmation state; copy-code.js toggles for ~1.5s after a copy. */
.article__body pre.code-block.code-block--copied {
  background-color: #e0f0e0;
}

.article__body pre.code-block.code-block--copied .code-block__copy {
  color: #2b7a2b;
}

.article__body p + p {
  margin-top: 1em;
}

.article__body p a,
.downloads-list a {
    color: #000000;
    font-weight: 500;
}

.article__body p a:hover,
.downloads-list a:hover,
.archive-list a:hover
{
  text-decoration: underline;
}

.article__body.changelog ul {
  list-style: square;
  margin-left: 1em;
}

.article__body.changelog ul li:not(:last-child),
ul.archive-list li:not(:last-child)
{
  margin-bottom: 0.5em;
}

.article__body.changelog ul li ul {
  margin-top: 0.5em;
}

ul.downloads-list li:not(:last-child) {
  margin-bottom: 0.5em;
}

/* Inline platform glyph before Windows/macOS/Linux subtitles; inherits the
   heading's text color through currentColor so the duotone renders on any
   background. */
.platform-icon {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-right: 0.4em;
}
.platform-icon > svg {
  width: 1em;
  height: 1em;
}

/* ============================================================
   Mobile / small tablet (< 1024px) — stacked layout
   ============================================================ */
@media (max-width: 1023px) {
  body::after {
    display: none;
  }

  .site-header {
    max-width: none;
    display: block;
    background: #000000;
    padding: 28px 24px 32px;
  }

  .site-header__bg {
    display: none;
  }

  .col {
    grid-row: auto;
    grid-column: auto;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 28px;
  }

  .col--brand {
    margin-top: 0;
  }

  .logo {
    position: static;
  }

  .tagline,
  .col__title,
  .col__list--standalone {
    padding-top: 0;
  }

  .tagline {
    margin-top: 18px;
    line-height: 1.6;
  }

  .col__title {
    margin-bottom: 1em;
    line-height: 1.6;
  }

  .col__list li {
    line-height: 1.5;
    padding: 0.5em 0;
  }

  .col__title--mobile-only {
    display: block;
  }

  .site-main {
    max-width: none;
    min-height: 0;
    display: block;
    padding: 28px 24px 48px;
  }

  .article {
    padding: 0;
  }

  .article__title {
    font-size: 22px;
  }
}

/* ============================================================
   Small phones (< 480px) — slightly tighter
   ============================================================ */
@media (max-width: 479px) {
  .site-header {
    padding: 24px 20px 28px;
  }

  .logo__word {
    font-size: 32px;
  }

  .logo__smile {
    width: 88px;
  }

  .site-main {
    padding: 24px 20px 40px;
  }

  .article__title {
    font-size: 20px;
  }

  .article__body {
    font-size: 13px;
  }
}
