/* Fairfolio — the "Industry" blueprint design system, hand-translated for the
   server-rendered Jinja pages. Tokens and component classes below mirror the
   design-system source; the app-specific layout follows underneath. */

/* Barlow is bundled under the SIL Open Font License in OFL-Barlow.txt. */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/barlow-400-latin-ext.woff2") format("woff2");
  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: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/barlow-400-latin.woff2") format("woff2");
  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: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/barlow-500-latin-ext.woff2") format("woff2");
  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: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/barlow-500-latin.woff2") format("woff2");
  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: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/barlow-700-latin-ext.woff2") format("woff2");
  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: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/barlow-700-latin.woff2") format("woff2");
  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: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/barlow-condensed-400-latin-ext.woff2") format("woff2");
  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: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/barlow-condensed-400-latin.woff2") format("woff2");
  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: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/barlow-condensed-600-latin-ext.woff2") format("woff2");
  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: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/barlow-condensed-600-latin.woff2") format("woff2");
  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;
}

/* ── tokens ───────────────────────────────────────────────────────────── */
:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);

  --color-neutral-100: #f5f5f8;
  --color-neutral-200: #e7e7ea;
  --color-neutral-800: #424244;
  --color-neutral-900: #2b2b2d;

  --color-accent-100: #eef6ff;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, sans-serif;

  --space-1: 3.4px;
  --space-2: 6.8px;
  --space-3: 10.2px;
  --space-4: 13.6px;
  --space-6: 20.4px;
  --space-8: 27.2px;

  --radius-md: 4px;
  --radius-lg: 7px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2b2b2d 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2b2b2d 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2b2b2d 22%, transparent);

  --danger: #8c3b32;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
}
main { flex: 1; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
p { margin: 0 0 var(--space-3); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
button, input, select { font: inherit; }

a { color: var(--color-accent-700); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent); text-decoration: underline; }
::placeholder { color: color-mix(in srgb, var(--color-text) 45%, transparent); }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.sr-only {
  clip: rect(0, 0, 0, 0);
  height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; white-space: nowrap; width: 1px;
}
.skip-link {
  background: var(--color-bg); border: 1px solid var(--color-accent);
  left: var(--space-3); padding: var(--space-2) var(--space-3);
  position: absolute; top: -100px; z-index: 40;
}
.skip-link:focus { top: var(--space-3); }
.text-muted, .note { color: color-mix(in srgb, var(--color-text) 55%, transparent); }

/* ── page transitions ─────────────────────────────────────────────────── */
/* One transition only: the card you clicked morphs into the project page, so
   the thing you picked stays visually continuous with the thing you get. Every
   other navigation is left alone deliberately — motion for its own sake makes a
   research tool feel slower than it is.

   Opting in inside the media query is the whole reduced-motion story: no
   transition is ever started, rather than started and then suppressed. Browsers
   without cross-document view transitions simply navigate as before, so this
   stays additive (site.js assigns the names; with JS off you get a plain load). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
/* Snapshots default to object-fit: fill, which warps a thumbnail on the way to
   the detail page's larger frame. The card crops the same way, so cover matches. */
::view-transition-old(project-thumb),
::view-transition-new(project-thumb) { object-fit: cover; }
/* The title changes size and measure between the two pages; cross-fading the
   snapshots reads better than scaling one set of glyphs into another. */
::view-transition-old(project-title),
::view-transition-new(project-title) { height: 100%; object-fit: contain; }

/* ── blueprint frame ──────────────────────────────────────────────────── */
.blueprint { border: 1px solid var(--color-divider); border-radius: 0; position: relative; }
.blueprint.duotone { overflow: visible; }
.blueprint > .corner {
  color: color-mix(in srgb, var(--color-text) 38%, transparent);
  height: 11px; position: absolute; width: 11px;
}
.blueprint > .corner::before,
.blueprint > .corner::after { background: currentColor; content: ""; position: absolute; }
.blueprint > .corner::before { height: 100%; left: 5px; top: 0; width: 1px; }
.blueprint > .corner::after { height: 1px; left: 0; top: 5px; width: 100%; }
.blueprint > .corner.tl { left: -6px; top: -6px; }
.blueprint > .corner.tr { right: -6px; top: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

.duotone { overflow: hidden; position: relative; }
.duotone::after {
  background: var(--color-accent); content: ""; inset: 0;
  mix-blend-mode: color; pointer-events: none; position: absolute;
}

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  align-items: center; background: transparent;
  border: 1px solid var(--color-divider); border-radius: 0;
  color: var(--color-text); cursor: pointer; display: inline-flex; gap: 6px;
  font-family: var(--font-heading); font-size: 14px; font-weight: var(--font-heading-weight);
  justify-content: center; line-height: 1.2;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-primary > .corner { color: color-mix(in srgb, var(--color-bg) 55%, transparent); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-ghost { border-color: transparent; color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }

/* ── forms ────────────────────────────────────────────────────────────── */
.input {
  background: var(--color-neutral-100); border: 1px solid var(--color-divider);
  border-radius: 0; caret-color: var(--color-accent); color: var(--color-text);
  font-size: 14px; min-height: 36px; padding: 6px 10px; width: 100%;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.select-field { position: relative; }
.select-field select.input { appearance: none; cursor: pointer; padding-right: 26px; }
.select-caret {
  color: var(--color-accent-700); font-size: 10px; pointer-events: none;
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
}

/* ── cards & tags ─────────────────────────────────────────────────────── */
.card {
  background: transparent; border: 1px solid var(--color-divider); border-radius: 0;
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
}
.card-kicker {
  color: var(--color-accent); font-size: 10px; letter-spacing: .1em;
  margin: 0; text-transform: uppercase;
}
.card-title {
  font-family: var(--font-heading); font-size: 17px;
  font-weight: var(--font-heading-weight); line-height: 1.2; margin: 0;
}
.card-body { flex: 1; font-size: 13px; margin: 0; opacity: .8; }
.card-meta {
  align-items: center; color: color-mix(in srgb, var(--color-text) 50%, transparent);
  display: flex; flex-wrap: wrap; font-size: 11px; gap: 6px; margin: 0;
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

.tag {
  align-items: center; border-radius: 0; display: inline-flex;
  font-size: 11px; letter-spacing: .02em; padding: 3px 10px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-3); }

/* ── header ───────────────────────────────────────────────────────────── */
.nav {
  align-items: center; background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider); display: flex; flex-wrap: wrap;
  gap: var(--space-4); padding: var(--space-3) var(--space-6);
  position: sticky; top: 0; z-index: 20;
}
.nav-brand {
  color: var(--color-text); font-family: var(--font-heading); font-size: 23px;
  font-weight: var(--font-heading-weight); letter-spacing: .01em;
}
.nav-brand:hover { color: var(--color-text); text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.nav-links a, .nav-account a { color: var(--color-text); font-size: 14px; }
.nav-links a:hover, .nav-account a:hover { color: var(--color-accent); }
.nav-links a[aria-current], .nav-account a[aria-current] { color: var(--color-accent-700); }
.nav-account {
  align-items: center; display: flex; flex-wrap: wrap;
  gap: var(--space-3); margin-left: auto;
}
.avatar {
  align-items: center; background: var(--color-accent-100); border-radius: 50%;
  color: var(--color-accent-800); display: inline-flex; font-family: var(--font-heading);
  font-size: 14px; height: 30px; justify-content: center; width: 30px;
}
.account-name { font-size: 13px; }
.site-footer { border-top: 1px solid var(--color-divider); }
.site-footer-inner {
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  display: flex; font-size: 12px; justify-content: space-between;
  margin: 0 auto; max-width: 1160px; padding: var(--space-6);
}

/* ── page shells ──────────────────────────────────────────────────────── */
.page { margin: 0 auto; padding: 0 var(--space-6) 80px; }
.page-wide { max-width: 1160px; }
.page-narrow { max-width: 760px; padding-top: var(--space-8); }
.hero { max-width: 680px; padding: 64px 0 32px; }
.hero h1 { font-size: 44px; margin: 0 0 12px; }
.lede {
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  font-size: 17px; margin: 0 0 var(--space-8); max-width: 70ch;
}
.back-link { display: inline-block; font-size: 13px; margin: var(--space-6) 0 var(--space-6); }

.filter-note { margin: calc(var(--space-3) * -1) 0 var(--space-6); }

/* ── landing ──────────────────────────────────────────────────────────── */
.landing-hero { border-bottom: 1px solid var(--color-divider); padding: 72px 0 48px; position: relative; }
/* The copy keeps its old measure; only the montage and rule run full width. */
.landing-hero-body { max-width: 780px; position: relative; z-index: 2; }

/* Decorative montage of real project thumbnails. Everything here is inert:
   pointer-events off, aria-hidden in the markup, and no layout depends on it,
   so a blocked or 404ing third-party image costs nothing but a gap. */
.hero-montage {
  bottom: 0; left: 0; opacity: .34; overflow: hidden; pointer-events: none;
  position: absolute; right: 0; top: 0; user-select: none; z-index: 0;
  /* Fade the strip out top and bottom so it has no hard edge against the nav. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
}
/* Same accent duotone the discovery cards use, so a wall of unrelated source
   photography still reads as one surface instead of a collage. */
.hero-montage::after {
  background: var(--color-accent); content: ""; inset: 0;
  mix-blend-mode: color; pointer-events: none; position: absolute;
}
.hero-montage-row {
  display: flex; gap: 10px; margin-bottom: 10px; width: max-content;
  animation: montage-drift-left 110s linear infinite;
}
.hero-montage-row:nth-child(2) { animation: montage-drift-right 140s linear infinite; }
.hero-montage-row:nth-child(3) { animation-duration: 125s; }
.hero-montage-row img {
  display: block; filter: grayscale(1) contrast(1.15) brightness(.97);
  height: 108px; object-fit: cover; width: 148px;
}
/* Each row holds its tiles twice, so -50% lands exactly on the repeat. */
@keyframes montage-drift-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes montage-drift-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
/* Scrim: opaque under the copy, clearing toward the right so the montage
   reads as a background rather than a texture behind the words. */
.landing-hero::before {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--color-bg) 93%, transparent) 0%,
    color-mix(in srgb, var(--color-bg) 88%, transparent) 38%,
    color-mix(in srgb, var(--color-bg) 62%, transparent) 72%,
    color-mix(in srgb, var(--color-bg) 40%, transparent) 100%
  );
  bottom: 0; content: ""; left: 0; pointer-events: none; position: absolute;
  right: 0; top: 0; z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hero-montage-row { animation: none; }
}
@media print {
  .hero-montage { display: none; }
}
.eyecrumb {
  color: var(--color-accent-700); font-family: var(--font-heading); font-size: 13px;
  letter-spacing: .14em; margin: 0 0 var(--space-4); text-transform: uppercase;
}
.landing-hero h1 { font-size: 60px; line-height: 1.02; margin: 0 0 var(--space-4); }
.landing-hero .lede { font-size: 19px; margin-bottom: var(--space-8); }
.landing-search { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); max-width: 620px; }
.landing-search .input { box-shadow: var(--shadow-sm); flex: 1; font-size: 16px; min-height: 48px; }
.landing-search .btn { min-height: 48px; padding-left: var(--space-8); padding-right: var(--space-8); }
.landing-actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; }
.text-link { font-family: var(--font-heading); font-size: 14px; }
.archive-stats {
  align-items: center; color: color-mix(in srgb, var(--color-text) 60%, transparent);
  display: flex; flex-wrap: wrap; font-size: 13px; gap: var(--space-6);
  margin: var(--space-6) 0 0;
}
.landing-hero [data-count-up] { font-variant-numeric: tabular-nums; }

.landing-section { margin-bottom: 56px; }
.landing-hero + .landing-section { margin-top: 48px; }
.landing-section .section-heading { align-items: baseline; }
.field-grid {
  display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  list-style: none; margin: 0 0 var(--space-4); padding: 0;
}
/* Field names wrap to two lines at some widths; stretching the cell keeps the
   registration marks on one line across the row. */
.field-grid li { display: flex; }
.field-link {
  align-items: baseline; border: 1px solid var(--color-divider); color: var(--color-text);
  display: flex; flex: 1; gap: var(--space-3); justify-content: space-between;
  padding: var(--space-4);
}
.field-link:hover {
  background: var(--color-accent-100); border-color: var(--color-accent); text-decoration: none;
}
.field-name { font-family: var(--font-heading); font-size: 17px; }
.field-count { color: color-mix(in srgb, var(--color-text) 50%, transparent); font-size: 13px; }

.why-body p { color: color-mix(in srgb, var(--color-text) 70%, transparent); max-width: 62ch; }

.landing-cta {
  align-items: center; border-top: 1px solid var(--color-divider); display: flex;
  flex-wrap: wrap; gap: var(--space-6); justify-content: space-between; padding-top: var(--space-8);
}
.landing-cta h2 { font-size: 30px; margin: 0; }

/* ── fair editions ────────────────────────────────────────────────────── */
/* The corpus holds several years of the same fair; the year has to be the
   loudest thing in the row or five ISEF cards read as five different fairs. */
.edition-list { list-style: none; margin: var(--space-4) 0; padding: 0; }
.edition-list li { border-top: 1px solid var(--color-divider); }
.edition-list li:last-child { border-bottom: 1px solid var(--color-divider); }
.edition-list a {
  align-items: baseline; color: var(--color-text); display: flex;
  gap: var(--space-3); padding: var(--space-2) 0;
}
.edition-list a:hover { color: var(--color-accent-800); text-decoration: none; }
.edition-year {
  font-family: var(--font-heading); font-size: 18px;
  font-weight: var(--font-heading-weight); min-width: 3.2em;
}
.edition-count { font-size: 13px; }
.edition-place {
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  font-size: 12px; margin-left: auto; text-align: right;
}
.edition-grid {
  display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  list-style: none; margin: 0 0 var(--space-4); padding: 0;
}
.edition-grid li { display: flex; }
.edition-link {
  border: 1px solid var(--color-divider); color: var(--color-text); display: flex;
  flex: 1; flex-direction: column; gap: 2px; padding: var(--space-4);
}
.edition-link:hover {
  background: var(--color-accent-100); border-color: var(--color-accent); text-decoration: none;
}
.edition-link .edition-year { font-size: 24px; }
.edition-link .edition-place { margin-left: 0; text-align: left; }

/* ── explore filters ──────────────────────────────────────────────────── */
.filter-bar {
  align-items: center; border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider); display: flex; flex-wrap: wrap;
  gap: var(--space-3); margin-bottom: var(--space-6); padding: var(--space-4) 0;
}
.filter-bar .search-input {
  box-shadow: var(--shadow-sm); flex: 1 1 260px; font-size: 15px; min-height: 44px;
}
.filter-bar .select-field { flex: 0 1 auto; }
/* Fair and category names run long ("Regeneron International Science and
   Engineering Fair"), so the control is capped rather than the label trimmed. */
.filter-bar select.input {
  font-size: 13px; max-width: 220px; min-height: 36px;
  text-overflow: ellipsis; width: auto;
}
.result-summary {
  align-items: center; display: flex; flex-wrap: wrap;
  gap: var(--space-3); margin-bottom: var(--space-6);
}
.result-count { color: color-mix(in srgb, var(--color-text) 60%, transparent); font-size: 13px; }
.result-range { white-space: nowrap; }
.chip { gap: 6px; }
.chip:hover { background: var(--color-accent-100); text-decoration: none; }
.pagination {
  align-items: center; display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center;
  margin-top: var(--space-8);
}
.pagination-pages { align-items: center; display: inline-flex; gap: 4px; }
.pagination-page, .pagination-jump {
  align-items: center; border: 1px solid transparent; color: var(--color-text);
  display: inline-flex; font-family: var(--font-heading); font-size: 13px;
  height: 32px; justify-content: center; min-width: 32px; padding: 0 7px;
}
.pagination-page:hover, .pagination-jump:hover {
  background: var(--color-accent-100); border-color: var(--color-accent);
  color: var(--color-accent-800); text-decoration: none;
}
.pagination-page.is-current {
  background: var(--color-accent); border-color: var(--color-accent);
  color: white;
}
.pagination-jump { border-color: var(--color-divider); }
.pagination-ellipsis { padding: 0 3px; }
.pagination-status { color: color-mix(in srgb, var(--color-text) 60%, transparent); font-size: 13px; }
.pagination .is-disabled { opacity: .45; pointer-events: none; }

.fair-projects { margin-top: var(--space-8); }
.section-heading {
  align-items: end; display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between; margin-bottom: var(--space-6);
}
.section-heading h2 { margin-bottom: var(--space-2); }
.fair-award-filter { align-items: center; display: flex; gap: var(--space-2); }

/* ── project grid ─────────────────────────────────────────────────────── */
.project-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.project-grid-compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { padding: 18px; }
.project-card:hover { box-shadow: var(--shadow-md); }
.card-head { align-items: flex-start; display: flex; gap: var(--space-3); justify-content: space-between; }
.thumb {
  border: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
  display: block; flex-shrink: 0; height: 32px; overflow: hidden; width: 32px;
}
.thumb img { height: 100%; object-fit: cover; width: 100%; }
.thumb[hidden] { display: none; }
.project-card .card-title {
  -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3;
  margin-bottom: var(--space-2); overflow: hidden;
}
.card-link { color: inherit; }
/* The whole card is clickable, but the anchor stays the only real link so
   keyboard and middle-click behave natively. */
.card-link::after { content: ""; inset: 0; position: absolute; }
.card-link:hover { color: var(--color-accent-700); text-decoration: none; }
.project-card .card-body {
  -webkit-box-orient: vertical; display: -webkit-box; -webkit-line-clamp: 3; overflow: hidden;
}
.card-foot {
  align-items: center; display: flex; justify-content: space-between;
  margin-top: var(--space-4);
}
.card-cta { color: var(--color-accent-700); font-size: 12px; }
.save-button {
  align-items: center; background: none; border: none; border-radius: 50%;
  color: color-mix(in srgb, var(--color-text) 55%, transparent); cursor: pointer;
  display: flex; font-size: 18px; height: 34px; justify-content: center;
  line-height: 1; padding: 0; position: relative; transition: background .15s ease; width: 34px;
  z-index: 1;
}
.save-button:hover { background: var(--color-accent-100); }
.save-button.saved { color: var(--color-accent); }
.save-button.saved { animation: heartPop .4s ease; }
@keyframes heartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  65% { transform: scale(.88); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .save-button.saved { animation: none; }
}

/* ── project detail ───────────────────────────────────────────────────── */
.project-detail h1 {
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.25;
  margin: 0 0 var(--space-4); text-wrap: pretty;
}
.byline {
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  font-size: 14px; margin: 0 0 var(--space-6);
}
.detail-actions {
  border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-8); padding: var(--space-4) 0;
}
/* The detail Save is the same control as the card heart, dressed as the
   primary button, so it has to win back what .save-button stripped. */
.save-button-lg {
  background: var(--color-accent); border: 1px solid var(--color-accent); border-radius: 0;
  color: var(--color-bg); font-size: 14px; gap: 8px; height: auto;
  padding: var(--space-2) calc(var(--space-3) * 1.2); width: auto;
}
.save-button-lg:hover, .save-button-lg.saved { background: var(--color-accent-600); color: var(--color-bg); }
.save-button-lg [data-save-glyph] { font-size: 16px; }
.detail-image { margin-bottom: var(--space-8); width: 100%; }
.detail-image img {
  display: block; height: auto; margin: 0 auto; max-height: min(70vh, 640px);
  max-width: 100%; width: auto;
}
.detail-section { margin-bottom: var(--space-8); }
.detail-section h2 { font-size: 16px; margin-bottom: var(--space-3); }
.prose { font-size: 16px; line-height: 1.7; max-width: 64ch; text-wrap: pretty; white-space: pre-line; }
.award-list, .history-list, .resource-list, .breakdown {
  display: flex; flex-direction: column; gap: var(--space-2); list-style: none; margin: 0; padding: 0;
}
.award-list li { align-items: center; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.award-tag { font-size: 12px; line-height: 1.5; max-width: 100%; white-space: normal; }
.award-cash { color: color-mix(in srgb, var(--color-text) 55%, transparent); font-size: 12px; }
.award-pending {
  color: color-mix(in srgb, var(--color-text) 45%, transparent);
  font-size: 11px; font-style: italic;
}
.history-list { gap: var(--space-3); }
.history-item { padding: 14px 18px; width: fit-content; }
.resource-list { gap: var(--space-1); }
.external::after { content: ""; }
.note-panel { border: 1px solid var(--color-divider); padding: var(--space-4); }
.note-panel h2 { color: color-mix(in srgb, var(--color-text) 65%, transparent); margin-bottom: var(--space-1); }
.note-panel p { color: color-mix(in srgb, var(--color-text) 55%, transparent); font-size: 13px; margin: 0; }
.source-line {
  border-top: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  font-size: 12px; padding-top: var(--space-6);
}

/* ── fairs ────────────────────────────────────────────────────────────── */
.fair-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.fair-card { padding: 22px; }
.fair-card .card-title { font-size: 20px; }
.breakdown { max-width: 640px; }
.breakdown li { align-items: center; display: flex; gap: var(--space-3); }
.breakdown-label {
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  flex-shrink: 0; font-size: 12px; width: 220px;
}
.breakdown-track { background: var(--color-neutral-200); flex: 1; height: 8px; position: relative; }
.breakdown-fill { background: var(--color-accent); inset: 0 auto 0 0; position: absolute; }
.breakdown-count {
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-size: 12px; text-align: right; width: 34px;
}

/* ── saved library ────────────────────────────────────────────────────── */
.library-layout { align-items: start; display: grid; gap: var(--space-8); grid-template-columns: 220px 1fr; }
.folder-rail { display: flex; flex-direction: column; gap: var(--space-1); }
.folder-row { align-items: center; display: flex; gap: 6px; }
.folder-select {
  border: 1px solid var(--color-divider); color: var(--color-text); flex: 1;
  font-size: 13px; padding: 8px 10px;
}
.folder-select:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); text-decoration: none; }
.folder-select.is-active { background: var(--color-accent-100); border-color: var(--color-accent); }
.folder-count { color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.folder-contents h2 { font-size: 16px; margin-bottom: var(--space-6); }
.folder-create { display: flex; gap: 6px; margin-top: var(--space-3); }
.folder-create.standalone { max-width: 320px; }
.folder-create .input { min-height: 32px; }
.folder-create .btn { padding: 0 10px; }
.sign-in-panel { margin: 40px auto; max-width: 440px; padding: 32px; text-align: center; }
.sign-in-panel h1 { font-size: 20px; }
.sign-in-panel p { color: color-mix(in srgb, var(--color-text) 60%, transparent); font-size: 14px; }
.sign-in-panel .btn { margin: var(--space-4) auto 0; }
.connected-account {
  align-items: center; color: color-mix(in srgb, var(--color-text) 60%, transparent);
  display: flex; flex-wrap: wrap; font-size: 13px; gap: var(--space-2);
  margin: calc(var(--space-2) * -1) 0 var(--space-6);
}
.connected-account strong { color: var(--color-text); font-weight: 500; }
.empty-state {
  border: 1px solid var(--color-divider); margin-bottom: var(--space-6);
  padding: 48px 24px; text-align: center;
}
.empty-state h2 { font-size: 22px; }
.empty-state p { color: color-mix(in srgb, var(--color-text) 55%, transparent); font-size: 14px; }

/* ── dialogs ──────────────────────────────────────────────────────────── */
dialog.dialog {
  background: var(--color-bg); border-radius: 0; color: var(--color-text);
  display: none; flex-direction: column; gap: var(--space-3);
  /* The registration marks sit 6px outside the box; a scrolling dialog would
     clip them and show scrollbars, so the folder list scrolls instead. */
  overflow: visible;
  padding: var(--space-6); width: min(440px, calc(100% - 2rem));
}
dialog.dialog[open] { display: flex; }
dialog.dialog::backdrop { background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent); }
.dialog-title { font-family: var(--font-heading); font-size: 20px; margin: 0; }
.dialog-body { font-size: 14px; margin: 0; opacity: .85; }
.dialog-note {
  border-top: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-size: 13px; margin: 0; padding-top: var(--space-3);
}
.dialog-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  justify-content: flex-end; margin-top: var(--space-2);
}
.folder-picker {
  display: flex; flex-direction: column; gap: var(--space-2);
  max-height: 45vh; overflow-y: auto;
}
.folder-choice {
  align-items: center; background: transparent; border: 1px solid var(--color-divider);
  color: var(--color-text); cursor: pointer; display: flex; font-size: 14px;
  justify-content: space-between; padding: 8px 10px; text-align: left; width: 100%;
}
.folder-choice[aria-pressed="true"] { background: var(--color-accent-100); border-color: var(--color-accent); }
.folder-choice:disabled { opacity: .5; }
.picker-status { color: color-mix(in srgb, var(--color-text) 55%, transparent); font-size: 13px; margin: 0; }
.picker-status.error { color: var(--danger); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .library-layout { grid-template-columns: 1fr; }
  .breakdown-label { width: 140px; }
}
@media (max-width: 640px) {
  .page { padding-left: var(--space-4); padding-right: var(--space-4); }
  .nav { padding-left: var(--space-4); padding-right: var(--space-4); }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 34px; }
  .landing-hero { padding: 40px 0 32px; }
  .landing-hero h1 { font-size: 38px; }
  /* The copy runs the full width here, so the scrim has to cover the whole
     strip rather than clearing to the right. */
  .hero-montage { opacity: .2; }
  .hero-montage-row img { height: 76px; width: 104px; }
  .landing-hero::before {
    background: linear-gradient(
      180deg,
      var(--color-bg) 0%,
      color-mix(in srgb, var(--color-bg) 86%, transparent) 100%
    );
  }
  .landing-hero .lede { font-size: 17px; }
  .landing-search { flex-direction: column; }
  .landing-cta { align-items: flex-start; }
  .landing-cta h2 { font-size: 24px; }
  .account-name { display: none; }
  .site-footer-inner { padding-left: var(--space-4); padding-right: var(--space-4); }
  .filter-bar .select-field, .filter-bar select.input { width: 100%; }
  .fair-award-filter, .fair-award-filter .select-field, .fair-award-filter select.input {
    width: 100%;
  }
  .pagination { gap: var(--space-2); justify-content: space-between; }
}
