/* Endre Granat — site styles */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #221d1a;
  --muted: #6b625b;
  --line: #e6dfd5;
  --accent: #7a2e1d;      /* oxblood, a nod to the original site's rust */
  --accent-ink: #ffffff;
  --accent-soft: #f3e7e1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 68rem;
  --radius: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #201c19;
    --ink: #ece6df;
    --muted: #a69d94;
    --line: #36302b;
    --accent: #d98a6f;
    --accent-ink: #1a1411;
    --accent-soft: #2e2420;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero .wrap { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.portrait {
  width: 150px; padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / .25);
}
.portrait img { width: 100%; border-radius: 3px; }
.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: .75rem; }
.lede { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 38em; margin: 0; }
@media (max-width: 560px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .portrait { width: 120px; }
}

/* Sections */
section { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid var(--line); }
.prose { max-width: 42rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: .95rem; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1); transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.03); }
.facts strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin-bottom: .2rem; }

/* Student library */
.library-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.toolbar { position: sticky; top: 4rem; z-index: 4; background: var(--bg); padding: .75rem 0; border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
.search { flex: 1 1 18rem; position: relative; }
.search input {
  width: 100%; font: inherit; padding: .65rem .9rem .65rem 2.4rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.search svg { position: absolute; left: .8rem; top: 50%; translate: 0 -50%; color: var(--muted); }
.count { color: var(--muted); font-size: .9rem; }
.lock-note { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0 0; max-width: 42rem; padding: .7rem .9rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: .95rem; }
.lock-note svg { flex: none; margin-top: .2rem; color: var(--accent); }
.az { display: flex; flex-wrap: wrap; gap: .15rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.az a { display: inline-block; min-width: 1.9rem; text-align: center; padding: .2rem .35rem; border-radius: 4px; text-decoration: none; font-size: .9rem; }
.az a:hover { background: var(--accent-soft); }
.composer { padding: 1.75rem 0 .5rem; border-top: 0; }
.composer h2 { font-size: 1.4rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.works { list-style: none; margin: 0; padding: 0; }
.work { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.work:last-child { border-bottom: 0; }
.work-title { font-family: var(--serif); font-size: 1.05rem; }
.parts { display: flex; flex-wrap: wrap; gap: .4rem; }
.part {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
.part:hover { border-color: var(--accent); color: var(--accent); }
.part svg { flex: none; }
.empty { padding: 3rem 0; color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--muted); }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .toolbar, .site-footer, .az { display: none; }
  body { background: #fff; color: #000; }
}
