/* ============================================
   DANIEL GRANT PHOTOGRAPHY — design tokens
   ============================================
   Color:
     --bg      #ffffff  white
     --fg      #111111  near-black text
     --muted   #666666  secondary text / inactive nav
     --line    #dddddd  hairline dividers
     --accent  #c9a227  muted brass/gold — used only for the active state
                         and the frame-number marks, like a light-table wax pencil
   Type:
     Display   'Fraunces' italic — the wordmark only
     Labels    'IBM Plex Mono' uppercase, tracked — nav, captions, frame numbers
               (a contact-sheet / negative-sleeve reference: this is a working
               archive of frames, not a glossy brochure)
   Signature:
     Each image in a gallery is marked with a frame number (No. 001, 002…)
     the way a photographer marks a contact sheet or a negative strip —
     this is real sequence information (shoot order), not decoration.
=============================================== */

:root {
  --bg: #ffffff;
  --bg-raised: #f5f5f3;
  --fg: #111111;
  --muted: #666666;
  --line: #dddddd;
  --accent: #c9a227;
  --hover-red: #1fc7c7;

  --font-display: 'Poppins', 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
  --font-mono: 'Poppins', 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;

  --nav-h: 76px;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Casual download deterrent: prevent selecting/dragging images */
.frame img,
.hero-slide img,
.category-tile img,
.lightbox img,
.about-photo img {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

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

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0e0e0e;
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus {
  left: var(--gutter);
  top: var(--gutter);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Header / Sidebar Nav ---------- */

:root {
  --sidebar-w: 240px;
}

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 100;
  background: linear-gradient(to bottom, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0));
  pointer-events: none;
}
.site-header a,
.site-header button { pointer-events: auto; }

.wordmark {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 200;
  font-size: clamp(12px, 1.5vw, 17px);
  letter-spacing: 0.03em;
  color: var(--fg);
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  text-transform: uppercase;
}

.main-nav a {
  color: var(--fg);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.main-nav a:hover { color: var(--hover-red); }
.main-nav a[aria-current="page"] {
  color: var(--hover-red);
  border-bottom-color: transparent;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 12px;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(78vw, 320px);
    background: var(--bg-raised);
    border-left: 1px solid var(--line);
    flex-direction: column;
    padding: calc(var(--nav-h) + 20px) var(--gutter) var(--gutter);
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .main-nav.is-open { transform: translateX(0); }
  .nav-toggle { display: block; }
}

/* Desktop: fixed left sidebar, titles stacked vertically like the reference site */
@media (min-width: 900px) {
  .site-header {
    top: 0; left: 0; bottom: 0; right: auto;
    width: var(--sidebar-w);
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 44px 32px 44px;
    background: var(--bg);
    border-right: none;
  }
  .wordmark {
    font-size: 23.5px;
    line-height: 1.3;
    letter-spacing: 0.03em;
    margin-top: 31px;
    margin-bottom: 59px;
    white-space: normal;
  }
  .wordmark .wm-line1,
  .wordmark .wm-line2 {
    display: block;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  /* DANIEL GRANT enlarged so it spans the same width as PHOTOGRAPHY */
  .wordmark .wm-line1 {
    font-size: 25px;
    font-weight: 500;
  }
  .wordmark .wm-line2 {
    font-size: 23.5px;
    font-weight: 500;
  }
  .main-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .main-nav a {
    font-size: 13px;
  }
  .main-nav .nav-spacer {
    display: block;
    height: 18px;
  }
  .nav-toggle { display: none; }

  /* Footer sits in the white space just below the bottom edge of the images */
  .sidebar-footer {
    position: absolute;
    top: calc(81px + min(72vh, 640px) + 68px);
    left: 32px;
    right: 32px;
    margin: 0;
  }

  body > main {
    margin-left: var(--sidebar-w);
  }
}

/* Sidebar footer: copyright + instagram icon (all sizes) */
.sidebar-footer {
  display: none;
}
@media (min-width: 900px) {
  .sidebar-footer {
    display: block;
    padding-top: 0;
  }
}
.sidebar-footer .copyright {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  margin: 0 0 18px;
}
.sidebar-social {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sidebar-social .ig-link {
  color: var(--fg);
  display: inline-flex;
  transition: color 0.2s ease;
}
.sidebar-social .ig-link:hover {
  color: var(--hover-red);
}
.sidebar-social .share-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.sidebar-social .share-link:hover {
  color: var(--hover-red);
}
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 400;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  overflow: visible;
  padding: 81px 0 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stage {
  position: relative;
  width: min(72vh, 560px);
  height: min(72vh, 560px);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(15%);
}
.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
}

.hero-caption {
  position: relative;
  z-index: 2;
  padding: 10px 0 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: min(72vh, 560px);
}

.hero-caption .frame-no { color: var(--accent); }
.hero-caption .cat-label {
  text-transform: uppercase;
  color: #111111;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero-index {
  display: none;
}
.hero-index .current { color: #111111; }

/* Intro line under the hero */
.intro {
  max-width: 640px;
  margin: 28px auto;
  padding: 0 var(--gutter);
  text-align: center;
  color: var(--muted);
  line-height: 1.9;
}
.intro em {
  font-family: var(--font-display);
  font-style: normal;
  color: var(--fg);
  font-size: 15px;
}

/* ---------- Category teaser grid (home) ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: transparent;
  margin: 0 var(--gutter) 60px 0;
}
@media (max-width: 860px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .category-grid { grid-template-columns: 1fr; }
}

.category-tile {
  position: relative;
  background: var(--bg);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.category-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0%);
}
.category-tile-label {
  position: absolute;
  left: 20px; bottom: 18px;
  z-index: 2;
  text-transform: uppercase;
  color: #ffffff;
  transition: color 0.2s ease;
}
.category-tile:hover .category-tile-label { color: var(--hover-red); }
.category-tile-label .no { color: var(--accent); margin-right: 8px; }
.category-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14,14,14,0.65), rgba(14,14,14,0) 55%);
}

/* ---------- Gallery: horizontal scroll row (category pages) ---------- */

.gallery-header {
  display: none;
}
.gallery-header h1 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 300;
  font-size: clamp(13px, 1.4vw, 15px);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hover-red);
}
.gallery-header p { display: none; }
.gallery-meta { display: none; }

.gallery-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 24px;
  padding: 81px 24px 40px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.gallery-grid::-webkit-scrollbar { height: 8px; }
.gallery-grid::-webkit-scrollbar-track { background: transparent; }
.gallery-grid::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.frame {
  position: relative;
  background: var(--bg);
  flex: 0 0 auto;
  margin: 0;
  width: min(72vh, 640px);
}
.frame-inner {
  width: 100%;
  height: min(72vh, 640px);
  overflow: hidden;
}
.frame.is-wide { }
.frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* Statement / description panel that sits inline in the gallery row */
.statement-panel {
  height: min(72vh, 640px);
  width: min(72vh, 640px) !important;
  display: flex;
  align-items: stretch;
  padding: 0;
}
.statement-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: #111111;
  font-weight: 300;
}
.statement-inner p {
  margin: 0 0 12px;
}
.statement-inner p:last-child { margin-bottom: 0; }
.statement-attribution {
  font-size: 11px;
  color: #666666;
  letter-spacing: 0.02em;
  margin-top: 14px !important;
}

/* Caption below the image, left edge aligned with image left edge */
.frame-caption {
  color: #111111;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 6px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.frame:hover .frame-caption { opacity: 1; }

.frame-tag {
  position: absolute;
  top: 14px; left: 16px;
  z-index: 2;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.frame:hover .frame-tag { opacity: 1; }

@media (max-width: 720px) {
  .frame {
    height: min(64vh, 460px);
    width: min(64vh, 460px);
  }
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.98);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(1100px, 90vw);
  max-height: 84vh;
  width: auto; height: auto;
  object-fit: contain;
  margin: 0;
  cursor: zoom-out;
  display: block;
}
.lightbox-frame {
  text-align: left;
  display: inline-block;
}
.lightbox-caption {
  margin-top: 12px;
  color: #111111;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: left;
}
.lightbox-caption .accent { color: var(--accent); }

.lightbox-close {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  background: none;
  border: none;
  color: #111111;
  cursor: pointer;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}
.lightbox-close:hover { color: var(--accent); }

/* ---------- About / Contact ---------- */

.page-block {
  padding: calc(var(--nav-h) + 70px) var(--gutter) 100px;
  max-width: 720px;
  margin: 0 auto;
}
.page-block h1 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 200;
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 30px;
  letter-spacing: 0;
}
.page-block p {
  color: var(--muted);
  line-height: 2;
  margin-bottom: 20px;
}
.page-block .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 18px;
}

/* ---------- About page: photo left, text right, tops aligned ---------- */

.about-block {
  padding: calc(var(--nav-h) + 80px) var(--gutter) 100px;
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.about-photo {
  width: 240px;
  margin: 0;
}
.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(100%);
}

.about-text {
  margin: 0;
}
.about-text h1 {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: 0.04em;
  margin: 0 0 24px;
  line-height: 1;
  margin-top: -4px;
}
.about-text p {
  color: var(--fg);
  line-height: 1.9;
  margin: 0 0 20px;
}
.about-text p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .about-block {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-photo {
    width: 200px;
  }
}

/* ---------- Contact form layout ---------- */

.contact-block {
  padding: 75px var(--gutter) 100px;
  max-width: 1100px;
  margin: 0 auto;
}
.contact-block h1 {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 30px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.contact-grid {
  display: block;
  max-width: 640px;
}

.contact-intro {
  color: var(--muted);
  line-height: 1.9;
  margin: 0 0 40px;
  max-width: 560px;
}

.contact-side .contact-side-name {
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.contact-form label {
  display: block;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.contact-form label .req {
  color: var(--muted);
  text-transform: none;
  font-size: 11px;
}
.contact-form .field {
  margin-bottom: 26px;
}
.contact-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 520px) {
  .contact-form .field-row { grid-template-columns: 1fr; }
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 14px;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}
.contact-submit {
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 16px 34px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 600;
}
.contact-submit:hover { background: var(--accent); }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
}
.contact-list li {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
}
.contact-list a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px var(--gutter) 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}
.site-footer a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .site-footer { flex-direction: column; gap: 14px; text-align: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slide, .category-tile img, .frame img, .main-nav {
    transition: none !important;
  }
}
