/*
 * Nival's look (Nival Shell's src/styles/global.css; its tokens are nival-design's, as every Nival
 * app's): the base lit by three soft glows under a frost, glass sheets holding solid cards, neutral
 * ink in opacity steps and no colour accent, pills and corners nesting outside in, Inter Tight for
 * text and JetBrains Mono for small uppercase labels, and Nival's motion. The tokens are tokens.css
 * beside this file, dark and light by the visitor's own setting, written from nival-design (never
 * edit it here); none is written anywhere else.
 */

/* ---------- Type ---------- */
/* Served by this server, as the download page's are (nothing loaded from elsewhere). */
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url(/download/assets/inter-tight-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url(/download/assets/inter-tight-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url(/download/assets/inter-tight-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(/download/assets/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }

/* ---------- The page's own tokens ---------- */
:root {
  /* The page's own room: a phone's 16 px gutter, more on a wide screen. */
  --gutter: var(--space-4);
  --card-pad: calc(var(--space-4) + var(--space-half));
}
@media (min-width: 720px) {
  :root {
    --gutter: var(--space-8);
    --card-pad: var(--space-6);
  }
}

/* ---------- Page ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--n-bg);
}
/* The base is on html, so the backdrop (z-index -1) shows through the body. */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--n-ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection {
  background: var(--n-selection);
}
:focus {
  outline: none;
}
:focus-visible {
  outline: var(--line-hair) solid var(--n-accent);
  outline-offset: 2px;
}

/* Nival's scrollbar: a rounded thumb in the ink, faint at rest. */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-color: var(--n-scroll-rest);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  border-width: var(--line-ring);
  background-color: var(--n-scroll-hover);
}
::-webkit-scrollbar-thumb:active {
  border-width: var(--line-ring);
  background-color: var(--n-scroll-active);
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- The background: the base, three glows drifting on long loops, the frost over them ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
  background: var(--n-bg);
}
.glow {
  position: absolute;
  aspect-ratio: 1;
  translate: -50% -50%;
  will-change: transform;
  animation-timing-function: var(--ease-io);
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.glow-0 {
  left: 18%;
  top: 12%;
  width: 95cqmax;
  background: var(--n-glow-0);
  animation-name: drift-a;
  animation-duration: var(--n-drift-a);
}
.glow-1 {
  left: 88%;
  top: 55%;
  width: 85cqmax;
  background: var(--n-glow-1);
  animation-name: drift-b;
  animation-duration: var(--n-drift-b);
}
.glow-2 {
  left: 35%;
  top: 98%;
  width: 80cqmax;
  background: var(--n-glow-2);
  animation-name: drift-c;
  animation-duration: var(--n-drift-c);
}
.n-frost {
  position: absolute;
  inset: 0;
  background-color: var(--n-frost);
  background-image: var(--n-sheen), var(--n-grain);
  -webkit-backdrop-filter: blur(var(--blur-frost)) saturate(1.2);
  backdrop-filter: blur(var(--blur-frost)) saturate(1.2);
}

/* ---------- Layout ---------- */
main {
  max-width: calc(760px + 2 * var(--gutter));
  margin: 0 auto;
  padding: calc(var(--space-unit) * 7) var(--gutter) calc(var(--space-unit) * 14);
}
.top {
  display: flex;
  align-items: center;
  height: var(--h-control);
}
.mark {
  display: inline-block;
  line-height: 0;
  border-radius: var(--r-tile);
  transition: scale var(--t-mid) var(--ease-spring);
}
.mark:hover {
  scale: 1.04;
}
.mark:active {
  scale: 0.98;
}
.mark img {
  height: 24px;
  width: auto;
}
.hero {
  padding: calc(var(--space-unit) * 14) 0 var(--space-8);
}
@media (min-width: 720px) {
  .hero {
    padding: calc(var(--space-unit) * 22) 0 var(--space-10);
  }
}

/* ---------- Type ---------- */
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: var(--fs-display-3);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
@media (min-width: 720px) {
  h1 {
    font-size: var(--fs-hero);
  }
}
h2 {
  font-size: var(--fs-heading);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--n-ink);
}
p,
li {
  color: var(--n-ink2);
}
p + p {
  margin-top: var(--space-3);
}
strong {
  font-weight: 600;
  color: var(--n-ink);
}
.lead {
  margin-top: calc(var(--space-4) + var(--space-half));
  max-width: 600px;
  font-size: var(--fs-heading);
  line-height: 1.5;
  color: var(--n-ink2);
  text-wrap: pretty;
}
@media (min-width: 720px) {
  .lead {
    font-size: var(--fs-headline);
  }
}
/* Small uppercase mono labels. */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--n-ink3);
}
h1 + .label {
  margin-top: var(--space-4);
}
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px var(--space-2);
  border-radius: var(--r-pill);
  box-shadow: var(--n-edge);
  color: var(--n-ink);
  white-space: nowrap;
}
a {
  color: var(--n-ink);
  text-decoration: underline;
  text-decoration-color: var(--n-ink4);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color var(--t-fast) linear, color var(--t-fast) linear;
}
a:hover {
  text-decoration-color: var(--n-ink);
}

/* ---------- Glass and cards ---------- */
/* Glass that holds the cards: Nival's sheets (`.panel.sheet`). Its cards sit in its corners,
   --inset-panel in, so their corners are its own less that. */
.panel {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-panel);
}
.panel.sheet {
  display: grid;
  gap: var(--inset-panel);
  padding: var(--inset-panel);
  background-color: var(--n-glass-window);
  -webkit-backdrop-filter: blur(var(--blur-window));
  backdrop-filter: blur(var(--blur-window));
  box-shadow: var(--n-window-shadow);
}
/* A card on a panel: solid, its rounded edge carved in. */
.n-card {
  position: relative;
  padding: var(--card-pad);
  border-radius: var(--r-card);
  background: var(--n-layer);
}
.n-card > h2 + * {
  margin-top: var(--space-2);
}
.n-card > p + ul,
.n-card > ul + p {
  margin-top: calc(var(--space-3) + var(--space-half));
}
/* Lists are rows, a carved line between each running to the card's edges. */
.n-card ul {
  list-style: none;
  margin-left: calc(-1 * var(--card-pad));
  margin-right: calc(-1 * var(--card-pad));
  padding: 0;
}
.n-card > h2 + ul {
  margin-top: calc(var(--space-3) + var(--space-half));
}
.n-card ul:last-child {
  margin-bottom: calc(-1 * var(--card-pad) + var(--space-1));
}
.n-card li {
  position: relative;
  padding: var(--space-3) var(--card-pad);
}
.n-card li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--n-groove-span);
  margin-top: calc(var(--n-groove-span) / -2);
  background: var(--n-groove-across);
}
.n-card li > strong {
  display: block;
  margin-bottom: var(--space-half);
}
/* The home page's three things it does: tiles side by side on a wide screen. */
@media (min-width: 720px) {
  .n-card ul.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .n-card ul.tiles li {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
  .n-card ul.tiles li + li::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--n-groove-span) / -2);
    width: var(--n-groove-span);
    background: linear-gradient(to right, var(--n-groove-shine) 0 1px, var(--n-groove-deep) 1px 3px, var(--n-groove-shine) 3px 4px);
  }
}

/* Every solid shape's rounded edge: the outline in, and its shine just inside. */
.n-card::before,
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--n-edge);
  outline: var(--line-hair) solid var(--n-groove-shine);
  outline-offset: var(--n-edge-shine-at);
  pointer-events: none;
}

/* ---------- Controls ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--h-control);
  padding: 0 calc(var(--space-4) + var(--space-half));
  border-radius: var(--r-pill);
  background: var(--n-raised);
  box-shadow: var(--n-raised-shadow), inset 0 0 0 999px transparent;
  color: var(--n-ink);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition-property: background-color, color, box-shadow, scale, translate;
  transition-duration: var(--t-fast), var(--t-fast), var(--t-fast), var(--t-mid), var(--t-mid);
  transition-timing-function: linear, linear, linear, var(--ease-spring), var(--ease-spring);
}
.btn:hover {
  translate: 0 -1px;
  box-shadow: var(--n-raised-shadow), var(--n-hover-shade);
}
.btn:active {
  translate: 0;
  scale: 0.98;
  box-shadow: var(--n-raised-shadow), var(--n-press-shade);
}

/* ---------- Footer ---------- */
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-top: calc(var(--space-unit) * 7);
  padding: 0 calc(var(--inset-panel) + var(--card-pad));
}
footer p,
footer p + p {
  margin: 0;
}
.label a {
  color: inherit;
}

/* ---------- Motion: the page's parts rise in, one after another (keyframes from /site/motion.css) ---------- */
.n-rise {
  animation: n-rise var(--t-list) var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  .glow {
    animation: none;
  }
}

/* A list followed by more text closes with a carved line too. */
.n-card ul:not(:last-child) {
  position: relative;
}
.n-card ul:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--n-groove-span);
  margin-bottom: calc(var(--n-groove-span) / -2);
  background: var(--n-groove-across);
}

/* ---------- Nival's legal texts (/terms, /privacy, /impressum: app/legal.py) ---------- */
.n-card h3 {
  margin: calc(var(--space-4) + var(--space-half)) 0 0;
  font-size: var(--fs-reading);
  font-weight: 600;
  line-height: 1.35;
  color: var(--n-ink);
}
.n-card h3 + p {
  margin-top: calc(var(--space-1) + var(--space-half));
}
.n-card > ol {
  margin: var(--space-3) 0 0;
  padding-left: calc(var(--space-5) + var(--space-half));
}
.n-card > ol li {
  padding: var(--space-1) 0;
}
.n-card > ol li::before {
  content: none;
}
.n-card > table {
  width: 100%;
  margin-top: var(--space-3);
  border-collapse: collapse;
  font-size: var(--fs-body);
}
/* A marked note: a draft's point for the lawyer, or a version that isn't the current one. */
.legal-note {
  margin: calc(var(--space-3) + var(--space-half)) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-tile);
  background: var(--n-layer);
  box-shadow: var(--n-edge);
  color: var(--n-ink);
  font-size: var(--fs-body);
  line-height: 1.5;
}
.hero + .legal-note {
  margin: 0 0 var(--inset-panel);
}
.n-card > .legal-note:first-child {
  margin-top: 0;
}
.legal-versions li {
  font-size: var(--fs-body);
}
.legal-table .legal-cell {
  display: block;
  font-size: var(--fs-body);
}
.legal-cell-name {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--n-ink3);
}
/* In a legal text, bold is a word in its sentence (the operator pages' list items start with a
   bold title on a line of its own); a table's row keeps its first cell on a line of its own. */
.legal .n-card li > strong {
  display: inline;
  margin: 0;
}
.legal .legal-table li > strong:first-child {
  display: block;
  margin-bottom: var(--space-half);
}
