:root {
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-2: #eceef2;
  --ink: #15171c;
  --ink-2: #4a505c;
  --ink-3: #737a87;
  --line: #e2e5ea;
  --brand: #1f6bff;
  --brand-ink: #ffffff;
  --brand-hover: #1757d6;
  --brand-soft: #e8f0ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(20 24 31 / 6%), 0 4px 16px rgb(20 24 31 / 6%);
  --max: 1320px;
  --row: 200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --ink: #eef0f4;
    --ink-2: #b4bac6;
    --ink-3: #8a91a0;
    --line: #2a2f39;
    --brand: #4d8bff;
    --brand-hover: #6d9fff;
    --brand-soft: #1a2640;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); font-weight: 750; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo svg { flex: none; }
.logo b { color: var(--brand); font-weight: 700; }
.logo .tld { color: var(--ink-3); font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 550; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.header-search { flex: 0 1 320px; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }

/* Search field */
.search { position: relative; display: flex; }
.search input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid transparent; border-radius: 999px;
  padding: 9px 16px 9px 40px;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--brand); background: var(--bg); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search button { display: none; }
.search--lg input { padding: 16px 20px 16px 52px; font-size: 1.1rem; background: var(--bg); border-color: var(--line); box-shadow: var(--shadow); }
.search--lg svg { left: 20px; }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav, .header-search { display: none; }
  .site-header.open .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .site-header.open .nav { display: flex; flex-direction: column; width: 100%; order: 3; margin: 0; }
  .site-header.open .header-search { display: block; width: 100%; flex-basis: 100%; order: 2; }
}

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); text-align: center; }
.hero h1 { max-width: 16ch; margin: 0 auto .35em; font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); }
.hero p { color: var(--ink-2); font-size: 1.15rem; max-width: 46ch; margin: 0 auto 28px; }
.hero .search { max-width: 640px; margin: 0 auto; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--center { justify-content: center; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 550;
  border: 1px solid transparent;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip[aria-current="page"] { background: var(--ink); color: var(--bg); }
.hero .chips { margin-top: 20px; }

/* Sections */
.section { padding-block: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.page-head { padding: 36px 0 20px; }
.page-head p { color: var(--ink-2); max-width: 65ch; }
.page-head .chips { margin-top: 16px; }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface); color: #fff; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 62%), rgb(0 0 0 / 0%) 55%); }
.tile span { position: absolute; left: 16px; bottom: 12px; z-index: 1; font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.tile small { display: block; font-weight: 500; opacity: .85; font-size: .85rem; }
.tile:hover { color: #fff; }
.tile:hover img { transform: scale(1.04); }

/* Justified photo grid: each item grows in proportion to its aspect ratio (--r) */
.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.grid::after { content: ""; flex-grow: 999999; }
.grid .ph {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius-sm);
  flex: var(--r) 1 calc(var(--r) * var(--row)); background: var(--surface);
}
.grid .ph img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: var(--r); transition: transform .35s ease; }
.grid .ph:hover img { transform: scale(1.03); }
.grid .ph span {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; color: #fff; font-size: .9rem; font-weight: 600;
  background: linear-gradient(to top, rgb(0 0 0 / 60%), transparent); opacity: 0; transition: opacity .2s ease;
}
.grid .ph:hover span, .grid .ph:focus-visible span { opacity: 1; }
.grid .ad { flex: 1 1 100%; }
@media (max-width: 600px) { :root { --row: 150px; } .grid { gap: 6px; } }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 6px; padding: 28px 0 8px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; border-radius: var(--radius-sm); text-align: center; text-decoration: none; color: var(--ink-2); background: var(--surface); font-weight: 600; }
.pager a:hover { color: var(--ink); background: var(--surface-2); }
.pager [aria-current="page"] { background: var(--ink); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.3; text-align: left;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { color: var(--ink); background: var(--surface); }
.btn small { display: block; font-weight: 500; font-size: .8rem; opacity: .8; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: flex-start; }

/* Photo page */
.crumbs { font-size: .9rem; color: var(--ink-3); padding: 16px 0 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.photo { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 16px 0 32px; align-items: start; }
.photo-figure { margin: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.photo-figure img { max-height: 78vh; width: auto; object-fit: contain; }
.photo-info h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.photo-info .desc { color: var(--ink-2); }
.downloads { display: grid; gap: 10px; margin: 20px 0 14px; }
.licence-note { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); background: var(--surface); padding: 12px 14px; border-radius: var(--radius-sm); }
.licence-note svg { flex: none; color: #1f9d55; margin-top: 2px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; margin: 20px 0; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; }
.photo-info .chips { margin-top: 8px; }
@media (max-width: 960px) {
  .photo { grid-template-columns: 1fr; }
  .photo-figure img { max-height: 70vh; }
}

/* Ads: fixed-size, labelled, never adjacent to download buttons */
.ad { margin: 24px auto; text-align: center; max-width: 100%; }
.ad::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.ad ins { display: block; margin: 0 auto; width: 100%; height: 100px; }
.ad--banner ins, .ad--grid ins { height: 100px; }
.ad--rect ins { max-width: 336px; height: 280px; }
@media (min-width: 728px) {
  .ad--banner ins, .ad--grid ins { max-width: 970px; height: 90px; }
}
.ad--placeholder ins { text-decoration: none; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: repeating-linear-gradient(45deg, transparent 0 10px, var(--surface) 10px 20px); display: grid; place-items: center; color: var(--ink-3); font-size: .8rem; }

/* Prose (articles, licence, privacy) */
.prose { max-width: 72ch; margin: 0 auto; padding: 32px 0 48px; }
.prose h1 { margin-bottom: .6em; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose img { border-radius: var(--radius); margin: 24px 0; }
.prose dl dt { font-weight: 700; margin-top: 1.1em; }
.prose dl dd { margin: .2em 0 0; color: var(--ink-2); }
.prose .lede { font-size: 1.15rem; color: var(--ink-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; }
.card h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.card ul { margin: 0; }
.card--yes h2 { color: #1f9d55; }
.card--no h2 { color: #d64545; }

/* Article list */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.article-card { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.article-card:hover { color: var(--ink); box-shadow: var(--shadow); }
.article-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.article-card div { padding: 16px 20px 20px; }
.article-card h3 { margin: 0 0 .4em; }
.article-card p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* Callout */
.callout { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--brand-soft); border-radius: var(--radius); padding: 28px 32px; }
.callout h2 { margin: 0 0 .3em; }
.callout p { margin: 0; color: var(--ink-2); }
@media (max-width: 700px) { .callout { grid-template-columns: 1fr; } }

/* Download page */
.dl { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; max-width: 860px; margin: 0 auto; padding: 40px 0 16px; }
.dl img { border-radius: var(--radius); background: var(--surface); }
.dl form { display: grid; gap: 16px; justify-items: start; }
.dl .error { color: #d64545; font-weight: 600; }
@media (max-width: 700px) { .dl { grid-template-columns: 1fr; } .dl img { max-width: 280px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 36px 0; font-size: .92rem; color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.site-footer p { max-width: 42ch; margin: 10px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-content: flex-start; }
.site-footer nav a { color: var(--ink-2); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer .copy { flex-basis: 100%; }

.empty { padding: 48px 0; text-align: center; color: var(--ink-3); }

@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile span { left: 12px; bottom: 10px; font-size: 1rem; }
}
