/*
 * Shared frame of the package documentation pages, in the Studio Nordwerk design (tokens and
 * building blocks from the studio site, 21.09.2026): one grotesque (Geist, self-hosted), black
 * pill buttons, grey panels instead of hairlines, a white sheet over a dark footer. Light only.
 * Pages add their own stylesheet after this one. www.nordwerk.studio puts its header and footer
 * at the placeholders, so never style the studio's class names here (see AGENTS.md).
 */

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  /* optional: a late font would shift the text, and this page measures layout shift */
  font-display: optional;
  font-weight: 100 900;
  src: url(fonts/geist-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: optional;
  font-weight: 100 900;
  src: url(fonts/geist-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ground: #ffffff;
  --surface: #ffffff;
  --sunken: #f3f4f1;
  --panel-2: #ebece8;
  --ink: #141513;
  --ink-2: #3b3d39;
  --muted: #6d706a;
  --faint: #b9bcb5;
  --line: #e7e8e4;
  --pill: rgba(236, 237, 233, 0.72);
  --accent: #2e5747;
  --accent-soft: #e3ece6;
  --mark-dot: #8fb59b;
  --footer: #121311;
  --footer-ink: #e9eae5;
  --footer-muted: #8d9089;
  --sale: #b42318;
  --star: #b87d09;
  --shadow: 0 1px 2px rgba(20, 21, 19, 0.04), 0 12px 32px -12px rgba(20, 21, 19, 0.14);
  --font: 'Geist Variable', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w-display: 640;
  --w-strong: 580;
  --track-display: -0.035em;
  --page-wrap: 1120px;
  --sc-focus: var(--accent);
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--footer);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--ground);
}

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

[id] {
  scroll-margin-top: 96px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The white sheet lies over the dark footer with round lower corners. */
.sheet {
  position: relative;
  z-index: 1;
  background: var(--ground);
  border-radius: 0 0 36px 36px;
  overflow: clip;
}

.page {
  max-width: var(--page-wrap);
  margin-inline: auto;
  padding-inline: 20px;
  padding-block: 0 clamp(72px, 9vw, 112px);
}

/* --- Building blocks from the studio design ------------------------------------------------ */

.nw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: var(--w-strong);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease;
}

.nw-btn:hover {
  opacity: 0.88;
}

.nw-btn-line {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.nw-btn-line:hover {
  opacity: 1;
  border-color: var(--faint);
}

.nw-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: var(--w-strong);
}

.nw-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Introduction ------------------------------------------------------------------------- */

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-block: clamp(64px, 10vw, 120px) clamp(40px, 6vw, 64px);
  text-align: center;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1;
  font-weight: var(--w-display);
  letter-spacing: var(--track-display);
}

.intro .lede {
  max-width: 50ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.2rem);
  line-height: 1.5;
  text-wrap: balance;
}

.intro .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.install {
  display: inline-flex;
  align-items: center;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-2);
  font: 14px var(--mono);
}

.sizes {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.sizes b {
  color: var(--ink);
  font-weight: var(--w-strong);
  font-variant-numeric: tabular-nums;
}

.intro .note {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

/* --- Examples ----------------------------------------------------------------------------- */

.case {
  display: grid;
  gap: 16px;
  padding-block: clamp(56px, 7vw, 88px) 0;
}

/* Grid children would otherwise grow to their widest content, such as a long line of code. */
.case > * {
  min-width: 0;
}

.case-head h2,
.patterns > .case-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  line-height: 1.08;
  font-weight: var(--w-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.case-head p {
  max-width: 70ch;
  margin: 10px 0 0;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- Toast: a short message for things the page only pretends to do ---------------------- */

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toast.is-shown {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

/* --- Closing: the package's facts and links ------------------------------------------------ */

.closing {
  display: grid;
  gap: 12px;
  margin-top: clamp(64px, 8vw, 96px);
  padding: clamp(22px, 3vw, 32px);
  border-radius: 24px;
  background: var(--sunken);
}

.closing h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: var(--w-strong);
  letter-spacing: -0.01em;
}

.closing p {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
}

.closing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.closing-links a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

.closing-links a:hover {
  text-decoration-color: var(--ink);
}

/* --- Code ------------------------------------------------------------------------------- */

.code summary {
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  font-weight: var(--w-strong);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  cursor: pointer;
}

.code pre {
  margin: 10px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 18px;
  background: var(--sunken);
  font: 13px/1.6 var(--mono);
}

.code pre::before {
  content: attr(data-lang);
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.copy-block pre {
  margin: 6px 0 0;
  padding: 16px 18px;
  max-height: 22rem;
  overflow: auto;
  border-radius: 18px;
  background: var(--sunken);
  font: 13px/1.6 var(--mono);
}

.copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.case-head code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--sunken);
  font: 0.85em var(--mono);
}

.block-install {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.block-install code {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--sunken);
  color: var(--ink);
  font: 13px var(--mono);
  overflow-wrap: anywhere;
}
