/* Works library — styled to match the AI4IA Institute frontpage: the same
   Inter/Cormorant pairing, the same near-black and pure-yellow palette, square
   corners with hairline rules instead of rounded shadowed cards, and the same
   dark-hero-then-light-content rhythm. Font faces come from /styles/fonts.css,
   which the frontpage also uses. */

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

:root {
  --black:  #080808;
  --yellow: #FFFF00;
  --white:  #ffffff;
  --gray:   #666666;
  /* Height of the fixed nav bar, measured: 22px padding + the 37px logo box.
     Below the breakpoint the 44px burger is the tallest child instead, and the
     padding drops to 18px. Anything sticky or anchor-targeted offsets by this. */
  --nav-h: 81px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }

/* ─── NAV ──────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 22px 48px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  background: var(--black);
}
.logo {
  font-size: 18px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--white); text-decoration: none;
  display: inline-flex; align-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 14px;
}
.logo .y { color: var(--yellow); }
.logo-sep { display: inline-block; width: 1px; align-self: stretch; background: rgba(255,255,255,0.22); margin: 0 12px; }
.logo .sub { font-family: 'Cormorant Garamond', serif; color: rgba(255,255,255,0.6); font-weight: 300; font-size: 16px; letter-spacing: 0.06em; text-transform: none; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links button.nav-linklike {
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
}
.nav-links a, .nav-links button.nav-linklike { font-size: 11px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover, .nav-links button.nav-linklike:hover { color: var(--white); }
.nav-links a.is-current { color: var(--yellow); }
/* Below the shared 1024px breakpoint the list gives way to the burger and
   right-hand sheet from nav-sheet.js. */
@media (max-width: 1023.98px) {
  :root { --nav-h: 80px; }
  .nav-links { display: none; }
  .site-nav { padding: 18px 24px; }

}

/* ─── HERO ─────────────────────────────────────────── */
.hero {
  position: relative; z-index: 1;
  background-color: var(--black);
  padding: 152px 0 88px;
  overflow: hidden;
}
/* Same looping texture as the frontpage hero and transition bands. */
.grain-layer {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.45;
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto; padding: 0 48px;
  display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center;
}
.hero-text { min-width: 0; }
.hero-eyebrow { display: block; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--yellow); margin-bottom: 20px; }
.hero-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 300; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--white);
}
.hero-headline em { display: block; font-style: italic; color: var(--yellow); font-size: 0.5em; letter-spacing: 0; margin-top: 10px; }
.hero-sub { margin-top: 24px; font-size: 15px; font-weight: 300; color: rgba(255,255,255,0.72); line-height: 1.8; max-width: 560px; }
.poze-mark { width: 190px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.14); padding: 14px; }
.poze-mark img { width: 100%; height: auto; display: block; }

/* ─── SHARED SECTION SCAFFOLD ──────────────────────── */
.section-inner { max-width: 1080px; margin: 0 auto; padding: 0 48px; }
.section-eyebrow { display: block; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: rgba(0, 0, 0, 0.58); margin-bottom: 20px; }
.section-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 300; line-height: 1.1; color: #0a0a0a; margin-bottom: 20px;
}
.section-headline em { font-style: italic; }
.section-sub { font-size: 15px; font-weight: 300; color: rgba(0, 0, 0, 0.58); line-height: 1.8; max-width: 760px; }

.snapshot-section { padding: 96px 0 0; }
.bio-snapshot {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 300; line-height: 1.5; color: rgba(0,0,0,0.78);
  max-width: 900px;
}
.foundation-section { padding: 96px 0; }
.corpus-section { padding: 0 0 88px; }

/* ─── TERMINOLOGY ──────────────────────────────────── */
.term-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.08);
  margin-top: 48px;
}
.term { background: var(--white); padding: 26px 24px; }
.term b { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: #0a0a0a; }
.term span { display: block; font-size: 13px; font-weight: 300; color: rgba(0, 0, 0, 0.58); line-height: 1.7; }

/* ─── STATS ────────────────────────────────────────── */
.stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.08);
}
.stat { background: var(--white); padding: 28px 24px; }
.stat b {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 3.4vw, 44px); font-weight: 300; line-height: 1; color: #0a0a0a;
}
.stat span { display: block; margin-top: 10px; font-size: 11px; font-weight: 400; color: rgba(0, 0, 0, 0.58); text-transform: uppercase; letter-spacing: 0.18em; line-height: 1.5; }

/* ─── LIVE PANEL + COVERAGE NOTE ───────────────────── */
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.live-panel, .notice { border: 1px solid rgba(0,0,0,0.08); padding: 28px 26px; }
.live-panel { background: #fafafa; }
.panel-label { display: block; font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(0, 0, 0, 0.58); margin-bottom: 14px; }
.panel-body { font-size: 14px; font-weight: 300; color: rgba(0,0,0,0.6); line-height: 1.75; }
.live-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
/* Primary button treatment. Deliberately NOT a bare `button` selector: the
   shared nav sheet and contact overlay inject their own buttons into this page,
   and an element-level rule leaked into them — the `gap` below spread the
   burger's three bars from 34/40/46 to 24/40/56 so the outer two merged into
   its border, and the white `:hover` filled the burger and the linklike nav and
   footer items. Scoped to the buttons this page actually owns; .filters-toggle,
   .nav-linklike and .footer-linklike each declare their own treatment. */
.live-actions button, .button-link {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--yellow); background: var(--yellow); color: #000;
  padding: 12px 22px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.live-actions button:hover, .button-link:hover { background: var(--white); border-color: #0a0a0a; }
.button-link { background: transparent; border-color: rgba(0,0,0,0.2); color: #0a0a0a; }
.button-link:hover { background: #0a0a0a; border-color: #0a0a0a; color: var(--white); }
#liveStatus { margin-top: 16px; font-size: 12px; font-weight: 300; color: rgba(0, 0, 0, 0.58); line-height: 1.7; }

/* ─── STICKY FILTER BAR ────────────────────────────── */
.controls {
  position: sticky; top: var(--nav-h); z-index: 5;
  scroll-margin-top: var(--nav-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 20px 0;
}
.controls-inner { max-width: 1080px; margin: 0 auto; padding: 0 48px; }
.control-grid { display: grid; grid-template-columns: 2fr repeat(4, minmax(130px, 1fr)); gap: 10px; align-items: center; }
/* display: none also drops it out of the grid, so the desktop columns still line
   up against exactly the search field plus four selects. */
.filters-toggle { display: none; }

/* Placed after the base rule above, not in the nav's media block, or the later
   `display: none` would win at equal specificity and the toggle would never
   appear. */
@media (max-width: 1023.98px) {
  /* The sticky bar has to stay shallow on a phone, so the four selects fold
     behind a toggle and the search field is the only thing always on show.
     app.js sets data-filters; without JS the attribute is absent and the selects
     stay visible, which degrades to the previous behaviour rather than to a
     bar that cannot be expanded. */
  .filters-toggle {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%;
    background: transparent; border: 1px solid rgba(0,0,0,0.14); color: #0a0a0a;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase;
    cursor: pointer; transition: border-color 0.2s, color 0.2s;
  }
  .filters-toggle:hover { border-color: #0a0a0a; }
  .filters-chevron { transition: transform 0.25s ease; flex-shrink: 0; }
  .controls[data-filters="collapsed"] .control-grid select { display: none; }
  .controls[data-filters="expanded"] .filters-chevron { transform: rotate(180deg); }
  /* Marks the toggle when a filter is on but folded away, so an active filter
     cannot silently explain a short result list. */
  .filters-toggle[data-active="true"] { border-color: var(--yellow); background: var(--yellow); }
}
input, select {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.14); background: var(--white);
  padding: 13px 14px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 300; color: #0a0a0a;
  transition: border-color 0.2s;
}
input::placeholder { color: rgba(0, 0, 0, 0.58); }
input:focus, select:focus { outline: none; border-color: #0a0a0a; }
#countLine { margin-top: 14px; font-size: 11px; font-weight: 400; color: rgba(0, 0, 0, 0.58); text-transform: uppercase; letter-spacing: 0.16em; }

/* ─── RECORD CARDS ─────────────────────────────────── */
.records { padding: 56px 0 96px; background: var(--white); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(0,0,0,0.08); border: 1px solid rgba(0,0,0,0.08); }
.card {
  background: var(--white);
  padding: 30px 26px;
  display: flex; flex-direction: column;
  min-height: 280px;
  transition: background 0.2s;
}
.card:hover { background: #fafafa; }
/* Books read as the anchor items, so they carry the yellow rule the frontpage
   uses for emphasis rather than a filled panel. */
.card.card-book { border-top: 2px solid var(--yellow); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.badge {
  font-size: 11px; font-weight: 400; letter-spacing: 0.06em;
  border-radius: 100px; padding: 5px 14px;
  background: #f0f0f0; color: rgba(0, 0, 0, 0.58);
}
.badge.type { background: #484848; color: rgba(255,255,255,0.9); }
.badge.upcoming { background: var(--yellow); color: #000; }
.card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 300; line-height: 1.25; margin-bottom: 14px;
}
.card h2 a { text-decoration: none; transition: color 0.2s; }
.card h2 a:hover { color: var(--gray); }
.summary { font-size: 13px; font-weight: 300; color: rgba(0, 0, 0, 0.58); line-height: 1.75; flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.tag { font-size: 11px; font-weight: 300; letter-spacing: 0.04em; color: rgba(0, 0, 0, 0.58); border: 1px solid rgba(0,0,0,0.1); padding: 4px 10px; }
.footerline {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; font-weight: 300; color: rgba(0, 0, 0, 0.58);
}
.footerline a { text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; font-weight: 500; color: #0a0a0a; }
.footerline a:hover { color: var(--gray); }
.empty {
  display: none; padding: 64px 30px; text-align: center;
  font-size: 14px; font-weight: 300; color: rgba(0, 0, 0, 0.58);
  border: 1px dashed rgba(0,0,0,0.14);
}

/* ─── FOOTER ───────────────────────────────────────── */
.site-footer { background: var(--black); border-top: 1px solid rgba(255,255,255,0.07); padding: 64px 0 0; }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 48px;
  display: grid; grid-template-columns: 1fr auto; gap: 64px; align-items: flex-start;
  padding-bottom: 48px;
}
.footer-logo {
  font-size: 16px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--white); text-decoration: none;
  display: inline-flex; align-items: center;
  border: 1px solid rgba(255,255,255,0.18); padding: 7px 14px;
}
.footer-logo .y { color: var(--yellow); }
.footer-logo .sub { font-family: 'Cormorant Garamond', serif; color: rgba(255,255,255,0.6); font-weight: 300; font-size: 14px; letter-spacing: 0.06em; text-transform: none; }
.footer-tagline { margin-top: 20px; font-size: 13px; font-weight: 300; color: rgba(255, 255, 255, 0.5); line-height: 1.75; max-width: 420px; }
/* The only <code> on the site, and the site has no monospace voice: this said
   'Inter', monospace, so Inter always won and the fallback never applied. Kept
   Inter — one filename in Menlo would be the single mono face anywhere — and
   made the element earn its markup with contrast instead, since the old colour
   just repeated the parent's and left the literal indistinguishable. */
.footer-tagline code { font-family: 'Inter', sans-serif; font-size: 12px; color: rgba(255,255,255,0.75); }
.footer-nav { display: flex; gap: 64px; }
.footer-nav-col { display: flex; flex-direction: column; gap: 14px; }
.footer-nav-label { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); margin-bottom: 4px; }
.footer-nav-col button.footer-linklike {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left; font-family: inherit;
}
.footer-nav-col a, .footer-nav-col button.footer-linklike { font-size: 13px; font-weight: 300; color: rgba(255, 255, 255, 0.5); text-decoration: none; transition: color 0.2s; }
.footer-nav-col a:hover, .footer-nav-col button.footer-linklike:hover { color: var(--white); }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.07);
  max-width: 1080px; margin: 0 auto; padding: 20px 48px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 300; color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
}
/* Mirrors the frontpage's legal row, including the deliberately flat :hover —
   this row is the page's quiet register and its links do not light up. */
.footer-legal-links { display: flex; gap: 24px; }
.footer-legal-links a { color: rgba(255, 255, 255, 0.5); text-decoration: none; transition: color 0.2s; }
.footer-legal-links a:hover { color: rgba(255,255,255,0.5); }

/* ─── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1050px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; }
  .poze-mark { order: -1; width: 150px; }
  .term-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-row { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  /* Nav collapsing is handled at 1024px above. */
  .hero { padding: 128px 0 64px; }
  .hero-content, .section-inner, .controls-inner, .footer-inner { padding-left: 24px; padding-right: 24px; }
  .footer-legal { padding-left: 24px; padding-right: 24px; flex-direction: column; gap: 12px; text-align: center; }
  .snapshot-section { padding-top: 64px; }
  .foundation-section { padding: 64px 0; }
  .term-grid, .grid, .stats { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
}
