/* =========================================================
   Crawley Photography - styles
   Mobile-first. Colors and fonts are set in :root below.
   ========================================================= */
:root {
  --bg: #0e0e10;
  --bg-alt: #151518;
  --surface: #1c1c21;
  --text: #f3efe8;
  --muted: #a9a49c;
  --accent: #d9a35b;        /* warm stage-light gold */
  --accent-hover: #e8b774;
  --line: rgba(255, 255, 255, 0.09);
  --radius: 10px;
  --maxw: 1200px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.6rem, 11vw, 5.5rem); }
h2 { font-size: clamp(2rem, 6vw, 3.1rem); }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-bottom: 0.75rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #111; padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.8rem 1.5rem;
  border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent); color: #141210;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #141210; transform: translateY(-1px); }
.btn-ghost, .btn-outline { background: transparent; color: var(--text); border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover, .btn-outline:hover { background: rgba(255,255,255,0.08); color: var(--text); border-color: var(--text); }
.btn-small { min-height: 40px; padding: 0.5rem 1.1rem; font-size: 0.875rem; }
.btn-lg { min-height: 56px; padding: 1rem 1.75rem; font-size: 1rem; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.site-header.scrolled, .site-header.nav-open { background: rgba(14,14,16,0.94); border-bottom-color: var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo { display: block; height: 32px; width: auto; }
.brand-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: 0.02em; }

.nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; margin-right: -10px;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle-bar { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: rgba(14,14,16,0.98); border-bottom: 1px solid var(--line);
  display: none;
}
.site-nav.open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0.5rem 1.25rem 1.25rem; display: flex; flex-direction: column; }
.site-nav a:not(.btn) { display: block; padding: 0.9rem 0; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--line); }
.site-nav a:not(.btn):hover { color: var(--accent); }
.site-nav .btn { margin-top: 1rem; width: 100%; }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; display: block; background: none; border: 0; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 2rem; padding: 0; }
  .site-nav a:not(.btn) { padding: 0.25rem 0; border: 0; font-size: 0.925rem; }
  .site-nav .btn { margin: 0; width: auto; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: flex; align-items: flex-end; overflow: hidden; background: #09090b;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,10,0.92) 0%, rgba(8,8,10,0.45) 45%, rgba(8,8,10,0.25) 100%); }
.hero-content { position: relative; padding-top: calc(var(--header-h) + 2rem); padding-bottom: clamp(3rem, 10vh, 6rem); }
.hero h1 { margin-bottom: 0.25em; text-shadow: 0 2px 30px rgba(0,0,0,0.5); }
.tagline { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: #e2ddd5; max-width: 36rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 10vw, 7rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 1.75rem; }

/* ---------- Portfolio tabs + grid ---------- */
.tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 44px; padding: 0.6rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 0.925rem; font-weight: 500; cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.tab[aria-selected="true"] { background: var(--text); color: #121212; border-color: var(--text); }
.panel-intro { color: var(--muted); max-width: 40rem; margin-bottom: 1.5rem; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; } }
@media (min-width: 1100px) { .grid { gap: 1rem; } }

.grid-item {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--surface);
}
.grid-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease, opacity 0.4s; opacity: 0; }
.grid-item img.loaded { opacity: 1; }
.grid-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 40%); opacity: 0; transition: opacity 0.3s; }
.grid-item:hover img, .grid-item:focus-visible img { transform: scale(1.04); }
.grid-item:hover::after, .grid-item:focus-visible::after { opacity: 1; }
.grid-item:focus-visible { outline-offset: 2px; }
.grid-empty { grid-column: 1 / -1; margin: 0; padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; }

/* ---------- About ---------- */
.about { display: grid; gap: 2.5rem; align-items: center; }
.about-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.about-text p:not(.eyebrow) { color: #d6d1c9; }
.about-text .btn { margin-top: 0.5rem; }
@media (min-width: 820px) {
  .about { grid-template-columns: 5fr 7fr; gap: 4rem; }
  .about-photo { max-width: 460px; }
}

/* ---------- Book ---------- */
.book { text-align: center; max-width: 820px; }
.book-lead { color: #d6d1c9; font-size: 1.075rem; max-width: 40rem; margin: 0 auto 2.25rem; }
.book-actions { display: flex; flex-direction: column; gap: 0.75rem; align-items: stretch; max-width: 360px; margin: 0 auto; }
@media (min-width: 820px) {
  .book-actions { flex-direction: row; justify-content: center; max-width: none; }
}
.book-note { color: var(--muted); margin-top: 2rem; font-size: 0.925rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0a0a0c; border-top: 1px solid var(--line); padding: 3rem 0 1.5rem; font-size: 0.925rem; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0; }
.footer-sub { color: var(--muted); margin: 0.25rem 0 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text); word-break: break-word; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--muted); }
@media (min-width: 820px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .footer-links { text-align: right; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,5,7,0.96); padding: 3.5rem 0.5rem;
  animation: lb-in 0.2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lb-img { max-width: 100%; max-height: calc(100vh - 8rem); max-height: calc(100svh - 8rem); object-fit: contain; border-radius: 4px; box-shadow: 0 10px 60px rgba(0,0,0,0.6); user-select: none; }
.lb-caption { color: var(--muted); font-size: 0.875rem; margin-top: 0.75rem; text-align: center; }
.lb-btn {
  position: absolute; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid rgba(255,255,255,0.15);
  font-size: 2rem; line-height: 1; cursor: pointer; transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-close { top: 0.75rem; right: 0.75rem; font-size: 1.9rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
@media (max-width: 699px) {
  .lb-prev, .lb-next { top: auto; bottom: 0.75rem; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
  .lightbox { padding-bottom: 4.5rem; }
}
@media (min-width: 700px) { .lightbox { padding: 3.5rem 5rem; } .lb-prev { left: 1.25rem; } .lb-next { right: 1.25rem; } }
@media (max-width: 400px) { .brand-logo { height: 26px; } .brand-name { font-size: 1.15rem; } .brand { gap: 0.5rem; } }
