/* =========================================================================
   Design tokens
   Same 4 brand colors from _config.yml, repurposed for readability:
   - --fg is new: body copy was previously set in the peach accent color,
     which is hard to read at paragraph length on a dark background.
     Peach is now reserved for links/labels/headings; body text uses a
     warm off-white instead.
========================================================================= */
:root {
  --bg: #0b1017;
  --bg-raised: #141d29;
  --fg: #f3ece1;
  --fg-muted: #dbd7a7;
  --accent: #ffb080;
  --accent-strong: #b06650;
  --accent-dark: #632310;
  --line: rgba(243, 236, 225, 0.14);
  --line-soft: rgba(243, 236, 225, 0.07);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.5rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --content-max: 1120px;
}

/* =========================================================================
   Reset / base
========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--fg);
}

p { margin: 0 0 1em; color: var(--fg); }

button { font-family: inherit; }

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

.wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }

section { padding-block: var(--space-5); }

@media (max-width: 640px) {
  section { padding-block: var(--space-4); }
  .wrap { padding: 0 18px; }
}

/* =========================================================================
   Header / nav
========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 16, 23, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title { margin: 0; font-size: var(--text-lg); }
.site-title a {
  color: var(--fg);
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.01em;
}
.site-title a:hover { color: var(--accent); }

.site-nav { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.site-nav a {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover {
  color: var(--fg);
  border-color: var(--accent-strong);
}

/* =========================================================================
   Hero
========================================================================= */
.hero { padding-block: var(--space-6) var(--space-4); }
.hero h2 {
  font-size: clamp(2.25rem, 6vw, var(--text-3xl));
  font-style: italic;
  font-weight: 400;
  max-width: 16ch;
}
.hero .lead {
  color: var(--fg-muted);
  font-size: var(--text-lg);
  max-width: 42ch;
  margin-top: var(--space-2);
}

.lead {
  color: var(--fg-muted);
  max-width: 46ch;
  margin-bottom: var(--space-3);
}

/* =========================================================================
   Section headings / eyebrow
========================================================================= */
.featured-projects h3,
.services h3,
.reviews h3,
#projects-page h1,
.blog-page h1,
.archive-page h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

/* =========================================================================
   Filter bar
========================================================================= */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.filter-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-button:hover {
  border-color: var(--accent-strong);
  color: var(--fg);
}

.filter-button.active,
.filter-button[aria-pressed="true"] {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--bg);
}

.filter-empty {
  display: none;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  padding: var(--space-3) 0;
}
.filter-empty.is-visible { display: block; }

.see-all { margin-top: var(--space-3); }

/* =========================================================================
   Project cards / grid
========================================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

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

.project {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project:hover,
.project:focus-within {
  transform: translateY(-3px);
  border-color: var(--accent-strong);
}

.thumb { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; display: block; background: var(--bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.project:hover .thumb img { transform: scale(1.04); }

.project h4 { font-size: var(--text-lg); margin: 0.75rem 0.9rem 0.4rem; }
.project h4 a { color: var(--fg); }
.project h4 a:hover { color: var(--accent); }

.project .tags { margin: 0 0.9rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  display: inline-block;
  background: rgba(243, 236, 225, 0.06);
  color: var(--fg-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

/* Hidden state for filtering */
.project.is-hidden { display: none; }

/* =========================================================================
   Services
========================================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.service-card {
  border: 1px solid var(--line-soft);
  padding: var(--space-3);
}
.service-card h4 {
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: 0.5em;
}
.service-card p { color: var(--fg-muted); font-size: var(--text-sm); margin: 0; }

/* =========================================================================
   Reviews
========================================================================= */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}
.review {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  padding: var(--space-3);
}
.review-stars {
  color: var(--accent);
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  margin-bottom: 0.6em;
}
.review blockquote {
  margin: 0 0 0.6em;
  color: var(--fg);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
}
.review cite { color: var(--fg-muted); font-size: var(--text-sm); font-style: normal; }
.reviews-empty { color: var(--fg-muted); font-size: var(--text-sm); }

/* =========================================================================
   CTA / footer
========================================================================= */
.cta {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.cta p { font-size: var(--text-lg); margin: 0; }

.site-footer {
  padding-block: var(--space-3);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* =========================================================================
   Project detail page
========================================================================= */
.project-header { padding-block: var(--space-4) var(--space-3); }
.project-header h1 { font-size: var(--text-2xl); }
.project-header .tagline { color: var(--fg-muted); font-size: var(--text-lg); margin-top: 0.3em; }
.project-header .meta { color: var(--fg-muted); font-size: var(--text-sm); margin-top: var(--space-2); }
.project-header .meta strong { color: var(--fg); font-weight: 600; }

.full-bleed {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
}

.project-cover { max-height: 82vh; overflow: hidden; }
.project-cover .cover-image { width: 100%; height: 100%; max-height: 82vh; object-fit: cover; display: block; }

.project-body { padding-block: var(--space-4); max-width: 68ch; }

/* Gallery: simple responsive grid + lightbox, replacing the old forced
   full-viewport scroll-snap slideshow (kept the full-bleed hero cover,
   which still reads well). */
.project-gallery { padding-block: var(--space-4) var(--space-5); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--bg-raised);
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.project-credits {
  padding-block: var(--space-3) var(--space-5);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 700px) {
  .project-cover { max-height: 60vh; }
  .project-cover .cover-image { max-height: 60vh; }
}

/* =========================================================================
   Lightbox
========================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 13, 0.94);
  padding: var(--space-3);
}
.lightbox.is-open { display: flex; }

.lightbox-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap { max-height: 86vh; display: flex; }
.lightbox-image-wrap img {
  max-height: 86vh;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(243, 236, 225, 0.08);
  color: var(--fg);
  border: 1px solid var(--line);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--bg); }
.lightbox-prev { left: -8px; }
.lightbox-next { right: -8px; }

@media (max-width: 700px) {
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: transparent;
  color: var(--fg);
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.lightbox-close:hover { color: var(--accent); }

.lightbox-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* =========================================================================
   Stub pages (blog / archive "coming soon")
========================================================================= */
.stub-page { padding-block: var(--space-6); text-align: center; }
.stub-page h1 { font-size: var(--text-2xl); }
.stub-page p { color: var(--fg-muted); max-width: 40ch; margin: var(--space-2) auto 0; }
