/* =========================================
   Design 5: Swiss Editorial
   Theme: High Fashion, Minimalist, Horizontal
========================================= */

:root {
  --bg-light: #f4f4f0;
  --text-dark: #121212;
  --bg-dark: #121212;
  --text-light: #f4f4f0;

  --font-display: "Syncopate", sans-serif;
  --font-body: "Work Sans", sans-serif;
}

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

/* Base Body */
body,
html {
  width: 100vw;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: var(--font-body);
  overflow-x: hidden;
  overflow-y: hidden; /* Locked during horizontal scroll, unlocked by JS */
}

/* Fixed Magazine Frame */
.frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.frame-top,
.frame-bottom {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.scroll-prompt {
  font-weight: 700;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Horizontal Scroll Container */
.h-scroll-container {
  display: flex;
  width: max-content;
  height: 100vh;
  will-change: transform;
  /* CSS transition for smooth JS translation */
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Vertical Scroll Container (after horizontal section) */
.v-scroll-container {
  width: 100%;
  display: none; /* Hidden until horizontal scroll completes */
}

.v-scroll-container.active {
  display: block;
}

.v-panel {
  width: 100%;
  min-height: 100vh;
  padding: 8rem 4rem;
  display: flex;
}

/* Individual Panels */
.panel {
  width: 100vw;
  height: 100vh;
  padding: 8rem 4rem;
  display: flex;
  flex-shrink: 0;
}

/* Panel Variations */
.dark {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

.light {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* Typography */
.massive-text {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 15rem);
  line-height: 0.8;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -2px;
}

.huge-text {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 10rem);
  line-height: 0.85;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -1px;
}

.outline {
  display: inline-block; /* needed for margin to work reliably */
  transform: translateX(-1.5rem);
  color: transparent;
  -webkit-text-stroke: 2px var(--text-dark);
}

/* Title Panel Elements */
.title-panel {
  align-items: center;
  justify-content: space-between;
}

.meta-data {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  align-self: flex-end;
  margin-bottom: 2rem;
  text-align: right;
}

/* About Panel Elements */
.about-panel {
  width: 90vw;
  gap: 4rem;
  align-items: center;
}

.about-panel h2 {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
}

.about-panel .detail p {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 500;
  max-width: 600px;
}

.about-panel .detail .small-text {
  font-size: 0.9rem;
  color: #666;
}

/* Project Panels Specifics */
.project-panel {
  position: relative;
  align-items: center;
  justify-content: center;
}

.project-num {
  position: absolute;
  top: 6rem;
  left: 4rem;
  font-size: 2rem;
  font-family: var(--font-display);
}

.project-content {
  display: flex;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-top: 2rem;
}

.view-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 1rem 2rem;
  border: 1px solid currentColor;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.3s ease;
  width: max-content;
}

.view-link:hover {
  background-color: var(--text-dark);
  color: var(--bg-light);
}

.project-panel.dark .view-link:hover {
  background-color: var(--text-light);
  color: var(--bg-dark);
}

/* Contact Panel */
.contact-panel {
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.contact-links {
  display: flex;
  gap: 2rem;
  margin-top: 4rem;
}

.c-link {
  font-size: 2rem;
  font-family: var(--font-display);
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.c-link:hover {
  font-style: italic;
  transform: translateY(-5px);
}

/* Buffer */
.buffer {
  width: 10vw; /* Just a little padding at the end of the scroll container */
  background: var(--bg-light);
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 6px;
  background-color: var(--text-dark);
  width: 0%;
  z-index: 101;
  transition: width 0.1s linear;
}

/* Vertical section visible by default on mobile */

/* Responsive adjustments */
@media (max-width: 768px) {
  .outline {
    transform: translateX(-0.35rem);
  }

  /* Release vertical lock */
  body,
  html {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Reset horizontal container to vertical block */
  .h-scroll-container {
    display: block;
    width: 100%;
    height: auto;
    transform: none !important; /* Override JS inline transform */
    transition: none;
  }

  .v-scroll-container {
    display: block !important;
  }

  .h-scroll-bottom {
    position: static !important;
    display: block !important;
    transform: none !important;
    height: auto;
  }

  .bottom-scroll {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    position: static !important;
    overflow: visible !important;
  }

  .v-panel {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 6rem 1.5rem;
  }

  /* Adjust individual panels */
  .panel {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 6rem 1.5rem; /* Tighter padding for mobile */
  }

  .buffer {
    display: none; /* No buffer needed for vertical scroll */
  }

  /* Fixed Frame - allow it to scroll with document instead of sticking */
  .frame {
    position: absolute;
    height: 100vh;
    padding: 1rem;
    font-size: 0.6rem;
  }

  .frame-top,
  .frame-bottom {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .scroll-prompt {
    display: none; /* Hide horizontal scroll prompt */
  }

  /* Typography resize */
  .massive-text {
    font-size: clamp(3.5rem, 15vw, 5rem);
    word-break: break-word; /* Prevent overflow on super small screens */
  }
  .huge-text {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .title-panel {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .meta-data {
    align-self: flex-start;
    text-align: left;
    margin-bottom: 0px;
  }

  .about-panel {
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    align-items: flex-start;
  }
  .about-panel h2 {
    font-size: 2.5rem;
  }
  .about-panel .detail p {
    font-size: 1.1rem; /* Slightly smaller for mobile readability */
  }

  .project-panel {
    padding-top: 6rem;
  }
  .project-content {
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    align-items: flex-start;
  }
  .project-num {
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 0.5rem;
  }
  .view-link {
    align-self: flex-start;
    font-size: 0.8rem;
    padding: 0.8rem 1.5rem;
  }

  .contact-panel {
    align-items: flex-start;
  }
  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 2rem;
  }
  .c-link {
    font-size: 1.5rem;
  }

  .progress-bar {
    display: none; /* Hide horizontal scrollbar on mobile */
  }
}

/* Bottom horizontal scroll section (Project 3 + Contact) */
.bottom-scroll {
  display: flex;
  flex-direction: row;
  width: max-content;
  height: 100vh;
  position: sticky;
  top: 0;
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  overflow: visible;
}

.bottom-scroll .v-panel,
.bottom-scroll .panel {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
}
