/*
 * developers.packeroo.com. The tokens are a copy of the app's (frontend/src/styles/app.css,
 * docs/design/design-guidelines.md): paper, anthracite and grey, lime only for the main action.
 * Light by default, dark where the device asks for it. Fonts are served from this site.
 */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/outfit-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: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/outfit-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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-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: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-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 {
  color-scheme: light;
  --background: #f6f6ef;
  --foreground: #1e1f1a;
  --card: #ffffff;
  --muted: #eeeee3;
  --muted-foreground: #5c5d54;
  --accent: #f3f3c2;
  --border: #e4e4d8;
  --input: #8a8b80;
  --ring: #5c5c00;
  --primary: #cccc00;
  --primary-hover: #d8d81a;
  --primary-foreground: #26271f;
  --brand: #5c5c00;
  --inverse: #26271f;
  --inverse-foreground: #ffffff;
  --destructive: #a32a1a;
  --info-soft: #e9eef3;
  --code-background: #26271f;
  --code-foreground: #f6f6ef;
  --elevation-card: 0 1px 2px rgb(38 39 31 / 0.06), 0 6px 20px rgb(38 39 31 / 0.07);

  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  --header-height: 60px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #1e1f19;
    --foreground: #f6f6ef;
    --card: #2a2b23;
    --muted: #33342b;
    --muted-foreground: #a9aa9c;
    --accent: #3a3b1a;
    --border: #3b3c32;
    --input: #7d7e72;
    --ring: #d6d63a;
    --brand: #d6d63a;
    --inverse: #3b3c32;
    --inverse-foreground: #f6f6ef;
    --destructive: #f08a7a;
    --info-soft: #262c33;
    --code-background: #15160f;
    --code-foreground: #f6f6ef;
    --elevation-card: 0 1px 2px rgb(0 0 0 / 0.3);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 400 16px/1.55 var(--font-sans);
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

a:hover {
  color: var(--brand);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--inverse);
  color: var(--inverse-foreground);
  border-radius: 8px;
}

.skip:focus {
  top: 8px;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-height);
  padding: 0 var(--gutter);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.wordmark {
  display: block;
  height: 20px;
  width: auto;
}

.brand-label {
  font: 600 13px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.top-nav {
  display: none;
  gap: 2px;
  margin-left: auto;
}

.top-nav a,
.menu nav a {
  font: 600 15px/1 var(--font-display);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--foreground);
}

.top-nav a:hover,
.menu nav a:hover {
  background: var(--muted);
  color: var(--foreground);
}

.top-nav a[aria-current='page'],
.menu nav a[aria-current='page'] {
  background: var(--accent);
  font-weight: 700;
}

.lang {
  display: flex;
  align-items: center;
  min-height: 44px;
  font: 600 14px/1 var(--font-display);
  text-decoration: none;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-left: auto;
}

.top-nav a.to-app {
  border: 1px solid var(--input);
  margin-left: 8px;
}

.menu nav a.to-app {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}

.menu {
  position: relative;
}

.menu summary {
  list-style: none;
  cursor: pointer;
  font: 600 15px/1 var(--font-display);
  padding: 14px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu[open] summary {
  background: var(--muted);
}

.menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--elevation-card);
}

.menu nav a {
  padding: 13px 12px;
}

@media (min-width: 960px) {
  :root {
    --gutter: 28px;
  }
  .brand {
    margin-right: 12px;
  }
}

/* The whole list fits in the header from here; below, the same list is in the menu. */
@media (min-width: 1240px) {
  .top-nav {
    display: flex;
    align-items: center;
  }
  .lang {
    margin-left: 4px;
  }
  .menu {
    display: none;
  }
}

/* Text */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.2;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 12px;
}

@media (min-width: 960px) {
  h1 {
    font-size: 38px;
  }
}

.prose h2 {
  font-size: 23px;
  font-weight: 650;
  margin: 48px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 8px;
}

.prose h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.prose h2 .anchor,
.prose h3 .anchor,
.prose h4 .anchor {
  text-decoration: none;
}

.prose p,
.prose li {
  max-width: 70ch;
}

.prose li + li {
  margin-top: 6px;
}

.lead {
  font-size: 18px;
  color: var(--muted-foreground);
  max-width: 62ch;
  margin: 0 0 8px;
}

.eyebrow {
  font: 600 12px/1 var(--font-display);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 14px;
}

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--muted);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.prose blockquote {
  margin: 20px 0;
  padding: 2px 18px;
  border-left: 3px solid var(--primary);
  background: var(--card);
  border-radius: 0 12px 12px 0;
}

/* Hint: planned */

.planned {
  margin: 24px 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}

.planned > :first-child {
  margin-top: 0;
}

.planned > :last-child {
  margin-bottom: 0;
}

.planned {
  background: var(--info-soft);
  border-color: transparent;
}

/* Tables scroll in themselves */

.table {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font: 600 12px/1.3 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

/* Code */

.code {
  position: relative;
  margin: 16px 0 24px;
}

.code pre {
  margin: 0;
  padding: 52px 18px 16px;
  overflow: auto;
  max-height: 560px;
  background: var(--code-background);
  color: var(--code-foreground);
  border-radius: 12px;
  font: 13.5px/1.6 var(--font-mono);
  tab-size: 4;
}

.code pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 18px;
  left: 18px;
  font: 600 12px/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a9aa9c;
}

.code pre:focus-visible {
  outline-offset: 3px;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font: 600 13px/1 var(--font-display);
  min-height: 36px;
  padding: 0 12px;
  color: var(--code-foreground);
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 8px;
  cursor: pointer;
}

.copy:hover {
  background: rgb(255 255 255 / 0.16);
}

.copy:focus-visible {
  outline-color: var(--primary);
}

/* Language tabs */

.tabs {
  margin: 20px 0 28px;
}

.tablist {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  background: var(--muted);
  border-radius: 12px;
  scrollbar-width: thin;
}

.tablist button {
  flex: 0 0 auto;
  font: 600 14px/1 var(--font-display);
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.tablist button:hover {
  background: var(--card);
}

.tablist button[aria-selected='true'] {
  background: var(--card);
  box-shadow: var(--elevation-card);
  font-weight: 700;
}

.tab-note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted-foreground);
}

.tabs .code {
  margin-top: 10px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font: 600 16px/1 var(--font-display);
  text-decoration: none;
}

.button.primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

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

.button.quiet {
  color: var(--foreground);
  border: 1px solid var(--input);
}

.button.quiet:hover {
  background: var(--muted);
  color: var(--foreground);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

/* Home */

.home {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

.hero {
  display: grid;
  gap: 32px;
  padding: 40px 0 24px;
}

.hero h1 {
  font-size: 34px;
  max-width: 18ch;
}

.hero .lead {
  font-size: 18px;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 56px;
    padding: 72px 0 40px;
  }
  .hero h1 {
    font-size: 50px;
  }
}

/* The display of a table while it waits for its code: what the guide asks a device to show. */
.display {
  margin: 0;
}

.display-screen {
  background: #15160f;
  color: #f6f6ef;
  border-radius: 20px;
  padding: 28px 24px 24px;
  border: 10px solid #2b2c26;
  text-align: center;
}

.display-title {
  font: 600 15px/1.3 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  color: #d6d63a;
}

.display-code {
  display: flex;
  justify-content: center;
  gap: 0.45em;
  margin: 18px 0;
  font: 800 clamp(44px, 12vw, 68px)/1 var(--font-display);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.display-hint {
  margin: 0;
  font-size: 15px;
  color: #c9cabd;
}

.display figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.home-body {
  max-width: 820px;
}

/* Steps on the home page: the first ordered list. */
.home-body ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 20px 0;
}

.home-body ol > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 56px;
  margin: 0 0 22px;
  max-width: none;
}

.home-body ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--inverse);
  color: var(--inverse-foreground);
  font: 700 18px/1 var(--font-display);
}

/* A list of links with a line between them, for "what you find here". */
.links ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  border-top: 1px solid var(--border);
}

.links li {
  margin: 0;
  max-width: none;
  border-bottom: 1px solid var(--border);
}

.links li + li {
  margin-top: 0;
}

.links li a {
  display: block;
  padding: 16px 0 4px;
  font: 600 18px/1.3 var(--font-display);
  text-decoration: none;
}

.links li a::after {
  content: ' →';
  color: var(--brand);
}

.links li p,
.links li > :not(a):not(p) {
  margin: 0;
}

.links li {
  padding-bottom: 14px;
  color: var(--muted-foreground);
}

/* Docs: side navigation and content */

.docs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

.side {
  display: none;
}

.docs main {
  padding-top: 32px;
  min-width: 0;
}

@media (min-width: 960px) {
  .docs {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 56px;
  }
  .side {
    display: block;
    position: sticky;
    top: var(--header-height);
    align-self: start;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 32px 0;
  }
  .side ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .side > ul > li > a {
    display: block;
    font: 600 15px/1.3 var(--font-display);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
  }
  .side a[aria-current='page'] {
    background: var(--accent);
    font-weight: 700;
  }
  .side > ul > li > a:hover {
    background: var(--muted);
    color: var(--foreground);
  }
  .side li ul {
    margin: 4px 0 10px 12px;
    border-left: 1px solid var(--border);
  }
  .side li ul a {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    padding: 6px 12px;
    text-decoration: none;
    color: var(--muted-foreground);
  }
  .side li ul a:hover {
    color: var(--foreground);
  }
}

.page-source {
  margin-top: 56px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.not-found {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px var(--gutter);
}

/* Footer */

.foot {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 28px var(--gutter) 40px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.foot ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.foot a {
  display: inline-block;
  padding: 6px 0;
}

.foot-contact {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Search */

.search {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}

.search label {
  font-weight: 600;
}

.search input {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: inherit;
  max-width: 560px;
}

.search-status {
  color: var(--muted-foreground);
}

.search-results {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 16px;
}

.search-results a {
  font-weight: 600;
}

.search-results p {
  margin: 4px 0 0;
  color: var(--muted-foreground);
}
