/* ============================================================
   PLRM Research Archive — Shared Stylesheet
   Fonts: EB Garamond (body) + DM Mono (labels/nav/code)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Mono:wght@300;400;500&display=swap');

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

/* ── Design tokens ── */
:root {
  --bg:           #0c0c0c;
  --bg-raised:    #141414;
  --text:         #e0ddd4;
  --text-bright:  #f2efe6;
  --text-muted:   #9e9b91;
  --text-dim:     #636159;
  --accent:       #33ff33;
  --accent-light: #66ff66;
  --line:         #1a2e1a;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--text-bright); }

img {
  max-width: 100%;
  display: block;
}

/* ── Navigation ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav .site-name {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: 0.04em;
}

.site-nav .site-name span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  position: relative;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent-light); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}

/* ── Page wrapper ── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 120px 32px 100px;
}

.page--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 120px 32px 100px;
}

/* ── Typography ── */
h1 {
  font-size: 32px;
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

h2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 12px;
  margin-top: 48px;
}

h3 {
  font-size: 17px;
  font-family: 'DM Mono', monospace;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 36px;
}

p {
  font-size: 19px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 20px;
}

p:last-child { margin-bottom: 0; }

.subtitle {
  font-size: 20px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.lead {
  font-size: 21px;
  font-style: italic;
  color: var(--text-bright);
  line-height: 1.7;
  margin-bottom: 48px;
}

.label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

/* ── Works grid (index page) ── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  margin-top: 48px;
}

.work-card {
  display: flex;
}

.work-card a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-raised);
  color: var(--text);
  transition: background 0.2s;
}

.work-card a:hover { background: #1a1a1a; }

.work-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.3s;
}

.work-card a:hover .work-card-image { filter: grayscale(0%); }

.work-card-body {
  padding: 20px;
}

.work-card-number {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.work-card-title {
  font-size: 17px;
  color: var(--text-bright);
  line-height: 1.4;
  margin-bottom: 8px;
}

.work-card-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── Image gallery + lightbox ── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  margin: 32px 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  filter: grayscale(15%);
  transition: filter 0.2s, transform 0.2s;
}

.gallery img:hover {
  filter: grayscale(0%);
  transform: scale(1.01);
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 28px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.08em;
}

.lightbox-close:hover { color: var(--accent); }

/* ── Video embed ── */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin: 32px 0;
  background: var(--bg-raised);
}

.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Blockquote ── */
blockquote {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 19px;
  line-height: 1.8;
}

blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.04em;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }
.fade-in:nth-child(5) { animation-delay: 0.4s; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .page, .page--wide { padding: 80px 20px 60px; }
  h1 { font-size: 24px; }
  .lead { font-size: 18px; }
  p { font-size: 17px; }
  .works-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
