/* ============================================================
   Woodworking Portfolio — Modern Minimal Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&family=DM+Serif+Display:ital@0;1&display=swap');

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

:root {
  --bg:        #ffffff;
  --surface:   #f5f5f5;
  --text:      #0d0d0d;
  --text-mid:  #5a5a5a;
  --text-soft: #aaaaaa;
  --border:    #e8e8e8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Hero ──────────────────────────────────────────────────── */
header {
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.52) 50%,
      rgba(0, 0, 0, 0.72) 100%
    ),
    url('images/Elf.jpeg') center / cover no-repeat;
  padding: 7rem 2rem 6rem;
  text-align: center;
}

.header-inner {
  max-width: 700px;
  margin: 0 auto;
}

.site-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5.5rem);
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.site-title span { font-style: italic; }

.site-tagline {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
}

nav a {
  display: inline-block;
  padding: 1rem 1.25rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.15s;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

nav a:hover,
nav a.active { color: var(--text); }

nav a:hover::after,
nav a.active::after { transform: scaleX(1); }

/* ── Main ──────────────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 7rem;
}

/* ── Section header ────────────────────────────────────────── */
.section-header { margin-bottom: 3rem; }

.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.55rem;
}

.section-heading {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

/* ── Project card ──────────────────────────────────────────── */
.card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

/* Image wrapper with hover overlay */
.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-img {
  transform: scale(1.05);
}

/* Dark overlay + "View Project" text on hover */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.card:hover .card-overlay {
  background: rgba(0, 0, 0, 0.42);
}

.card-view {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card:hover .card-view {
  opacity: 1;
  transform: translateY(0);
}

/* Always-visible photo count badge */
.card-badge {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  pointer-events: none;
}

/* Card text */
.card-body {
  padding: 1rem 0 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tag { display: none; }

.card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.7;
  flex: 1;
}

/* ── Shop Section ──────────────────────────────────────────── */
.shop-banner-img {
  width: 100%;
  height: 520px;
  background: url('images/Machines_cover.jpeg') center 40% / cover no-repeat;
}

.shop-info {
  background: #0f0f0f;
  padding: 5rem 2rem 6rem;
}

.shop-info-inner {
  max-width: 760px;
  margin: 0 auto;
}

.shop-info .about-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.85rem;
}

.shop-info h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 2rem;
}

.shop-info p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.9;
}

.shop-info p + p { margin-top: 1.4rem; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
  letter-spacing: 0.08em;
}

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: #080808;
  z-index: 999;
  overflow: hidden;
}

.lightbox[hidden] { display: none; }

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  padding: 0.4rem 0.6rem;
  transition: color 0.15s;
}

.lb-close:hover { color: #fff; }

/* Stage fills the entire lightbox */
.lb-stage {
  position: absolute;
  inset: 0;
}

/* Media fills the entire stage */
.lb-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-media img,
.lb-media video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Arrows */
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem 1.25rem;
  transition: color 0.15s;
  z-index: 10;
}

.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-prev:hover,
.lb-next:hover { color: #fff; }

.lb-prev:disabled,
.lb-next:disabled { opacity: 0; pointer-events: none; }

/* Info bar — gradient overlay pinned to bottom */
.lb-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82) 35%);
  padding: 4rem 2.5rem 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  pointer-events: none;
}

.lb-bar > * { pointer-events: auto; }

.lb-info { flex: 1; min-width: 0; }

.lb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.lb-tag-text,
.lb-counter {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.lb-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.2rem;
}

.lb-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.lb-thumbs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  max-width: 280px;
}

.lb-thumb {
  width: 52px;
  height: 38px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s;
  border: 1px solid transparent;
}

.lb-thumb:hover { opacity: 0.8; }

.lb-thumb.is-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.7);
}

.lb-thumb-vid {
  width: 52px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  border: 1px solid transparent;
}

.lb-thumb-vid:hover { opacity: 0.8; }

.lb-thumb-vid.is-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.7);
}

/* ── Techniques Section ─────────────────────────────────────── */
.techniques-section {
  padding: 0 0 6rem;
}

/* Video banner */
.tech-banner {
  position: relative;
  height: 70vh;
  overflow: hidden;
  margin-bottom: 5rem;
}

.tech-banner-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.tech-banner-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.35) 50%,
      rgba(0, 0, 0, 0.55) 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-banner-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 5.5rem);
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
}

.tech-banner-title span { font-style: italic; }

.techniques-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.ba-intro {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 1.5rem;
}

/* ── Before / After Slider ─────────────────────────────────── */
.ba-slider {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  max-height: 70vh;
}

.ba-before,
.ba-after {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ba-before img,
.ba-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ba-before { clip-path: inset(0 50% 0 0); }

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.ba-line {
  flex: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
}

.ba-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.ba-label {
  position: absolute;
  bottom: 1rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.25rem 0.65rem;
}

.ba-label-before { left: 1rem; }
.ba-label-after  { right: 1rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .shop-banner-img { height: 320px; }
  .lb-bar { padding: 2.5rem 1.25rem 1rem; }
}

@media (max-width: 600px) {
  /* Nav — scrollable strip, no wrap */
  .nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .nav-inner::-webkit-scrollbar { display: none; }
  nav a {
    padding: 0.85rem 0.9rem;
    font-size: 0.67rem;
    white-space: nowrap;
  }

  /* Header */
  header { padding: 4rem 1.25rem 3rem; }

  /* Main / gallery */
  main { padding: 1.75rem 1rem 4rem; }
  .section-header { margin-bottom: 1.75rem; }
  .section-heading { font-size: 1.75rem; }
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
  .card-title { font-size: 1rem; }
  .card-desc  { font-size: 0.8rem; }
  .card-body  { padding: 0.65rem 0 0; }

  /* Techniques */
  .tech-banner { height: 45vh; margin-bottom: 3rem; }
  .ba-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .techniques-inner { padding: 0 1rem; }

  /* Shop banner */
  .shop-banner-img { height: 240px; }
  .shop-info { padding: 2.5rem 1.25rem 3.5rem; }
  .shop-info h2 { font-size: 1.8rem; margin-bottom: 1.25rem; }

  /* Lightbox */
  .lb-close { top: 0.75rem; right: 0.75rem; }
  .lb-bar { padding: 2rem 1rem 0.75rem; gap: 0.75rem; }
  .lb-title { font-size: 1rem; }
  .lb-desc  { font-size: 0.72rem; }
  .lb-thumbs { max-width: none; flex-wrap: nowrap; overflow-x: auto; }
  .lb-thumb, .lb-thumb-vid { flex-shrink: 0; }
}

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