:root {
  --bg-primary: #1a1d23;
  --bg-secondary: #21252d;
  --bg-card: #262b33;
  --accent: #c9d1d9;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

header {
  text-align: center;
  padding: 4rem 1rem 5rem;
  position: relative;
  z-index: 1;
}

/* Ink wash image as background - only effect */
.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e8e4dc;
  background-image: url('ink-bg.png');
  background-size: cover;
  background-position: center 40%;
  opacity: 0.7;
  z-index: 0;
}

/* Gradient fade at bottom of header */
.header-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 15px;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
  z-index: 4;
  pointer-events: none;
}

/* Ink shadow on text */
header h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  color: #ffffff;
  position: relative;
  z-index: 2;
  text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
}

.tagline {
  color: #e8e0d0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.section {
  margin-bottom: 4rem;
}

.section h2 {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: #8b8b8b;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.card {
  flex: 0 1 340px;
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  position: relative;
}

.model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

model-viewer {
  width: 100%;
  height: 100%;
  background-color: var(--bg-card);
}

.video-card {
  aspect-ratio: 16 / 9;
}

.video-card iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 0.9rem;
  color: var(--text-secondary);
}

footer {
  text-align: center;
  padding: 3rem 1rem;
  border-top: 1px solid var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Tablet */
@media (max-width: 900px) {
  .card {
    flex: 0 1 300px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .card {
    flex: 0 1 100%;
    max-width: 400px;
  }

  header h1 {
    font-size: 2.5rem;
  }
}

/* AR button styling */
model-viewer::part(default-ar-button) {
  background-color: var(--accent);
}

/* Expand button on cards */
.expand-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 10;
}

.expand-btn svg {
  width: 18px;
  height: 18px;
  color: white;
}

.card:hover .expand-btn {
  opacity: 1;
}

.expand-btn:hover {
  background: rgba(123, 104, 238, 0.8);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.modal-close svg {
  width: 24px;
  height: 24px;
  color: white;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

#modalViewer {
  width: 100%;
  height: 70vh;
  background: var(--bg-card);
  border-radius: 12px;
}

.modal-caption {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .modal {
    padding: 1rem;
  }

  #modalViewer {
    height: 50vh;
  }

  .modal-close {
    top: -3.5rem;
  }
}
