/* ============================================================
   BASE — Reset, typography, global utilities
   ============================================================ */

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .45s var(--ease), color .45s var(--ease);
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
ul { list-style: none; }
svg { display: block; }

/* ── SELECTION ───────────────────────────────────────────── */
::selection { background: var(--accent); color: #09090B; }

/* ── FOCUS ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
p { line-height: 1.7; }

/* ── ACCESSIBILITY ───────────────────────────────────────── */
.skip-link {
  position: fixed;
  left: -999px; top: 0;
  background: var(--accent); color: #09090B;
  padding: 10px 18px;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: .1em; text-transform: uppercase;
  z-index: var(--z-preloader);
  border-radius: 0 0 var(--radius) 0;
  transition: left .2s;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── UTILITIES ───────────────────────────────────────────── */
.font-mono  { font-family: var(--font-mono); }
.font-disp  { font-family: var(--font-display); }
.text-accent{ color: var(--accent); }
.text-muted { color: var(--text-2); }
.text-ghost { color: var(--text-3); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 20px; height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .04em;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  background: transparent;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Noise grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: .025;
  pointer-events: none;
  z-index: var(--z-preloader);
  mix-blend-mode: overlay;
}
html.theme-light body::after { opacity: .018; }

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── RESPONSIVE IMAGE RULES ──────────────────────────────── */
/* Tablet: hide thumbnail strip on project list, collapse grids */
@media (max-width: 900px) {
  .project-list-item {
    grid-template-columns: 60px 1fr 160px;
  }
  .pli-thumb { display: none; }

  .cred-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-masonry { column-count: 2; }
}

/* Mobile: fully collapse */
@media (max-width: 600px) {
  .project-list-item {
    grid-template-columns: 48px 1fr;
  }
  .pli-meta { display: none; }
  .pli-thumb { display: none; }

  .cred-grid { grid-template-columns: 1fr; }
  .photo-masonry { column-count: 1; }
}
