:root {
  --bg: #050506;
  --panel: #0e0e10;
  --panel-soft: #151519;
  --text: #f4f1eb;
  --muted: #a8a29a;
  --line: rgba(244, 241, 235, 0.14);
  --accent: #d8b36a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(216, 179, 106, 0.1), transparent 28%),
    linear-gradient(215deg, rgba(120, 136, 154, 0.12), transparent 34%),
    linear-gradient(180deg, #050506 0%, #0b0b0d 48%, #050506 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    linear-gradient(rgba(244, 241, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 235, 0.028) 1px, transparent 1px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 5px);
  background-size: 72px 72px, 72px 72px, 100% 5px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 82%);
  opacity: 0.5;
}

body::after {
  z-index: 0;
  background: linear-gradient(110deg, transparent 0%, transparent 42%, rgba(216, 179, 106, 0.12) 49%, transparent 56%, transparent 100%);
  transform: translateX(-32%);
  animation: backgroundSweep 12s ease-in-out infinite alternate;
}

button {
  color: inherit;
  font: inherit;
}

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

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.hero {
  position: relative;
  display: block;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  left: clamp(1rem, 4vw, 2.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  bottom: -1px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(216, 179, 106, 0.8), transparent);
  opacity: 0.7;
}

.hero-copy {
  max-width: 960px;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 760px;
  color: #d8d1c5;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.5;
  margin-bottom: 0;
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.skill-row span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 0.56rem 0.75rem;
  color: #e7dfd3;
  font-size: 0.82rem;
}

.portfolio {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.2rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 4vw, 3rem);
}

.section-head {
  display: block;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-head p:last-child {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 0.85rem;
}

.work-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: zoom-in;
  display: grid;
  grid-template-rows: auto auto;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.work-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, transparent 0%, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%, transparent 100%);
  opacity: 0;
  transform: translateX(-42%);
  transition:
    opacity 220ms ease,
    transform 520ms ease;
  pointer-events: none;
}

.work-card img {
  width: 100%;
  height: auto;
  object-fit: fill;
  opacity: 0.88;
  background: #ddd9d2;
  transition: transform 650ms ease, opacity 650ms ease;
}

.work-card span {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: space-between;
  padding: 0.72rem 0.8rem;
  border-top: 1px solid var(--line);
  background: rgba(5, 5, 6, 0.94);
  color: #d7d0c5;
  font-size: 0.76rem;
  text-align: left;
}

.work-card strong {
  color: var(--text);
}

.work-card:hover img,
.work-card:focus-visible img {
  opacity: 1;
  transform: scale(1);
}

.work-card:hover,
.work-card:focus-visible {
  border-color: rgba(216, 179, 106, 0.55);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(216, 179, 106, 0.13);
  transform: translateY(-3px);
}

.work-card:hover::after,
.work-card:focus-visible::after {
  opacity: 1;
  transform: translateX(42%);
}

.work-card:focus-visible,
.lightbox button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 1rem;
  padding: 5rem clamp(1rem, 4vw, 3rem) 2rem;
  background: rgba(5, 5, 6, 0.985);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox figure {
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin: 0;
  min-width: 0;
}

.lightbox img {
  max-height: calc(100vh - 11rem);
  width: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #080808;
}

.lightbox figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
  color: var(--muted);
}

.lightbox figcaption strong {
  color: var(--text);
}

#lightbox-count {
  border: 1px solid var(--line);
  padding: 0.24rem 0.5rem;
  color: #d8d1c5;
  font-size: 0.78rem;
}

.lightbox button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  min-height: 48px;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1rem;
}

.lightbox-nav {
  width: 100%;
  height: 72px;
}

@media (max-width: 980px) {
  .hero {
    padding-top: 1.25rem;
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero,
  .portfolio {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  h1 {
    font-size: clamp(2.3rem, 13vw, 3.4rem);
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .work-card span {
    display: block;
    padding: 0.55rem 0.6rem;
    font-size: 0.72rem;
  }

  .work-card span strong {
    display: block;
    margin-bottom: 0.25rem;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "image image"
      "prev next";
    padding: 4.5rem 1rem 1rem;
  }

  .lightbox figure {
    grid-area: image;
  }

  .lightbox img {
    max-height: calc(100vh - 13rem);
  }

  .lightbox .prev {
    grid-area: prev;
  }

  .lightbox .next {
    grid-area: next;
  }
}

@keyframes backgroundSweep {
  from {
    transform: translateX(-32%);
    opacity: 0.38;
  }
  to {
    transform: translateX(32%);
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
