/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

#top,
#work,
#services,
#about,
#contact {
  scroll-margin-top: 72px;
}

:root {
  --bg: #0c0c0f;
  --bg-alt: #131316;
  --surface: #1a1a1f;
  --surface-2: #202027;
  --border: #2b2b33;
  --text: #f2f2f5;
  --text-muted: #9a9aa5;
  --accent: #5ec8f0;
  --accent-soft: rgba(94, 200, 240, 0.35);
  --site-bg-image: none;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  line-height: 1.6;
}

/* Set once background.js finds an image in images/background/photos.js.
   Layers a dark scrim under the image (for text contrast) and lets the
   fixed background show through the sections that would otherwise cover it. */
body.has-bg-image {
  background-image: linear-gradient(rgba(12, 12, 15, 0.82), rgba(12, 12, 15, 0.82)), var(--site-bg-image);
}

body.has-bg-image .hero,
body.has-bg-image .page-hero,
body.has-bg-image .services,
body.has-bg-image .contact {
  background: transparent;
}

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

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

ul {
  list-style: none;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
              color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.btn-primary {
  background: rgba(94, 200, 240, 0.22);
  border-color: rgba(94, 200, 240, 0.45);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(94, 200, 240, 0.15);
}

.btn-primary:hover {
  transform: translateY(-6px);
  background: rgba(94, 200, 240, 0.32);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 10px rgba(94, 200, 240, 0.15),
              0 22px 30px -12px var(--accent-soft),
              0 0 26px 4px rgba(94, 200, 240, 0.45);
}

.btn-primary:active {
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.btn-secondary:hover {
  transform: translateY(-6px);
  background: rgba(94, 200, 240, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 22px 30px -14px rgba(0, 0, 0, 0.6),
              0 0 22px 2px rgba(94, 200, 240, 0.3);
}

.btn-secondary:active {
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo span {
  font-weight: 400;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.site-nav a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 100px;
  background: radial-gradient(circle at 50% 0%, var(--bg-alt) 0%, var(--bg) 60%);
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 3rem;
  max-width: 800px;
  margin: 0 auto 20px;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.gallery-item {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-item span {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.gallery-item:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 26px -14px rgba(0, 0, 0, 0.7),
              0 0 20px 1px rgba(94, 200, 240, 0.25);
}

/* ---------- Project / Gallery Page ---------- */
.page-hero {
  padding: 160px 0 60px;
  background: radial-gradient(circle at 50% 0%, var(--bg-alt) 0%, var(--bg) 60%);
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.page-hero h1 {
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.page-hero .hero-sub {
  margin-bottom: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 100px;
}

.photo-tile {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* ---------- Lightbox ---------- */
body.lightbox-locked {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(6, 6, 8, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8),
              0 0 40px 4px rgba(94, 200, 240, 0.2);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.photo-tile:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 26px -14px rgba(0, 0, 0, 0.7),
              0 0 20px 1px rgba(94, 200, 240, 0.25);
}

/* ---------- Services ---------- */
.services {
  background: var(--bg-alt);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: rgba(26, 26, 31, 0.4);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease,
              background 0.25s ease, backdrop-filter 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  background: rgba(26, 26, 31, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 20px 26px -14px rgba(0, 0, 0, 0.7),
              0 0 20px 1px rgba(94, 200, 240, 0.25);
}

.service-card h3 {
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
}

/* ---------- About ---------- */
.about-inner {
  max-width: 720px;
}

.about p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--bg-alt);
}

.contact-inner {
  max-width: 560px;
}

.contact-form {
  margin-top: 24px;
}

.form-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-row input,
.form-row textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 200, 240, 0.18);
}

.form-note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.open {
    max-height: 300px;
  }

  .site-nav a {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
  }

  .hero {
    padding: 100px 0 70px;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  section {
    padding: 56px 0;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery-item {
    aspect-ratio: 3 / 2;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 120px 0 40px;
  }

  .page-hero h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
