/* ==========================================================================
   Mike Gibney Photography — single-page, sleek black.
   Left: large photo viewer. Right: scrollable 5-wide thumbnail grid.
   Scroll down for About + Contact.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --ink: #f4f3f1;
  --muted: #8c8a86;
  --faint: #565451;
  --line: #1d1d1d;
  --line-2: #2a2a2a;
  --accent: #d8d4cc;
  --bar-h: 60px;
  --thumb-cols: 5;
  --gap: 8px;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ----- Top bar -------------------------------------------------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.2rem);
  background: linear-gradient(180deg, rgba(10,10,10,0.92), rgba(10,10,10,0.55) 70%, transparent);
  backdrop-filter: blur(6px);
}
.wordmark { display: flex; align-items: baseline; gap: 0.6rem; }
.wordmark .name { font-size: 0.95rem; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 500; }
.wordmark .sub { font-size: 0.6rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.topnav { display: flex; gap: clamp(1rem, 2.4vw, 2rem); }
.topnav a {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  transition: color 0.2s ease;
}
.topnav a:hover { color: var(--ink); }

/* ----- Splash (full-screen opener) ----------------------------------- */
.splash {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #000;
}
.splash-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s ease, transform 8s ease-out;
}
.splash-img.loaded { opacity: 1; transform: scale(1); }
.splash::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 35%, rgba(0,0,0,0.5) 100%);
}
.splash-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}
.splash-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  letter-spacing: 0.02em;
  margin: 0;
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
}
.splash-sub {
  margin: 0.6rem 0 0;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(244,243,241,0.92);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.splash-scroll {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(244,243,241,0.85);
}
.splash-scroll .chev { width: 14px; height: 14px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); animation: bob 1.8s ease-in-out infinite; }
.splash-scroll:hover { color: #fff; }

/* ----- Gallery (split) ------------------------------------------------ */
.gallery {
  height: 100vh;
  padding-top: var(--bar-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 44vw, 760px);
}

/* Left: viewer */
.viewer {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.6rem);
  min-width: 0;
  background: #060606;
  border-right: 1px solid var(--line);
}
.viewer-img {
  max-width: 100%;
  max-height: calc(100vh - var(--bar-h) - 5.5rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
}
.viewer-img.loaded { opacity: 1; }
.viewer-meta {
  position: absolute;
  left: clamp(1rem, 3vw, 2.6rem);
  bottom: clamp(0.8rem, 2.5vw, 1.6rem);
  right: clamp(1rem, 3vw, 2.6rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}
.viewer-meta .label { pointer-events: auto; }
.viewer-meta .title { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.01em; }
.viewer-meta .caption { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.expand-btn {
  pointer-events: auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-2);
  color: var(--ink);
  width: 42px; height: 42px;
  display: grid; place-items: center;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: none;
}
.expand-btn:hover { background: rgba(255,255,255,0.14); border-color: var(--accent); }
.expand-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Right: thumbnail grid */
.thumbs {
  height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--gap);
  display: grid;
  grid-template-columns: repeat(var(--thumb-cols), 1fr);
  gap: var(--gap);
  align-content: start;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.thumbs::-webkit-scrollbar { width: 9px; }
.thumbs::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 6px; }
.thumbs::-webkit-scrollbar-track { background: transparent; }
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: #141414;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.62;
  transition: opacity 0.25s ease, transform 0.5s cubic-bezier(.2,.7,.2,1);
}
.thumb:hover img { opacity: 1; transform: scale(1.05); }
.thumb.active img { opacity: 1; }
.thumb.active { outline: 2px solid var(--accent); outline-offset: -2px; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}
.scroll-hint .chev { width: 14px; height: 14px; border-right: 1px solid var(--faint); border-bottom: 1px solid var(--faint); transform: rotate(45deg); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: rotate(45deg) translate(0,0);} 50%{ transform: rotate(45deg) translate(2px,2px);} }

/* ----- Fullscreen expand --------------------------------------------- */
.fullscreen {
  position: fixed; inset: 0;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}
.fullscreen.open { display: flex; }
.fullscreen img { width: 100vw; height: 100vh; object-fit: contain; }
.fs-close {
  position: absolute; top: 1.2rem; right: 1.4rem;
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line-2);
  color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; border-radius: 3px;
}
.fs-close:hover { background: rgba(255,255,255,0.16); }
.fs-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-2);
  color: #fff; font-size: 1.5rem; cursor: pointer;
  display: grid; place-items: center;
}
.fs-nav:hover { background: rgba(255,255,255,0.16); }
.fs-prev { left: 1.2rem; }
.fs-next { right: 1.2rem; }

/* ----- About ---------------------------------------------------------- */
.section { padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.eyebrow { font-size: 0.66rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 1.5rem; }
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-portrait { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(0.1) contrast(1.02); }
.about-copy h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.5rem; line-height: 1.1; }
.about-copy p { color: #cfcdc9; margin: 0 0 1.15rem; }
.about-copy .q { font-family: var(--serif); font-style: italic; font-size: 1.18rem; color: var(--ink); padding-left: 1.1rem; border-left: 1px solid var(--line-2); margin: 1.4rem 0; }

/* ----- Contact -------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-copy h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.2rem; }
.contact-copy p { color: #cfcdc9; }
.detail { margin-top: 1.6rem; }
.detail span { display: block; font-size: 0.64rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.detail a, .detail strong { font-size: 1.05rem; font-weight: 500; }
.detail a:hover { color: var(--accent); }

form .field { margin-bottom: 1.1rem; }
form label { display: block; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem; }
form input, form select, form textarea {
  width: 100%; padding: 0.8rem 0.95rem;
  background: #111; border: 1px solid var(--line-2);
  color: var(--ink); font-family: inherit; font-size: 0.98rem; border-radius: 2px;
  transition: border-color 0.2s ease;
}
form input::placeholder, form textarea::placeholder { color: var(--faint); }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--accent); }
form textarea { min-height: 130px; resize: vertical; }
.btn {
  display: inline-block; cursor: pointer;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.85rem 1.9rem; background: var(--ink); color: #0a0a0a; border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.form-status { margin-top: 0.9rem; font-size: 0.9rem; min-height: 1.3em; color: var(--muted); }
.form-status.ok { color: var(--accent); }

.footer { padding: 2.5rem clamp(1.25rem, 6vw, 5rem); border-top: 1px solid var(--line); color: var(--faint); font-size: 0.72rem; letter-spacing: 0.06em; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; }

/* ----- Responsive ----------------------------------------------------- */
@media (max-width: 1180px) { :root { --thumb-cols: 4; } .gallery { grid-template-columns: minmax(0,1fr) clamp(300px, 50vw, 620px); } }
@media (max-width: 900px) {
  .gallery { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: auto; min-height: calc(100vh - var(--bar-h)); }
  .viewer { border-right: 0; border-bottom: 1px solid var(--line); min-height: 56vh; }
  .viewer-img { max-height: 56vh; }
  .thumbs { height: auto; max-height: 42vh; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 260px; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) { :root { --thumb-cols: 3; } .topnav { gap: 1rem; } }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .viewer-img, .thumb img { transition: none; }
  .scroll-hint .chev { animation: none; }
}
