/*
 * Nilakan site pages: layout only. Colours, type, shape, and components come from the design
 * system in @nlk/ui (tokens.css and components.css).
 */

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

html {
  scroll-padding-top: 6rem;
  /* iOS Safari would otherwise enlarge text in landscape and break the measured layouts. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}

.container {
  inline-size: min(100%, var(--page-width));
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-10));
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: -3rem;
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--brand-foreground);
  color: var(--brand);
}

.skip-link:focus {
  inset-block-start: var(--space-4);
}

/* The page's scrollbar floats over it and fades when idle, with no gutter. Browsers offer no way to
   ask for that, so mouse users get a drawn one; touch screens already behave this way natively. */

.page-scrollbar {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (scripting: enabled) {
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }

  .page-scrollbar {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 30;
    display: block;
    inline-size: 0.75rem;
    touch-action: none;
    user-select: none;
  }

  .page-scrollbar[hidden] {
    display: none;
  }
}

.page-scrollbar {
  --page-scrollbar-ink: color-mix(in srgb, var(--foreground) 45%, var(--background));
}

.page-scrollbar-thumb {
  inline-size: 0.375rem;
  margin: 0.875rem auto 0;
  border-radius: var(--radius-pill);
  background: var(--page-scrollbar-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--background) 60%, transparent);
}

/* The same bare arrows as the slim scrollbars in base.css, in this thumb's ink. */
.page-scrollbar-arrow {
  position: absolute;
  inset-inline: 0;
  block-size: 0.875rem;
  background: center / 0.5rem 0.3125rem no-repeat;
}

.page-scrollbar-arrow:first-child {
  inset-block-start: 0;
  background-image: conic-gradient(
    from 141.3deg at 50% 0,
    transparent,
    var(--page-scrollbar-ink) 1deg 76.3deg,
    transparent 77.3deg
  );
}

.page-scrollbar-arrow:last-child {
  inset-block-end: 0;
  background-image: conic-gradient(
    from -38.7deg at 50% 100%,
    transparent,
    var(--page-scrollbar-ink) 1deg 76.3deg,
    transparent 77.3deg
  );
}

.page-scrollbar-arrow:hover {
  --page-scrollbar-ink: color-mix(in srgb, var(--foreground) 75%, var(--background));
}

.page-scrollbar > * {
  opacity: 0;
  transition:
    opacity 0.2s,
    inline-size 0.15s;
}

:is(.page-scrollbar.is-active, .page-scrollbar.is-dragging, .page-scrollbar:hover) > * {
  opacity: 1;
}

:is(.page-scrollbar.is-dragging, .page-scrollbar:hover) .page-scrollbar-thumb {
  inline-size: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .page-scrollbar > * {
    transition: none;
  }
}

@media print {
  .page-scrollbar {
    display: none;
  }
}

/* Header */

.site-header {
  z-index: 10;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) clamp(var(--space-4), 3vw, var(--space-10));
  padding-block: var(--space-3) var(--space-2);
}

.header-nav {
  display: flex;
  order: 3;
  inline-size: 100%;
  gap: var(--space-1);
  margin-inline-start: calc(-1 * var(--space-3));
}

.header-nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--brand-muted);
  font-weight: 600;
  text-decoration: none;
}

.header-nav a:hover {
  background: color-mix(in srgb, var(--brand-foreground) 12%, transparent);
  color: var(--brand-foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 2.5rem;
  min-inline-size: 2.5rem;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--brand-foreground);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.header-button:hover {
  border-color: var(--brand-foreground);
}

.theme-toggle {
  padding: 0;
}

:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="dark"]) .icon-sun {
  display: none;
}

@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    inset-block-start: 0;
  }

  .header-inner {
    min-block-size: 4.5rem;
    padding-block: 0;
  }

  .header-nav {
    order: 0;
    inline-size: auto;
    margin-inline-start: 0;
  }
}

/* Hero: what Nilakan is, in one screenful, so the first examples sit above the fold. */

.hero {
  padding-block: clamp(var(--space-8), 4vw, var(--space-12));
}

.hero-grid {
  display: grid;
  gap: var(--space-6) var(--space-12);
  align-items: end;
}

.hero h1 {
  max-inline-size: 22ch;
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  line-height: var(--leading-tight);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

/* The home hero reads left to right: the idea in two plain lines, then the name, what it does,
   and the way in. Lines break where the outline breaks them once both columns fit. */

.hero--home {
  padding-block: clamp(var(--space-6), 3.5vw, var(--space-10)) 0;
}

.hero--home .hero-grid {
  gap: var(--space-4);
  align-items: stretch;
}

.hero-taglines {
  display: grid;
  align-content: center;
  gap: var(--space-3);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-snug);
  text-wrap: balance;
}

.hero-taglines p {
  margin: 0;
}

.hero-taglines p:first-child,
.hero-name {
  color: var(--primary);
}

.hero-card {
  display: grid;
  align-content: center;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
}

.hero--home h1 {
  max-inline-size: none;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.15;
  text-wrap: balance;
}

/* Stacked, the name and the way in come first and the taglines explain it. This moves only the
   two hero blocks on screen; the source and reading order stay taglines, then card. */
@media (max-width: 55.99rem) {
  .hero-card {
    order: -1;
  }
}

@media (max-width: 45rem) {
  .hero-card {
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .hero--home .nlk-button {
    min-block-size: 2.75rem;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
  }

  .hero--home .actions {
    gap: var(--space-2);
  }

  /* The two buttons share the row, or each takes a full row on the narrowest phones. */
  .hero--home .actions > * {
    flex: 1 1 auto;
  }
}

/* Two columns once the title keeps its three lines beside the taglines' longest line. */
@media (min-width: 56rem) {
  .hero--home .hero-grid {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-8);
  }

  .hero-taglines {
    gap: var(--space-6);
    font-size: clamp(var(--text-md), 1.5vw, var(--text-lg));
  }

  .hero-card {
    gap: var(--space-6);
    padding: var(--space-6) var(--space-6) var(--space-6) var(--space-12);
  }

  .hero--home .hero-line {
    display: block;
  }
}

/* Sections: a short heading, then a row of examples. A rule and about one and a half heading
   lines separate one row from the next section's heading. */

.section {
  padding-block: clamp(var(--space-8), 3.5vw, var(--space-10));
}

.section + .section {
  border-block-start: 1px solid var(--border);
}

.section--first {
  padding-block-start: clamp(var(--space-8), 4vw, var(--space-10));
}

.section-head {
  max-inline-size: 60rem;
  margin-block-end: var(--space-6);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(var(--text-xl), 3.4vw, var(--text-2xl));
  line-height: var(--leading-snug);
}

.section-head p {
  margin: var(--space-3) 0 0;
  font-size: var(--text-md);
}

.section-head .proof-emphasis {
  font-size: var(--text-lg);
  font-weight: 700;
}

.numbers {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 700;
  white-space: nowrap;
}

.pi {
  font-family: var(--font-sans);
}

/* An expression in running text stays whole, like the word it stands in for. */
.nlk-inline-code {
  white-space: nowrap;
}

/* Rows: the examples in reading order. Rows stack on narrow screens. Each row is only as wide
   as its examples need, so short code is not stranded in wide cards. */

.row {
  display: grid;
  gap: var(--space-4);
  align-items: stretch;
}

.row--three,
.mapping {
  max-inline-size: 56rem;
}

.row--orbits,
.hero--home .hero-grid {
  max-inline-size: 60rem;
}

.row--billing,
.row--proof,
.papers {
  max-inline-size: 63.5rem;
}

.row--orders {
  max-inline-size: 66rem;
}

.row + .mapping {
  margin-block-start: var(--space-4);
}

@media (min-width: 40rem) {
  .row--three,
  .row--billing,
  .row--orbits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* In two columns, a row's third card takes the whole second line rather than half of it. */
  :is(.row--three, .row--billing) > :nth-child(3):last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 60rem) {
  .row--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .row--three > :nth-child(3):last-child {
    grid-column: auto;
  }

  /* The cards take what their code and note need; the snake takes the rest, and so needs fewer
     rows and leaves the code cards less to fill. */
  .row--orders {
    grid-template-columns: repeat(2, minmax(0, 15.5rem)) minmax(0, 1fr);
  }

  .row--orders .fib-snake.is-snake {
    flex-basis: calc(var(--rows) * 2.25rem);
  }

  .row--proof {
    grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  }
}

/* Four orbit columns once a finished run's status still fits beside its reset button. */
@media (min-width: 66rem) {
  .row--orbits {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* The derivation table sits beside its program once neither needs to scroll. */
@media (min-width: 70rem) {
  .row--derivation {
    grid-template-columns: minmax(0, 1fr) 25.5rem;
  }
}

/* Three billing columns once the longer billing lines fit beside the narrower totals. */
@media (min-width: 68rem) {
  .row--billing {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 20rem);
  }

  .row--billing > :nth-child(3):last-child {
    grid-column: auto;
  }
}

@media (min-width: 70rem) {
  .row--program {
    grid-template-columns: minmax(0, 31rem) minmax(0, 1fr);
  }
}

/* The compound trace is the widest table; it sits beside its code only when it fits. */
@media (min-width: 76rem) {
  .row--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row--pair .example {
    padding: var(--space-4);
  }
}

/* Examples: a label, the code or result, and a note. Nilakan sits on the card ink; another
   language sits on a ruled edge, as in the design system's other-language panels. */

.example {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-inline-size: 0;
  margin: 0;
  padding: var(--space-5);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--card);
}

@media (max-width: 40rem) {
  .example {
    padding: var(--space-4);
  }
}

.example--other {
  border: 1.5px dashed var(--input);
  background: transparent;
}

.example--plain {
  border-color: var(--border);
  background: var(--background);
}

.example--verdict {
  background: var(--accent);
}

.example > * {
  margin: 0;
}

.example:not(.example--plain, .example--other) .nlk-inline-code {
  background: var(--background);
}

.example .nlk-code {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.example :is(.nlk-code, .nlk-trace-scroll) {
  --scroll-surface: var(--card);
}

.example--plain :is(.nlk-code, .nlk-trace-scroll),
.example--other :is(.nlk-code, .nlk-trace-scroll) {
  --scroll-surface: var(--background);
}

.example--verdict :is(.nlk-code, .nlk-trace-scroll) {
  --scroll-surface: var(--accent);
}

.example-label {
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.example h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.example--verdict h3 {
  font-size: var(--text-2xl);
  line-height: 1;
}

.example-note {
  margin-block-start: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.example-code--short {
  font-size: var(--text-xl);
  line-height: 1.6;
}

/* Demos play a program's trace on request. Without scripts they show the whole run. */

.demo-head,
.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.demo-foot {
  margin-block-start: auto;
}

.demo-status {
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Play, pause and reset are icons the reader already knows; their aria-labels name them. */
.demo-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--input);
  border-radius: 50%;
  background: var(--background);
  color: var(--primary);
  cursor: pointer;
}

.demo-button[hidden] {
  display: none;
}

.demo-button:hover {
  border-color: currentColor;
}

.demo-reset {
  color: var(--foreground);
}

.demo-icon {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  fill: currentColor;
}

.demo-icon--reset {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-run .demo-icon--pause,
.demo-run.is-running .demo-icon--run {
  display: none;
}

.demo-run.is-running .demo-icon--pause {
  display: block;
}

/* The Fibonacci snake: the script sets its rows and columns; the path bends at the card's edges. */

.fib-snake ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 700;
}

.fib-snake.is-snake {
  position: relative;
  flex: 1 0 calc(var(--rows) * 2.75rem);
}

.fib-snake.is-snake svg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

.fib-snake polyline {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.fib-snake polyline.is-done {
  stroke: var(--primary);
}

.fib-snake.is-snake ol {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
}

.fib-snake.is-snake li {
  place-self: center;
  padding: 0 var(--space-1);
  background: var(--background);
}

/* Bill totals: the wrong one is ringed, as a teacher marks it. */

.totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.total + .total {
  padding-inline-start: var(--space-3);
  border-inline-start: 1px solid var(--border);
}

.total h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.total p {
  margin: 0;
}

.total .total-result {
  display: grid;
  justify-items: start;
  margin-block-start: var(--space-2);
  font-family: var(--font-sans);
}

.total-result strong {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  line-height: 1.2;
}

.total--wrong .total-result strong {
  color: var(--destructive);
}

/* Orbits drawn from the programs' traces. */

.orbit-demo {
  padding: var(--space-4);
}

.orbit-stage {
  display: grid;
  place-items: center;
}

.nlk-plot {
  inline-size: 100%;
  max-inline-size: 16rem;
  aspect-ratio: 1;
}

.nlk-plot-axes {
  stroke: var(--input);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.nlk-plot-ring {
  fill: none;
  stroke: var(--foreground);
  stroke-dasharray: 4 6;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
}

.nlk-plot-path {
  fill: none;
  stroke: var(--primary);
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.nlk-plot-centre {
  fill: var(--brand-accent);
}

.nlk-plot-body {
  fill: var(--primary);
}

.orbit-demo--drift :is(.nlk-plot-path, .demo-run) {
  stroke: var(--warning);
  color: var(--warning);
}

.orbit-demo--drift .nlk-plot-body {
  fill: var(--warning);
}

/* Trace tables inside an example keep the card's padding instead of their own. */

.example .nlk-trace :is(th, td) {
  padding-inline: var(--space-3) 0;
}

/* The mapping from trace to program. */

.mapping table {
  inline-size: 100%;
  border-collapse: collapse;
}

.mapping th,
.mapping td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-block-end: 1px solid var(--border);
  text-align: start;
  vertical-align: baseline;
}

.mapping tr:last-child > * {
  border-block-end: 0;
}

/* Code in the mapping stays whole where it fits, and wraps as a run of chips where it cannot. */
.mapping code {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (min-width: 22.5rem) {
  .mapping code {
    white-space: nowrap;
  }
}

.mapping tbody th {
  inline-size: 49%;
  font-weight: 600;
}

/* Proof: the program with its invariant, beside the two obligations. */

.proof-definitions {
  display: grid;
  gap: var(--space-2);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--border);
}

.proof-definitions p,
.proof-part p {
  margin: 0;
}

.proof-obligations {
  gap: var(--space-6);
}

.proof-part {
  display: grid;
  gap: var(--space-3);
}

.proof-part + .proof-part {
  padding-block-start: var(--space-6);
  border-block-start: 1px solid var(--border);
}

.proof-part h3 {
  margin: 0;
}

/* Derivation: each row's difference becomes the next row's invariant. A sum sets its bounds
   beside the sigma, in the same upright programming notation as the code around it. The formula
   is an inline block so that its pill grows around the sigma. */

.formula {
  display: inline-block;
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.formula .nlk-inline-code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.sum {
  display: inline-flex;
  align-items: center;
  margin-inline: 0.35em;
  vertical-align: middle;
}

.sum-symbol {
  font-size: 1.7em;
  line-height: 1;
}

.sum-limits {
  display: inline-flex;
  flex-direction: column;
  margin-inline-start: 0.12em;
}

.sum-limits :is(sup, sub) {
  position: static;
  font-size: 0.8em;
  line-height: 1.1;
}

/* The rows share the card's height when it stands taller beside the program. */
.derivation .nlk-trace-scroll {
  flex: 1;
}

.derivation table {
  inline-size: 100%;
  block-size: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.derivation .sum-limits :is(sup, sub) {
  font-size: 0.85em;
}

.derivation th,
.derivation td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  text-align: start;
  vertical-align: middle;
}

.derivation :is(th, td):last-child {
  padding-inline-end: 0;
}

.derivation th {
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-weight: 500;
  vertical-align: bottom;
}

.derivation tbody tr > * {
  border-block-start: 1px solid var(--border);
}

.derivation :is(.nlk-inline-code, .formula) {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* Papers, newest first. */

.papers {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper {
  display: grid;
  gap: var(--space-2) var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.paper--featured {
  border-color: transparent;
  background: var(--accent);
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  margin: 0;
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 700;
}

.paper-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.paper-title a {
  text-decoration: none;
}

.paper-title a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.paper-authors {
  margin: 0;
}

@media (min-width: 40rem) {
  .paper {
    grid-template-columns: 8rem minmax(0, 1fr);
  }

  .paper-meta {
    flex-direction: column;
  }
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Not found keeps the planetary illustration beside its message. */

.hero-lead {
  margin: var(--space-6) 0 var(--space-8);
  color: var(--brand-muted);
  font-size: var(--text-lg);
}

.hero-art {
  justify-self: center;
  inline-size: min(100%, 26rem);
}

/* Not found */

.not-found {
  padding-block-end: var(--space-16);
}

/* Footer */

.site-footer {
  padding-block: var(--space-12) var(--space-16);
  border-block-start: 1px solid var(--border);
  font-size: var(--text-base);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

.footer-brand {
  grid-column: 1 / -1;
}

.footer-brand p {
  max-inline-size: 24rem;
  margin: var(--space-4) 0 0;
  color: var(--muted-foreground);
}

.footer-brand [lang="ml"] {
  white-space: nowrap;
}

.site-footer nav {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.site-footer nav a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--primary);
}

.site-footer h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: auto;
  }
}
