/* Videolane — a plain technical reference about video formats and delivery */

:root {
  --bg: #faf9f6;
  --bg-raised: #ffffff;
  --bg-muted: #f0eee8;
  --text: #262420;
  --text-muted: #5a564d;
  --border: #ddd8cc;
  --accent: #7a5c2e;
  --accent-strong: #574019;
  --code-bg: #efece2;
  --max-width: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17;
    --bg-raised: #232119;
    --bg-muted: #29271f;
    --text: #e9e5da;
    --text-muted: #b3ad9c;
    --border: #3a382d;
    --accent: #d9b876;
    --accent-strong: #eccb8e;
    --code-bg: #2c2a20;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
}

.site-header .brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-header .tagline {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Nav */

.site-nav {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Main content */

main {
  padding: 36px 0 56px;
}

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

h1 {
  font-size: 1.8rem;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3rem;
  margin: 2.2em 0 0.6em;
  padding-top: 0.2em;
  border-top: 1px solid var(--border);
}

article > h2:first-of-type,
main h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

h3 {
  font-size: 1.08rem;
  margin: 1.6em 0 0.5em;
}

p {
  margin: 0.9em 0;
}

.lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-top: 0.2em;
}

a {
  color: var(--accent-strong);
}

ul, ol {
  padding-left: 1.3em;
}

li {
  margin: 0.35em 0;
}

code, kbd {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* Tables */

.table-scroll {
  overflow-x: auto;
  margin: 1.2em 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  padding: 10px 14px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

thead th {
  background: var(--bg-muted);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Cards / index grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 1.4em 0;
  padding: 0;
  list-style: none;
}

.card-grid li {
  margin: 0;
}

.card {
  display: block;
  height: 100%;
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

.card:hover,
.card:focus {
  border-color: var(--accent);
}

.card .card-title {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--accent-strong);
}

.card .card-desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Note / callout boxes */

.note {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 1.4em 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.note strong {
  color: var(--text);
}

/* Glossary */

.glossary dt {
  font-weight: 600;
  margin-top: 1.1em;
  color: var(--text);
}

.glossary dt code {
  font-weight: normal;
}

.glossary dd {
  margin: 0.25em 0 0;
  color: var(--text-muted);
}

/* Breadcrumb-ish back link */

.back-link {
  display: inline-block;
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0.3em 0;
}

/* 404 page */

.error-page {
  text-align: center;
  padding: 40px 0;
}

.error-page .error-code {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
}

/* Responsive */

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .site-header {
    padding: 22px 0 16px;
  }

  main {
    padding: 26px 0 40px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .site-nav .wrap {
    gap: 4px 14px;
  }
}
