/* ==========================================================================
   LUC DAVIES PHOTOGRAPHY — shared stylesheet
   --------------------------------------------------------------------------
   Design tokens live at the top as CSS custom properties. Change a value
   here and it updates everywhere it's used — that's the whole point of
   tokens instead of hardcoding colors/sizes all over the file.
   ========================================================================== */

:root {
  /* Color: cool charcoal instead of pure black, warm off-white text,
     brass/tungsten accent (evokes old tungsten studio lighting) */
  --bg: #0b0d10;
  --bg-panel: #15181c;
  --bg-panel-2: #1c2025;
  --fg: #edeae4;
  --fg-muted: #8b8f94;
  --accent: #c9a24b;
  --accent-bright: #e8c874;
  --line: rgba(237, 234, 228, 0.12);
  --line-strong: rgba(237, 234, 228, 0.22);

  /* Type: a dramatic high-contrast serif for display, a clean grotesk
     for body copy, and a monospace for "camera data" style captions */
  --font-display: "Bodoni Moda", "Georgia", serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  /* Spacing scale — one number, multiplied, instead of arbitrary pixels */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  --max-width: 1240px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

@media (min-width: 700px) {
  .wrap {
    padding-inline: var(--space-5);
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.site-nav.is-scrolled {
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}

@media (min-width: 700px) {
  .site-nav {
    padding: var(--space-3) var(--space-5);
  }
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.brand em {
  color: var(--accent);
  font-style: normal;
}

.brand-mark {
  display: block;
  height: 42px;
  width: auto;
}

@media (min-width: 700px) {
  .brand-mark {
    height: 52px;
  }
}

.nav-links {
  display: none;
  gap: var(--space-4);
  align-items: center;
}

@media (min-width: 700px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--fg);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 10px 10px;
  cursor: pointer;
}

@media (min-width: 700px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--fg);
}

.nav-toggle span + span {
  margin-top: 4px;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-strip {
  position: relative;
  height: 78svh;
  min-height: 460px;
  max-height: 760px;
  overflow: hidden;
}

.hero-strip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Slight desaturation + darkening keeps the photo from fighting the
     moody palette while still reading as a real photograph, not a
     gradient. */
  filter: saturate(0.85) brightness(0.75) contrast(1.05);
}

.hero-strip-band {
  /* The centered, semi-transparent horizontal band that carries the
     title — sits roughly across the lower third of the photo. */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14%;
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(
    0deg,
    rgba(11, 13, 16, 0.55) 0%,
    rgba(11, 13, 16, 0.42) 50%,
    rgba(11, 13, 16, 0.55) 100%
  );
  backdrop-filter: blur(2px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  margin-bottom: var(--space-2);
}

.hero-strip h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  color: var(--fg);
}

.hero-strip h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-strip-sub {
  margin-top: var(--space-2);
  max-width: 46ch;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
}

.scroll-cue {
  margin-top: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.scroll-cue .line {
  width: 32px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.scroll-cue .line::after {
  content: "";
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: cue-sweep 2.2s ease-in-out infinite;
}

@keyframes cue-sweep {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* --------------------------------------------------------------------------
   Gallery — the signature "developing" effect
   -------------------------------------------------------------------------- */
.gallery-section {
  padding: var(--space-6) 0 var(--space-6);
}

.section-head {
  padding-inline: var(--space-3);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (min-width: 700px) {
  .section-head {
    padding-inline: var(--space-5);
  }
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
}

.section-head p {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-1);
  padding-inline: var(--space-1);
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.photo-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-panel);
}

.photo-card.span-2 {
  grid-column: span 2;
  aspect-ratio: 8 / 5;
}

@media (max-width: 480px) {
  .photo-card.span-2 {
    grid-column: span 1;
    aspect-ratio: 4 / 5;
  }
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Undeveloped state: desaturated, dim, slightly enlarged — like a
     print still sitting in the chemical bath */
  filter: grayscale(1) contrast(0.9) brightness(0.55);
  transform: scale(1.06);
  transition: filter 1.4s ease, transform 1.8s ease;
}

.photo-card.in-view img {
  /* Developed state: the image "resolves" into full color and detail */
  filter: grayscale(0) contrast(1) brightness(1);
  transform: scale(1);
  /* Once developed, switch to a snappier transition so hover/focus
     feels responsive rather than repeating the slow darkroom reveal. */
  transition: filter 0.35s ease, transform 0.45s ease;
}

@media (hover: hover) {
  .photo-card:hover img,
  .photo-card:focus-within img {
    /* TV-tile style focus: a gentle brighten + zoom, not a blowout.
       Scoped to real pointer devices — touchscreens don't get a
       reliable "un-hover", so this would otherwise leave a photo
       stuck zoomed-in after a single tap. */
    transform: scale(1.06);
    filter: grayscale(0) contrast(1.03) brightness(1.12) saturate(1.08);
  }
}

.photo-card:focus-within img {
  /* Keyboard focus still gets the effect on every device. */
  transform: scale(1.06);
  filter: grayscale(0) contrast(1.03) brightness(1.12) saturate(1.08);
}

.photo-card .caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-2);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.photo-card:hover .caption,
.photo-card:focus-within .caption {
  opacity: 1;
  transform: translateY(0);
}

/* Hover is unreliable on touch screens, so phones/tablets get the
   caption visible by default rather than losing the title/category
   entirely. Anything with a real mouse still gets the reveal effect. */
/* Touch devices can't hover, and the earlier fix of forcing captions
   permanently visible cluttered the photos — better to just leave
   them clean on mobile and keep the reveal effect for mouse users. */
@media (hover: none) {
  .photo-card .caption {
    display: none;
  }

  .hover-hint {
    display: none;
  }
}

.caption .cap-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.caption .cap-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-bright);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Generic content sections (about / contact reuse these)
   -------------------------------------------------------------------------- */
.section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--line);
}

.section-narrow {
  max-width: 760px;
}

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--space-3);
}

.body-copy {
  color: var(--fg-muted);
  max-width: 62ch;
}

.body-copy + .body-copy {
  margin-top: var(--space-2);
}

.two-col {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 800px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  max-width: 320px;
}

.stat-row .num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
}

.stat-row .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 4px;
}

.clients-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
}

.clients-list li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--space-1);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--fg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: var(--bg-panel-2);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--accent);
  color: #0b0d10;
  font-weight: 600;
  padding: 12px 22px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.form-status {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-bright);
  min-height: 1.2em;
}

.contact-meta {
  border-left: 1px solid var(--line);
  padding-left: var(--space-3);
}

.contact-meta .row {
  margin-bottom: var(--space-3);
}

.contact-meta .row .k {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.contact-meta .row .v {
  font-size: 1.05rem;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Newsletter signup strip
   -------------------------------------------------------------------------- */
.newsletter-strip {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
  background: var(--bg-panel);
}

.newsletter-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 700px) {
  .newsletter-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }
}

.newsletter-lede {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 42ch;
}

.newsletter-form {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  background: var(--bg-panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 10px 14px;
  color: var(--fg);
  min-width: 220px;
  flex: 1;
}

@media (max-width: 400px) {
  .newsletter-form input[type="email"] {
    /* 220px min-width overflows the smallest common phone widths
       (320–360px) once padding is subtracted — let it shrink and
       take the full row instead. */
    min-width: 0;
    width: 100%;
  }

  .newsletter-form .btn {
    width: 100%;
    justify-content: center;
  }
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.newsletter-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-bright);
  margin-top: var(--space-2);
  min-height: 1.2em;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
  justify-content: space-between;
}

@media (min-width: 700px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
  }
}

.footer-inner p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: var(--space-3);
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

.footer-signature {
  height: 28px;
  width: auto;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Editing manifesto — a small "code editor" styled card
   -------------------------------------------------------------------------- */
.code-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.code-card-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 10px 14px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.code-card-title {
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
}

.code-card-body {
  margin: 0;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.9;
  overflow-x: auto;
}

@media (max-width: 480px) {
  .code-card-body {
    padding: var(--space-3);
    font-size: 0.76rem;
    line-height: 1.7;
  }
}

.code-card-body .tok-comment {
  color: #7d9e6f; /* muted green, like a code comment */
}

.blink-cursor {
  color: var(--accent);
  animation: cursor-blink 1s steps(1, end) infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Hidden easter egg overlay (triggered from script.js)
   -------------------------------------------------------------------------- */
.egg-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.egg-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.egg-card {
  max-width: 460px;
  text-align: center;
}

.egg-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.egg-card h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: var(--space-2);
}

.egg-body {
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}

.egg-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0.6;
}
