/* =========================================================
   Design tokens
   Subject: a photographer's contact sheet / darkroom.
   Ink black background, paper-white surfaces, a safelight-red
   accent used sparingly, and warm grain-gold for the rare
   "featured" mark. Type: Fraunces (display), Inter (body),
   IBM Plex Mono (EXIF-style data: camera, lens, settings).
   ========================================================= */

:root {
  --ink: #121212;
  --ink-soft: #1b1b1b;
  --panel: #1e1e1e;
  --panel-line: #303030;
  --paper: #eeeae1;
  --paper-dim: #cfcac0;
  --slate: #9a9d9f;
  --safelight: #c1442d;
  --safelight-dim: #7c2c1d;
  --grain-gold: #c9a227;

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --radius: 3px;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--paper-dim);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* focus visibility, kept for every interactive element */
a:focus-visible,
button:focus-visible,
.photo-card:focus-visible {
  outline: 2px solid var(--safelight);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Sprocket-hole divider — the page's signature element.
   A strip of small punched circles, the way a strip of film
   is perforated along its edge. Used to separate sections
   instead of a plain rule.
   ========================================================= */

.sprocket-row {
  height: 20px;
  width: 100%;
  background-image: radial-gradient(circle, var(--panel-line) 3.5px, transparent 3.6px);
  background-size: 28px 20px;
  background-position: center;
  background-repeat: repeat-x;
  opacity: 0.9;
}

.sprocket-row.tight {
  height: 14px;
  background-size: 20px 14px;
  background-image: radial-gradient(circle, var(--panel-line) 2.5px, transparent 2.6px);
}

/* =========================================================
   Header / nav
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--panel-line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-mark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-mark span {
  color: var(--safelight);
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: var(--slate);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--paper);
  border-color: var(--safelight);
}

.nav-toggle {
  display: none;
}

@media (max-width: 640px) {
  .nav-links {
    gap: 1rem;
    font-size: 0.72rem;
  }
}

/* =========================================================
   Hero (home page)
   ========================================================= */

.hero {
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--safelight);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  max-width: 15ch;
  line-height: 1.04;
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 46ch;
  color: var(--paper-dim);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid var(--panel-line);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--safelight);
  border-color: var(--safelight);
  color: #120705;
  font-weight: 600;
}

.btn-primary:hover {
  background: #d65a40;
  border-color: #d65a40;
}

.btn-ghost {
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--paper);
}

/* Contact strip: filmstrip of thumbnails on the home page */

.filmstrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 0.6rem;
  overflow-x: auto;
  padding: 1.5rem var(--gutter) 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  scrollbar-color: var(--panel-line) transparent;
}

.filmstrip a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
}

.filmstrip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(45%) contrast(1.05);
  transition: filter 0.25s ease, transform 0.4s ease;
}

.filmstrip a:hover img {
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.04);
}

/* Section headings shared across pages */

.section {
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
}

.section-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  letter-spacing: 0.02em;
}

/* =========================================================
   Gallery grid + photo cards (mounted-slide look)
   ========================================================= */

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  letter-spacing: 0.02em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.photo-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--safelight);
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.6);
}

.photo-card .frame {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: #0d0d0d;
}

.photo-card .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* transition: transform 0.35s ease; */
}

/* .photo-card:hover .frame img {
  transform: scale(1.05);
} */

.frame-number {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(18, 18, 18, 0.78);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
}

.card-body {
  padding: 0.9rem 1rem 1.1rem;
  border-top: 1px solid var(--panel-line);
}

.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate);
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery-empty,
.gallery-error {
  font-family: var(--font-mono);
  color: var(--slate);
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* =========================================================
   Modal (photo detail)
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--ink-soft);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  max-width: 960px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: row;
}

.modal-image {
  background: #0a0a0a;
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  flex: 1.3 1 0%;
}

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

.modal-details {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 0%;
  background: var(--ink-soft);
}

.line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--panel-line);
  margin: 1.5rem 0;
  border: 0;
}

.modal-close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--panel-line);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 1rem;
}

.modal-close:hover {
  border-color: var(--safelight);
  color: var(--safelight);
}

.modal-frame-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--safelight);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.modal-details h3 {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
  overflow-wrap: break-word;
}

.modal-location {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 1.1rem;
  overflow-wrap: break-word;
}

.exif-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 1.1rem;
}

.exif-table td {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--panel-line);
  color: var(--paper-dim);
  overflow-wrap: break-word;
  word-break: break-word;
}

.exif-table td:first-child {
  color: var(--slate);
  width: 40%;
}

.modal-description {
  color: var(--paper-dim);
  font-size: 0.95rem;
  overflow-wrap: break-word;
}

@media (max-width: 760px) {
  .modal {
    flex-direction: column;
  }
  .modal-image {
    aspect-ratio: 4 / 3;
    width: 100%;
    flex: none;
  }
}

/* =========================================================
   About / Contact page bits
   ========================================================= */

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-portrait {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--panel-line);
}

.about-portrait img {
  filter: grayscale(30%);
}

.kit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper-dim);
}

.kit-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--panel-line);
}

.kit-list li span:last-child {
  color: var(--slate);
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  max-width: 30ch;
}

.contact-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--panel-line);
  padding-bottom: 0.6rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-links a:hover {
  border-color: var(--safelight);
  color: var(--safelight);
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--panel-line);
  padding: 2rem var(--gutter) 2.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate);
}