/* ============================================================
   nathan.dube — stylesheet
   modernized 2026, preserves the original minimal aesthetic
   ============================================================ */

:root {
  --color-bg: #fafaf8;
  --color-ink: #0a0a0a;
  --color-muted: #888;
  --color-rule: rgba(26, 26, 26, 0.08);
  --color-card: #ffffff;

  --font-sans: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  --container-max: 1080px;
  --transition: 250ms ease;
}

/* ----- reset ----- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

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

/* ----- layout ----- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- header ----- */

.site-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: var(--space-md);
  border-bottom: 4px solid var(--color-rule);
  margin-bottom: var(--space-2xl);
  position: relative;
  min-height: 2.5rem;
}

.brand {
  position: absolute;
  left: 0;
  /* center the logo vertically on the bottom border */
  bottom: -35px;
  z-index: 2;
  line-height: 0;
  /* circular halo punches the rule where the logo overlaps */
  border-radius: 50%;
  background: var(--color-bg);
  /* SVG paths inherit this via fill="currentColor" */
  color: var(--color-ink);
  transition: opacity var(--transition);
}

.brand-mark {
  width: 120px;
  height: 120px;
  display: block;
}

.brand:hover,
.brand:focus-visible { opacity: 0.65; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: opacity var(--transition);
}

.site-nav a:hover,
.site-nav a:focus-visible { opacity: 0.55; }

/* ----- thumbnails grid ----- */

.thumbs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: var(--space-2xl) 0;
  align-content: center;
}

.thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  transition: opacity var(--transition);
}

.thumb:hover,
.thumb:focus-visible { opacity: 0.6; }

.thumb-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8b8b8;
  overflow: hidden;
}

.thumb-image svg { width: 60%; height: 60%; }

.thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-caption {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ----- footer ----- */

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

/* ----- active nav state ----- */

.site-nav a.active,
.site-nav a[aria-current="page"] {
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ============================================================
   section pages (objects.html, systems.html, translation.html)
   ============================================================ */

.section-intro {
  padding: var(--space-2xl) 0 var(--space-lg);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0 0 var(--space-md);
}

.section-blurb {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  margin: 0;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(var(--series-cols, 5), 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-2xl);
}

.series {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: opacity var(--transition);
}

.series:hover,
.series:focus-visible { opacity: 0.6; }

.series-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  overflow: hidden;
}

.series-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-caption {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   detail pages (objects/shooters.html, etc.)
   ============================================================ */

.detail-header {
  padding: var(--space-xl) 0 var(--space-lg);
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  transition: opacity var(--transition);
}

.back-link:hover,
.back-link:focus-visible { opacity: 0.6; color: var(--color-ink); }

.detail-title {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0 0 var(--space-md);
}

.detail-statement {
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.works {
  display: grid;
  grid-template-columns: repeat(var(--works-cols, 5), 1fr);
  gap: var(--space-md);
  padding: var(--space-lg) 0 var(--space-2xl);
}

.work {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.work a {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  overflow: hidden;
  transition: opacity var(--transition);
}

.work a:hover,
.work a:focus-visible { opacity: 0.75; }

.work img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.work figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.work-title { font-weight: 400; }

.work-meta {
  color: var(--color-muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

/* ============================================================
   lightbox
   ============================================================ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
}

.lightbox-overlay.open { display: flex; }

.lightbox-figure {
  margin: 0;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  background: #fff;
}

.lightbox-caption {
  color: #ddd;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-weight: 300;
  transition: opacity var(--transition);
  opacity: 0.6;
}

.lightbox-close { top: 1rem; right: 1rem; font-size: 1.25rem; }
.lightbox-prev  { left: 1rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.work .lightbox-extra { display: none;}

.lightbox-video {
  max-width: 90vw;
  max-height: 80vh;
  background: #000;
  display: block;
}

.lightbox-audio {
  width: 100%;
  max-width: 600px;
  display: block;
  margin-top: var(--space-sm);
}

/* ============================================================
   about page
   ============================================================ */

.about {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.about-title {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0 0 var(--space-lg);
}

.about-bio p,
.about-statement p {
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 var(--space-md);
}

.about-bio p:last-child,
.about-statement p:last-child {
  margin-bottom: 0;
}

.about-section {
  margin: var(--space-2xl) 0 0;
}

.about-heading {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  margin: 0 0 var(--space-md);
}

.about-section > p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 0.4rem;
}

.about-cv {
  margin: var(--space-2xl) 0 0;
  font-size: 0.95rem;
}

.about-cv a {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 2px;
  transition: opacity var(--transition);
}

.about-cv a:hover { opacity: 0.6; }

/* email obfuscation — hides the strikethrough decoys */
.about-email del { display: none; }

/* video loops in works grid */
.work video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  display: block;
}

/* ============================================================
   responsive
   ============================================================ */

/* tablet */
@media (max-width: 900px) {
  .thumbs {
    gap: var(--space-md);
    padding: var(--space-xl) 0;
  }

  .brand-mark { width: 96px; height: 96px; }
  .brand { bottom: -28px; }

  .series-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .works {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
}

/* mobile */
@media (max-width: 720px) {
  .container {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }

  .site-header {
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-xl);
  }

  .brand-mark { width: 76px; height: 76px; }
  .brand { bottom: -22px; }

  .site-nav ul { gap: 1.25rem; }
  .site-nav a { font-size: 0.9rem; }

  .thumbs {
    grid-template-columns: 1fr !important;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
  }

  .thumb-image {
    max-width: 320px;
    margin: 0 auto;
  }

  .series-grid,
  .works {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .series-image,
  .work a {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .section-title,
  .detail-title { font-size: 1.5rem; }

  .lightbox-prev { left: 0; font-size: 2rem; }
  .lightbox-next { right: 0; font-size: 2rem; }

  .site-footer {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: center;
    text-align: center;
  }
}

/* small phones — keep horizontal but tighten everything */
@media (max-width: 420px) {
  .brand-mark { width: 60px; height: 60px; }
  .brand { bottom: -18px; }
  .site-nav ul { gap: 0.75rem; }
  .site-nav a { font-size: 0.82rem; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   sample buttons + credits
   ADD these rules to css/style.css (the rest of .demo styles are already there)
   ============================================================ */

.demo-samples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.demo-sample {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--color-rule);
  background: var(--color-bg);
  color: var(--color-ink);
  cursor: pointer;
  transition: opacity var(--transition), border-color var(--transition);
}

.demo-sample:hover {
  border-color: var(--color-ink);
  opacity: 0.85;
}

.demo-credits {
  font-size: 0.78rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: var(--space-md) 0 0;
  letter-spacing: 0.01em;
}

.demo-credits a {
  color: inherit;
  border-bottom: 1px solid var(--color-rule);
}

.demo-credits a:hover {
  border-bottom-color: var(--color-muted);
}

/* mobile — let sample buttons wrap below the file button */
@media (max-width: 720px) {
  .demo-samples {
    flex-basis: 100%;
    order: 1;
  }
}

/* ============================================================
   demo canvas — slightly relaxed min-height so wider aspect ratios fit
   This REPLACES the existing .demo-canvas rule in style.css.
   ============================================================ */

.demo-canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  padding: var(--space-md);
}

.demo-canvas svg {
  width: 100%;
  max-width: 720px;     /* slightly wider — patchgrid benefits from breathing room */
  height: auto;
  display: block;
}

/* mobile */
@media (max-width: 720px) {
  .demo-canvas {
    min-height: 240px;
    padding: var(--space-sm);
  }
}

/* ============================================================
   image-to-music demo + cross-links
   add these to css/style.css
   ============================================================ */

/* canvas-specific styling for image-to-music demo */
.demo-canvas canvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: var(--color-bg);
}

/* cross-section navigation links (systems ↔ translation) */
.series-cross-link {
  margin: var(--space-lg) 0 0;
  font-size: 0.95rem;
  color: var(--color-ink);
}

.series-cross-link a {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 2px;
  transition: opacity var(--transition), border-color var(--transition);
}

.series-cross-link a:hover {
  opacity: 0.7;
  border-bottom-color: var(--color-ink);
}