:root {
  --bg-deep: #020202;
  --bg-surface: rgba(255, 255, 255, 0.03);

  --accent-teal: rgb(26, 212, 241);
  --accent-red: rgb(243, 48, 26);
  --accent-gold: #f7e4b6;

  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;

  --font-serif: "Times New Roman", Times, Baskerville, Georgia, serif;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --gap: clamp(10px, 2vw, 20px);

  --radius: 8px;
  --easing: cubic-bezier(0.22, 1, 0.36, 1);
  /*Transition effects*/
  --trans-bg: #000000;
  --trans-text: #ffffff;
  --trans-font: "Platfair Display", sans-serif;
}

/* RESET & BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  padding: 0;
}

/* GLOBAL TEXTURE OVERLAY */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}


/* Transition style*/
#kinetic-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--trans-bg);
  z-index: 99999; /* Must be above everything */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  pointer-events: none; /* Let clicks pass through when hidden */
  opacity: 0;
  visibility: hidden;
}

/* When active, block interactions */
#kinetic-transition.is-active {
  pointer-events: all;
  visibility: visible;
}

/* Grid layout for the kinetic typography */
.kinetic-grid {
  display: grid;
  width: 100vmax;
  height: 100vmax;
  justify-content: center;
  align-content: center;
  text-align: center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

/* Individual text lines */
.trans-line {
  white-space: nowrap;
  font-family: var(--trans-font);
  font-weight: bold;
  font-size: clamp(5rem, 15vh, 12rem);
  line-height: 0.8;
  color: var(--trans-text);
  text-transform: uppercase;
  opacity: 0.1; /* Starting opacity */
  user-select: none;
  will-change: transform;
}

.trans-line.odd {
  transform: translateX(-10%);
}

.trans-line.even {
  transform: translateX(10%);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 2vh, 1.5rem) clamp(1.5rem, 5vw, 3rem);
  background: linear-gradient(to bottom, rgba(2, 4, 8, 0.9), transparent);
  pointer-events: none;
}

nav .logo-mark {
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  pointer-events: auto;
  color: white;
  text-decoration: none;
  opacity: 1;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  pointer-events: auto;
  margin: 0;
  padding: 0;
}

nav ul li a {
  position: relative;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

nav ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

nav ul li a:hover {
  color: #fff;
}

nav ul li a:hover::after {
  width: 100%;
}

/*Sparkle*/
.highlight-link {
  position: relative;
  display: inline-block;
}

.sp-left::before,
.sp-left::after,
.sp-right::before,
.sp-right::after {
  content: "✦";
  position: absolute;
  color: var(--line-color); 
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  animation: sparkle-anim 2s ease-in-out infinite;
}

/* Top Left */
.sp-left::before {
  top: -15px;
  left: -10px;
  animation-delay: 0s;
}

/* Bottom Left */
.sp-left::after {
  bottom: -8px;
  left: -15px;
  animation-delay: 1s;
}

/* Top Right */
.sp-right::before {
  top: -10px;
  right: -15px;
  animation-delay: 0.5s;
}

/* Bottom Right */
.sp-right::after {
  bottom: -8px;
  right: -15px;
  animation-delay: 1.5s;
}

@keyframes sparkle-anim {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(90deg);
    text-shadow: 0 0 10px var(--line-color);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
}

/* HERO SECTION */
.viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  background: linear-gradient(#d5a1d0 0%, #4d0176 40%, #020202 95%);
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-content {
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 15vw, 10rem);
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.hero-title span {
  display: block;
  font-size: 0.4em;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 0.2em;
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 1px solid var(--text-main);
  border-bottom: 1px solid var(--text-main);
  display: inline-block;
  padding: 1rem 3rem;
  margin-top: 2rem;
}

/* SECTION LAYOUTS */
section {
  padding: clamp(3rem, 6vh, 4rem) clamp(1.5rem, 5vw, 5vw); 
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 300;
  margin: 0;
}

.section-desc {
  max-width: 300px;
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 768px) {
  .section-desc {
    display: block;
  }
}

/* SHOWCASE (Mosaic Grid) */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--gap);
  grid-auto-flow: dense;
}

@media (min-width: 600px) {
  .mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card {
    min-height: 200px; 
  }
}
@media (min-width: 1024px) {
  .mosaic-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .card {
    min-height: 210px; 
  }
}

.card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 180px; 
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition:
    transform 0.4s var(--easing),
    box-shadow 0.4s var(--easing),
    min-height 0.4s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition:
    transform 0.8s var(--easing),
    opacity 0.4s;
}

.card:hover .card-bg {
  transform: scale(1.05);
  opacity: 0.5;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(2, 4, 8, 0.95), transparent);
  width: 100%;
  transform: translateY(10px);
  transition:
    transform 0.4s var(--easing),
    opacity 0.4s ease;
}

.card:hover .card-content {
  transform: translateY(0);
}

.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 600;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.about h3::first-letter {
  float: left;
  font-size: 5rem;
  line-height: 0.45;
  padding-right: 0.25rem;
  font-weight: 700;
  color: var(--accent-red);
}

.highlight {
  font-weight: 600;
  color: #000;
  padding: 0 0.3em;
  background: var(--accent-gold);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transform: skewX(-8deg);
  display: inline;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Desktop Spans */
.span-col-2 {
  grid-column: span 1;
}
.span-row-2 {
  grid-row: span 1;
}

@media (min-width: 600px) {
  .span-col-2 {
    grid-column: span 2;
  }
  .span-row-2 {
    grid-row: span 2;
  }
}

/* =========================================
       DYNAMIC CARD INTERACTIONS & ANIMATIONS
       ========================================= */
.dynamic-card {
  cursor:pointer;
}

/* Crossfade animation logic for global rotation */
.dynamic-card.fade-out .card-content,
.dynamic-card.fade-out .card-bg {
  opacity: 0 !important;
}

/* Dedicated quick fade for smooth text swap on click */
.dynamic-card.text-fade-out .card-content {
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

/* Expanded State inside the natural Grid boundaries */
.dynamic-card.expanded {
  z-index: 10;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Adjust content for expanded view within bounds */
.dynamic-card.expanded .card-content {
  background: linear-gradient(
    to top,
    rgba(2, 4, 8, 0.98) 30%,
    rgba(2, 4, 8, 0.6) 80%,
    transparent
  );
  transform: translateY(0);
}

.dynamic-card.expanded p {
  color: var(--text-main);
  -webkit-line-clamp: unset;
  display: block; 
}

.dynamic-card.expanded .card-bg {
  opacity: 0.35;
  transform: scale(1.05);
}

/* ISSUES / EDITIONS SECTION */
.issues-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0 1rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.issues-track {
  display: flex;
  gap: 2rem;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
}

.issue-card {
  min-width: 320px;
  max-width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  padding: 1.5rem;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.issue-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.issue-cover {
  background-color: #2c2c2c;
  height: 380px;
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: fill;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-serif);
  font-size: 3rem;
}

.issue-card:nth-child(1) .issue-cover {
  background-color: #3e3b36;
}
.issue-card:nth-child(2) .issue-cover {
  background-color: #5d5650;
}
.issue-card:nth-child(3) .issue-cover {
  background-color: #8c8378;
}

.issue-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.issue-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.issue-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-teal);
  text-decoration: none;
  position: relative;
}

.issue-link::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--accent-teal);
  transition: width 0.3s ease;
}

.issue-card:hover .issue-link::after {
  width: 100%;
}

.issues-nav {
  display: flex;
  gap: 0.5rem;
}

.arrow {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.arrow:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

/* TEAM */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-top: 4rem;
}

.team-member:nth-child(1),
.team-member:nth-child(2) {
  grid-column: span 2;
}

.team-member {
  text-align: center;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.team-member:hover {
  opacity: 1;
}

.member-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  background: #111;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(25%);
  transition: filter 0.5s;
}

.team-member:hover .member-photo img {
  filter: grayscale(0%);
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.member-role {
  font-size: 0.8rem;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* FOOTER */
footer {
  padding: 2.5rem 5vw;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: #010204;
}

footer a {
  color: var(--text-main);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.3s;
}
footer a:hover {
  opacity: 1;
}

.copyright {
  opacity: 0.4;
}

img {
  max-width: 100%;
  display: block;
}

/* MOBILE OVERRIDES */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    padding: 1rem;
    background: transparent;
    pointer-events: auto;
    gap: 1rem;
  }

  nav ul {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    gap: 1.5rem;
  }

  nav ul::-webkit-scrollbar {
    display: none;
  }
  nav ul li a {
    font-size: clamp(0.8rem, 3vw, 1rem);
    letter-spacing: 0.05em;
  }

  .mosaic-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mosaic-grid .card:nth-of-type(1) {
    grid-column: span 2;
    min-height: 240px;
  }

  .mosaic-grid .card:nth-of-type(2) {
    grid-column: span 2;
    min-height: auto;
  }

  .card {
    min-height: 180px;
    padding: 1rem;
  }

  .card-content {
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 20%, transparent);
  }

  .card h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
  }
  .card p {
    font-size: 0.8rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    display: -webkit-box;
  }

  .about h3 {
    font-size: 0.8;
  }
  .about h3::first-letter {
    font-size: 3rem;
  }

  .issues-track {
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0;
  }

  .issues-scroll {
    overflow: visible;
  }

  .issues-nav {
    display: none;
  }

  .issue-card {
    min-width: 100%;
    max-width: 100%;
    height: auto;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: 60px 1fr;
    grid-template-areas:
      "thumb meta"
      "thumb title"
      "thumb link";
    gap: 0 1rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .issue-cover {
    grid-area: thumb;
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    font-size: 0;
    border-radius: 4px;
  }

  .issue-desc {
    display: none;
  }

  .issue-meta {
    grid-area: meta;
    margin: 0;
    border: none;
    padding: 0;
    justify-content: flex-start;
    gap: 1rem;
    font-size: 0.65rem;
    opacity: 0.7;
  }

  .issue-title {
    grid-area: title;
    font-size: 1rem;
    margin: 0;
    line-height: 1.2;
  }

  .issue-link {
    grid-area: link;
    margin-top: 0.2rem;
    font-size: 0.7rem;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
  }

  .team-member:nth-child(1),
  .team-member:nth-child(2) {
    grid-column: span 1;
  }

  .member-photo {
    width: 100px;
    height: 100px;
    margin-bottom: 0.75rem;
  }

  .member-name {
    font-size: 0.9rem;
  }

  .member-role {
    font-size: 0.65rem;
  }

  .team-member {
    opacity: 1;
  }

  .member-photo img {
    filter: grayscale(0%);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
  }
  .team-member:nth-child(1),
  .team-member:nth-child(2) {
    grid-column: span 2;
  }
  .member-photo {
    width: clamp(140px, 16vw, 200px);
    height: clamp(140px, 16vw, 200px);
  }
  .member-photo img {
  filter: grayscale(0%);
  }
  .member-name {
    font-size: 0.95rem;
  }
  .member-role {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }
}
