/* ============================================
   PEMSTD — INDEX PAGE STYLES
   ============================================ */

/* ---------- HERO ---------- */

.hero {
  position: relative;
  height: 60vh;
  min-height: 420px;
  overflow: hidden;
}

.hero-carousel {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.15) 0%, rgba(10, 10, 10, 0.85) 100%);
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background var(--transition-smooth), width var(--transition-smooth);
}

.hero-dot.active {
  background: var(--accent-red);
  width: 22px;
  border-radius: 4px;
}

/* ---------- HERO INTRO (studio name block) ---------- */

.intro {
  padding: 56px 0 40px;
}

.intro-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.intro-title .accent {
  color: var(--accent-red);
}

.intro-desc {
  margin-top: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  font-size: 1.02rem;
}

.intro-actions {
  margin-top: 28px;
}

/* ---------- ABOUT ---------- */

.about {
  padding: 90px 0;
  border-top: 1px solid var(--border-color);
}

.about-body {
  margin-top: 26px;
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.about-body p + p {
  margin-top: 16px;
}

.vision-mission {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.vm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.vm-card h3 {
  color: var(--accent-red);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.vm-card p {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.96rem;
}

@media (max-width: 720px) {
  .vision-mission {
    grid-template-columns: 1fr;
  }
}

/* ---------- TEAM ---------- */

.team {
  padding: 90px 0;
  border-top: 1px solid var(--border-color);
}

.team-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), background var(--transition-smooth);
}

.team-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-red);
  background: #1a1414;
}

.team-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 2px solid var(--border-color);
}

.team-name {
  font-weight: 700;
  font-size: 1.02rem;
}

.team-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ---------- PROJECTS (featured preview) ---------- */

.projects {
  padding: 90px 0;
  border-top: 1px solid var(--border-color);
}

.projects-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-red);
}

.project-thumb {
  aspect-ratio: 16/9;
  width: 100%;
  object-fit: cover;
  background: #1c1c1c;
}

.project-info {
  padding: 16px 18px 20px;
}

.project-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--accent-red);
}

.project-short {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.projects-more {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

/* ---------- CONTACT ---------- */

.contact {
  padding: 90px 0;
  border-top: 1px solid var(--border-color);
}

.contact-form {
  margin-top: 32px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition-smooth), background var(--transition-smooth);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-red);
  background: #1a1414;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-secondary);
}

/* ============================================
   PROJECT MODAL (overlay everywhere)
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 6, 6, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transform: translateY(24px) scale(0.98);
  transition: transform var(--transition-smooth);
  position: relative;
}

.modal-overlay.open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-smooth);
  z-index: 2;
}

.modal-close:hover {
  background: var(--accent-red);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding-right: 46px;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.modal-date {
  color: var(--text-secondary);
  font-size: 0.88rem;
  white-space: nowrap;
}

.modal-body {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
}

.modal-desc p {
  margin: 0 0 12px;
}

.modal-desc p:last-child {
  margin-bottom: 0;
}

.modal-desc ul {
  margin: 0 0 12px;
  padding-left: 22px;
  list-style: disc;
}

.modal-desc ol {
  margin: 0 0 12px;
  padding-left: 22px;
  list-style: decimal;
}

.modal-desc li {
  margin-bottom: 4px;
  display: list-item;
}

.modal-desc strong {
  color: var(--text-primary);
}

/* Scrollable image carousel — same idea as the hero carousel, but
   horizontally scrollable so it supports any number of images. */
.modal-images {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  max-height: 420px;
}

.modal-images::-webkit-scrollbar {
  height: 8px;
}

.modal-image-slide {
  flex: 0 0 85%;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #1c1c1c;
}

.modal-image-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-image-empty {
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 40px 12px;
  text-align: center;
  width: 100%;
}

/* Desktop preview: single visible slide + dotted nav (click to switch),
   same interaction pattern as the hero carousel. Mobile keeps native
   horizontal scroll via .modal-image-slide flex rules above. */
.modal-images-desktop {
  flex-direction: column;
  overflow: visible;
  scroll-snap-type: none;
}

.modal-image-slides {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #1c1c1c;
  aspect-ratio: var(--slide-ratio, 16/10);
  max-height: 60vh;
}

.modal-images-desktop .modal-image-slide {
  position: absolute;
  inset: 0;
  flex: none;
  opacity: 0;
  border: none;
  transition: opacity var(--transition-smooth);
}

.modal-images-desktop .modal-image-slide.active {
  opacity: 1;
}

.modal-image-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.modal-image-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background var(--transition-smooth), width var(--transition-smooth);
}

.modal-image-dot.active {
  background: var(--accent-red);
  width: 22px;
  border-radius: 4px;
}

@media (min-width: 721px) {
  .modal-image-slide {
    flex-basis: 100%;
  }
}

/* Footer link bar — dynamic list of short-title link buttons */
.modal-links {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color var(--transition-smooth), background var(--transition-smooth);
}

.modal-link-btn:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-dim);
}

.modal-link-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 720px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
  .modal-panel {
    padding: 24px 18px;
  }
}
