:root {
  --orange: #f26119;
  --orange-deep: #e8501b;
  --blue: #0b3fa0;
  --blue-ink: #0e2f73;
  --ink: #1a1a1a;
  --muted: #5b6475;
  --line: #e3e6ec;
  --bg: #fbfaf8;
  --white: #fff;
  --radius-pill: 999px;
  --gap: 24px;
  --per-view: 4;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }

.container {
  width: min(1440px, 100% - 2 * clamp(16px, 5vw, 88px));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 84px;
}
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: 64px; width: auto; display: block; }
.logo-missing {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px dashed #b9c0cc;
  border-radius: 8px;
  padding: 10px 14px;
}

/* Intro */
.intro { padding: clamp(32px, 5vw, 56px) 0 clamp(20px, 3vw, 28px); }
.title {
  margin: 0;
  font-size: clamp(36px, 5.4vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--blue);
}
.lead {
  margin: clamp(22px, 2.6vw, 30px) 0 0;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 500;
  color: var(--muted);
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.search {
  flex: 1 1 360px;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgb(11 63 160 / .1); }
.search svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; }
.search input::placeholder { color: #8a92a1; }

.filters { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 54px;
  padding: 0 28px;
  border: 1px solid #c9ced8;
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 16px;
  font-weight: 600;
  color: #4a5262;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: var(--white); }
.chip:focus-visible, .arrow:focus-visible, .card-link:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Slider */
.slider { position: relative; }
.track {
  list-style: none;
  margin: 0;
  padding: 12px 0 24px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }

.card {
  scroll-snap-align: start;
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.card-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 6.5% / 4.35%;
  cursor: pointer;
  border: 0;
  padding: 0;
  width: 100%;
  background: none;
  transition: transform .35s var(--ease), filter .35s var(--ease);
}
.card-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  user-select: none;
  -webkit-user-drag: none;
}
.card-link:hover { transform: translateY(-6px); filter: drop-shadow(0 18px 24px rgb(14 47 115 / .18)); }

/* Arrow badge sits on the white circle printed on each card */
.card-badge {
  position: absolute;
  left: 78.8%;
  top: 2.1%;
  width: 18.2%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  transition: background .3s, color .3s;
}
.card-badge svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.card-link:hover .card-badge { background: var(--blue); color: var(--white); }
.card-link:hover .card-badge svg { transform: rotate(45deg); }

.empty { margin: 24px 0 48px; color: var(--muted); font-weight: 500; }

/* Pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 20px 0 56px;
}
.count { margin: 0; font-size: 20px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.count strong { font-weight: 800; color: var(--blue); }
.arrows { display: flex; gap: 12px; }
.arrow {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  transition: background .2s, color .2s, opacity .2s;
}
.arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover:not(:disabled) { background: var(--blue); color: var(--white); }
.arrow:disabled { border-color: #c9ced8; color: #b0b6c2; cursor: default; }

/* Viewer */
.viewer {
  border: 0;
  padding: 0;
  background: none;
  overflow: visible;
  max-width: none;
  max-height: none;
}
.viewer::backdrop { background: rgb(10 22 50 / .72); backdrop-filter: blur(4px); }
.viewer[open] { animation: pop .3s var(--ease); }
.viewer-frame {
  position: relative;
  width: min(92vw, calc((100dvh - 120px) * 2 / 3), 600px);
  aspect-ratio: 2 / 3;
}
.viewer-card { display: block; width: 100%; height: 100%; }
/* Close button sits on the card's printed white circle */
.viewer-close {
  position: absolute;
  left: 78.8%;
  top: 2.1%;
  width: 18.2%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.viewer-close:hover { background: var(--blue); color: var(--white); }
.viewer-close svg { width: 42%; height: 42%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.viewer-actions { display: flex; justify-content: center; margin-top: 16px; }
.btn {
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost { border: 1.5px solid rgb(255 255 255 / .7); background: transparent; color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--blue); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

@media (max-width: 1100px) { :root { --per-view: 3; } }
@media (max-width: 820px) {
  :root { --per-view: 2; --gap: 16px; }
  .site-header .container { height: 68px; }
  .logo img { height: 52px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { flex-basis: auto; height: 50px; }
  .chip { height: 44px; padding: 0 18px; font-size: 14px; }
}
@media (max-width: 520px) {
  :root { --per-view: 1.35; --gap: 14px; }
  .count { font-size: 17px; }
  .arrow { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
