@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:          #141210;
  --bg-2:        #1c1916;
  --surface:     rgba(255, 248, 240, 0.04);
  --border:      rgba(255, 248, 240, 0.07);
  --border-hover:rgba(255, 248, 240, 0.18);

  --text:        #f5ede0;
  --text-2:      #b8a898;
  --text-3:      #6e5f52;

  --accent:      #c4794a;
  --accent-dim:  rgba(196, 121, 74, 0.15);

  --radius-card: 4px;
  --radius-img:  3px;
  --shadow:      0 1px 3px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.4);
  --shadow-hover:0 2px 6px rgba(0,0,0,0.35), 0 20px 60px rgba(0,0,0,0.55);
  --ease:        cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);

  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'DM Sans', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}


.video-bg {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-bg.active {
  opacity: 1;
  visibility: visible;
}

.video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 3rem 2rem;
}


.container {
  width: min(1160px, 90%);
  margin: 0 auto;
  padding: 7rem 0 9rem;
  position: relative;
  z-index: 1;
}


header {
  text-align: left;
  margin-bottom: 7rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border);
}

header::before {
  content: "Selected Works";
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 1.5rem;
}

h1 em {
  font-style: italic;
  color: var(--text-2);
}

h2 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-3);
  letter-spacing: 0.04em;
  max-width: 36ch;
}


.section {
  margin-bottom: 6rem;
}

.section h3 {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}


.service-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}


.card {
  background: var(--bg);
  transition: background 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-2);
}

.card::before {
  counter-increment: card;
  content: counter(card, decimal-leading-zero);
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-3);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s;
}

.section {
  counter-reset: card;
}

.card h4 {
  padding: 1.5rem 1.5rem 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
}


.Portfolio-images {
  padding: 1rem 1.5rem 1.5rem;
}

.media-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-img);
  cursor: pointer;
  background: var(--bg-2);
  aspect-ratio: 16 / 9;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--ease-out), filter 0.5s var(--ease);
  filter: saturate(0.85) brightness(0.95);
}

.media-item:hover img {
  transform: scale(1.04);
  filter: saturate(1) brightness(1.02);
}


.glass {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  background: rgba(14, 11, 8, 0.55);
}

.media-item:hover .glass {
  opacity: 1;
}

.glass span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.65rem 1.3rem;
  border: 1px solid rgba(245, 237, 224, 0.25);
  border-radius: 2px;
  background: rgba(20, 18, 16, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}

.media-item:hover .glass span {
  border-color: rgba(245, 237, 224, 0.45);
  background: rgba(20, 18, 16, 0.7);
}


.main-video {
  width: min(960px, 100%);
  max-height: 82vh;
  border-radius: 3px;
  display: block;
  background: #000;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 32px 80px rgba(0, 0, 0, 0.65);
}


.close-video {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(245, 237, 224, 0.15);
  background: rgba(20, 18, 16, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.35s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-video:hover {
  color: var(--text);
  border-color: rgba(245, 237, 224, 0.35);
  transform: rotate(90deg);
}


::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--text-3);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-2);
}


@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

header {
  animation: fadeUp 0.7s var(--ease-out) both;
}

.section:nth-child(1) {
  animation: fadeUp 0.7s var(--ease-out) 0.15s both;
}

.section:nth-child(2) {
  animation: fadeUp 0.7s var(--ease-out) 0.25s both;
}


@media (max-width: 900px) {
  .container {
    padding: 5rem 0 7rem;
  }

  .service-box {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: 95%;
    padding: 4rem 0 6rem;
  }

  header {
    margin-bottom: 4.5rem;
    padding-bottom: 3rem;
  }

  h1 {
    font-size: 3rem;
    letter-spacing: -0.015em;
  }

  h2 {
    font-size: 0.85rem;
  }

  .service-box {
    grid-template-columns: 1fr 1fr;
    gap: 1px;
  }

  .card h4 {
    font-size: 1.05rem;
    padding: 1.1rem 1.1rem 0;
  }

  .Portfolio-images {
    padding: 0.8rem 1.1rem 1.1rem;
  }

  .main-video {
    border-radius: 2px;
  }

  .close-video {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .service-box {
    grid-template-columns: 1fr;
  }
}
