/* ---------------------------------------------------------
   Joe Hua — photography portfolio
   Visual language adapted from Squarespace's "Talva" template:
   one bold grotesk family, achromatic dark palette (deep charcoal,
   not pure black - suits astro/underwater subjects better than a
   light ground), zero-gap edge-to-edge masonry grid, captions on
   hover only, full-bleed lightbox with no matting or chrome.
--------------------------------------------------------- */

:root {
  --paper: #0c0d10;
  --ink: #f1f1ef;
  --muted: #98999d;
  --rule: #2a2b30;
  --gap: clamp(1rem, 2.2vw, 1.75rem);
  --side: clamp(1.25rem, 5vw, 3.5rem);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--side);
  background: rgba(12, 13, 16, 0.92);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.wordmark span {
  font-weight: 800;
  color: var(--ink);
}

.main-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.main-nav a {
  position: relative;
  padding-bottom: 3px;
  color: var(--ink);
  font-size: 0.95rem;
}

.main-nav a.active,
.main-nav a:hover {
  border-bottom: 1px solid var(--ink);
}

.nav-toggle {
  display: none;
}

/* ---------- generic sections ---------- */

.section {
  padding: clamp(2.5rem, 6vw, 4rem) var(--side);
}

.section-head {
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.section-head h2 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.section-head + .section-divider {
  display: none;
}

.section-divider {
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.intro {
  max-width: 40rem;
}

.intro p {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- masonry grid (Talva-style, spaced, no chrome) ---------- */

.grid {
  columns: 1;
  column-gap: var(--gap);
}

@media (min-width: 640px) {
  .grid { columns: 2; }
}

@media (min-width: 1000px) {
  .grid { columns: 3; }
}

.grid-item {
  position: relative;
  break-inside: avoid;
  cursor: zoom-in;
  display: block;
  margin-bottom: var(--gap);
}

.grid-item figure {
  margin: 0;
  overflow: hidden;
}

.grid-item .thumb {
  width: 100%;
  display: block;
}

.grid-item figcaption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.grid-item:hover figcaption {
  opacity: 1;
}

/* ---------- home highlight stack (single column, large, no lightbox) ---------- */

.home-grid {
  padding: var(--gap) var(--side);
  display: block;
  columns: auto;
}

.home-grid .grid-item {
  width: 100%;
  cursor: default;
}

.home-grid .thumb {
  width: 100%;
  max-height: 80vh;
  object-fit: cover;
  display: block;
}

.view-all {
  display: inline-block;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: 0.85rem 1.75rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.85rem;
}

.view-all:hover { background: var(--muted); }

/* ---------- about ---------- */

.about-copy {
  max-width: 38rem;
}

.about-copy .lede {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.4;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.about-copy p { max-width: 38rem; }

.about-facts {
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.about-facts dt {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1rem;
}

.about-facts dd {
  margin: 0.2rem 0 0;
  font-weight: 500;
}

/* ---------- contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
}

@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-email {
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  font-weight: 800;
  color: var(--ink);
  word-break: break-word;
  letter-spacing: -0.01em;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.contact-list li {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
  display: flex;
  justify-content: space-between;
}

.contact-list li:last-child { border-bottom: 1px solid var(--rule); }

form.contact-form {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field label {
  font-size: 0.75rem;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 1rem;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0.1rem;
  background: transparent;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field textarea { resize: vertical; min-height: 6rem; }

.submit-btn {
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.submit-btn:hover { background: var(--muted); }

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

.site-footer {
  padding: 2rem var(--side);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a:hover { color: var(--ink); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* ---------- lightbox (full-bleed, no matting) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 7, 9, 0.98);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

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

.lightbox figure {
  margin: 0;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  display: block;
}

.lightbox figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 1rem;
  text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  padding: 0.75rem;
  opacity: 0.55;
}

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

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

/* ---------- responsive nav ---------- */

@media (max-width: 640px) {
  .main-nav {
    position: fixed;
    inset: 4.2rem 0 auto 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1.5rem var(--side) 2rem;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }

  .main-nav.is-open { transform: translateY(0); }

  .nav-toggle {
    display: inline-block;
    background: none;
    border: none;
    font-family: var(--sans);
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--ink);
  }
}
