/* ---------------------------------------------------------------
   janmarsol — static site styles
   Every value you are likely to change lives in :root.
   --------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6f6f6f;
  --line: rgba(0, 0, 0, 0.14);
  --letterbox: #000000;      /* bars around non-16:9 media */

  --font: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 34rem;          /* ~70 characters of body text */
  --page: 78rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: inherit; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: -9999px;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg);
  z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
}

.site-logo {
  margin: 0;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.site-logo a { text-decoration: none; }

.nav-toggle {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 0.5rem;
  margin-right: -0.5rem;
  cursor: pointer;
}
.nav-toggle-bars {
  display: block;
  width: 24px; height: 1px;
  background: currentColor;
  position: relative;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px; height: 1px;
  background: currentColor;
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }

.site-nav a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
.site-nav a:hover { text-decoration-color: var(--muted); }

@media (max-width: 799px) {
  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.18s ease, visibility 0.18s ease;
  }
  .site-nav[data-open="true"] { visibility: visible; opacity: 1; }
  .site-nav ul {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  .site-nav a { font-size: 1.375rem; }
}

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-nav ul { display: flex; gap: clamp(1.5rem, 3.5vw, 3.25rem); }
}

/* ----------------------------------------------------- main + footer */

main { flex: 1 0 auto; }

.site-footer {
  padding: 2.5rem var(--gutter) 3rem;
  text-align: center;
  font-size: 0.9375rem;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

/* ----------------------------------------------------- home reel */

.reel {
  max-width: 88rem;
  width: min(100%, 78vw);
  margin: clamp(1rem, 3vw, 2.5rem) auto 0;
  padding: 0 var(--gutter);
}

@media (max-width: 799px) { .reel { width: 100%; } }

.reel-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--letterbox);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.slide[data-active="true"] { opacity: 1; pointer-events: auto; }

/* Without JS every slide would stack invisibly, so show the first. */
.no-js .slide:first-child { opacity: 1; pointer-events: auto; }

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--letterbox);
}

.slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1rem 1.25rem;
  color: #fff;
  font-size: 0.875rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.slide:hover .slide-caption,
.slide a:focus-visible .slide-caption { opacity: 1; }

.reel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.reel-dot {
  appearance: none;
  width: 7px; height: 7px;
  padding: 0;
  border: 1px solid var(--fg);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.reel-dot[aria-current="true"] { background: var(--fg); }

/* ----------------------------------------------------- pages */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 1rem;
}

.page-title {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 300;
  text-align: center;
  letter-spacing: 0.01em;
  margin: 0 0 clamp(2rem, 4vw, 3.25rem);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.25rem; }

/* category listing: two columns, caption under each */

.listing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem clamp(1.5rem, 3vw, 3rem);
}
@media (min-width: 700px) { .listing { grid-template-columns: repeat(2, 1fr); } }

.listing figure { margin: 0; }
.listing a { display: block; }

.listing img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f2f2f2;
}

.listing figcaption {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* project pages */

.stills { display: grid; gap: 1.5rem; margin: 0 0 2.5rem; }

.still {
  appearance: none;
  border: 0; padding: 0;
  background: #f2f2f2;
  cursor: zoom-in;
  display: block;
  width: 100%;
}
.still img { width: 100%; }

.player {
  margin: 0 auto 2.5rem;
  background: var(--letterbox);
  aspect-ratio: 16 / 9;
}
.player video,
.player iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}

.synopsis {
  font-style: italic;
  max-width: var(--measure);
  margin: 0 auto 1.75rem;
}
.credits {
  max-width: var(--measure);
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.9;
}
.note {
  max-width: var(--measure);
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.9375rem;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 2rem;
  font-size: 0.9375rem;
  text-align: center;
}

/* contact */

.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 800px) {
  .contact-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}
.contact-email {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

/* ----------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.lightbox button {
  position: absolute;
  appearance: none;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: 0.9375rem;
  padding: 1rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}
.lightbox .lb-close { top: 0.5rem; right: 0.75rem; }
.lightbox .lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

body[data-locked="true"] { overflow: hidden; }

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