/* Reset, type and the pieces every page uses: header, buttons, footer. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

/* The wordmark sets "Scene" light and "Mill" bold; the headline does the same. */
h1 strong {
  font-weight: 700;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-text);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  border-radius: var(--radius-small);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-height);
  background: rgb(13 14 19 / 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  height: 100%;
}

.brand {
  display: block;
  flex: none;
  border-radius: var(--radius-small);
}

.brand img {
  height: 30px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.25rem);
  margin-left: auto;
}

.site-nav a {
  padding: 0.4rem 0;
  color: var(--text-muted);
  font-size: var(--text-small);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--text);
}

/* The header's lower edge is a timeline ruler; the playhead shows how far
   down the page you are. */
.ruler {
  position: absolute;
  inset: auto 0 0 0;
  height: 7px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 16px);
  background-size: auto 7px, auto 3px;
  background-position: 0 100%, 0 100%;
  background-repeat: repeat-x;
  overflow: hidden;
  pointer-events: none;
}

.ruler__track {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  will-change: transform;
}

.ruler__track::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--brand-gradient);
  opacity: 0.85;
}

.ruler__track::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.button svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* The application's own primary button (Export). */
.button--primary {
  background: var(--accent);
  color: var(--accent-text);
}

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

.button--primary:active {
  background: var(--accent-pressed);
}

.button--quiet {
  border-color: var(--border-strong);
  color: var(--text);
}

.button--quiet:hover {
  border-color: var(--text-muted);
  background: var(--panel);
}

.button--small {
  padding: 0.55rem 1rem;
  font-size: var(--text-small);
}

.button--large {
  padding: 1.1rem 2.1rem;
  font-size: 1.12rem;
}

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

.site-footer {
  margin-top: var(--space-section);
  padding-block: clamp(3rem, 6vw, 5rem) 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--window);
  font-size: var(--text-small);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem 4rem;
}

.site-footer__brand img {
  height: 36px;
  width: auto;
}

.site-footer__brand p {
  margin-top: 0.9rem;
  color: var(--text-muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem clamp(2.5rem, 6vw, 5rem);
}

.site-footer__links h2 {
  margin-bottom: 0.9rem;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

.site-footer__links li + li {
  margin-top: 0.5rem;
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }

  .site-header__inner > .button {
    margin-left: auto;
  }
}

/* On the narrowest phones the header button says just "Download". */
@media (max-width: 400px) {
  .wide-only {
    display: none;
  }
}

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

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