@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Noto+Kufi+Arabic:wght@400;500;600;700;800&display=swap");

:root {
  --background: #03030a;
  --background-soft: #09091a;
  --white: #ffffff;
  --text: #f1efff;
  --muted: #aaa6c3;
  --purple: #9d5cff;
  --purple-light: #c692ff;
  --blue: #4f7cff;
  --pink: #ff4fd8;
  --gold: #dfba78;
  --border: rgba(255, 255, 255, 0.12);
  --background-move-x: 0px;
  --background-move-y: 0px;

  /* Unified frame system: every bordered image box (hero previews,
     gallery cards, modal viewer) shares the exact same border weight
     and inner padding so the artwork always sits inside an identical frame. */
  --frame-border-width: 1px;
  --frame-border-color: rgba(255, 255, 255, 0.18);
  --frame-border-color-hover: rgba(198, 146, 255, 0.55);
  --frame-padding: 10px;
  --frame-radius: 2px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 20%, #171033 0, transparent 30%),
    radial-gradient(circle at 80% 50%, #0a1838 0, transparent 35%),
    var(--background);
  color: var(--text);
  font-family: "Cairo", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Scroll progress bar */

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 200;
  width: 0%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--pink),
    var(--purple-light),
    var(--blue)
  );
  box-shadow: 0 0 12px rgba(157, 92, 255, 0.7);
  transition: width 0.15s ease-out;
}

/* Page-load intro motion */

.intro-item {
  opacity: 0;
  transform: translateY(26px);
  animation: introRise 0.9s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
  animation-delay: var(--intro-delay, 0s);
}

@keyframes introRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Background */

.space-background {
  position: fixed;
  inset: 0;
  z-index: -5;
  overflow: hidden;
  pointer-events: none;
  transform: translate(var(--background-move-x), var(--background-move-y));
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.space-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 3, 10, 0.1), rgba(3, 3, 10, 0.8)),
    radial-gradient(circle at center, transparent 20%, #03030a 90%);
}

.stars {
  position: absolute;
  inset: -100px;
  background-repeat: repeat;
}

.stars-small {
  opacity: 0.55;
  background-image:
    radial-gradient(circle, #fff 1px, transparent 1.5px),
    radial-gradient(circle, #a985ff 1px, transparent 1.5px);
  background-position:
    0 0,
    60px 90px;
  background-size:
    120px 120px,
    180px 180px;
  animation: starsMove 80s linear infinite;
}

.stars-medium {
  opacity: 0.35;
  background-image:
    radial-gradient(circle, #fff 1.5px, transparent 2px),
    radial-gradient(circle, #679cff 1px, transparent 2px);
  background-position:
    20px 20px,
    100px 150px;
  background-size:
    260px 260px,
    320px 320px;
  animation: starsMove 120s linear infinite reverse;
}

.stars-large {
  opacity: 0.4;
  background-image: radial-gradient(
    circle,
    #fff 2px,
    rgba(255, 255, 255, 0.1) 3px,
    transparent 5px
  );
  background-size: 500px 500px;
  animation: starPulse 4s ease-in-out infinite alternate;
}

.nebula {
  position: absolute;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  mix-blend-mode: screen;
}

.nebula-one {
  top: -250px;
  right: -120px;
  background: var(--purple);
  animation: nebulaFloat 16s ease-in-out infinite alternate;
}

.nebula-two {
  bottom: 5%;
  left: -300px;
  background: var(--blue);
  animation: nebulaFloat 20s ease-in-out infinite alternate-reverse;
}

.planet {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  will-change: transform;
  transition: transform 0.2s linear;
}

.planet-one {
  top: 25%;
  left: 7%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at 30% 30%, #8959d1, #1d123b 50%, #05020e);
  box-shadow:
    inset -30px -25px 50px #000,
    0 0 70px rgba(157, 92, 255, 0.3);
  animation: planetFloat 12s ease-in-out infinite;
}

.planet-two {
  right: 6%;
  bottom: 15%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 30%, #9ec9ff, #284e8a 50%, #081324);
  box-shadow:
    inset -15px -15px 25px #000,
    0 0 40px rgba(79, 124, 255, 0.35);
  animation: planetFloat 9s ease-in-out infinite reverse;
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 15px clamp(22px, 5vw, 80px);
  background: rgba(3, 3, 10, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-shape {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transform: rotate(45deg);
  background: linear-gradient(
    135deg,
    rgba(157, 92, 255, 0.7),
    rgba(79, 124, 255, 0.1)
  );
  box-shadow: 0 0 30px rgba(157, 92, 255, 0.35);
  animation: logoRotate 8s linear infinite;
}

.logo-shape::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.logo-text strong {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 19px;
}

.logo-text small {
  color: var(--muted);
  font-size: 10px;
}

.navigation {
  display: flex;
  align-items: center;
  gap: 30px;
}

.navigation > a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.3s ease;
}

.navigation > a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  width: 0;
  height: 1px;
  background: var(--purple-light);
  transition: width 0.3s ease;
}

.navigation > a:hover {
  color: var(--white);
}

.navigation > a:hover::after {
  width: 100%;
}

.sound-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  transition: 0.3s ease;
}

.sound-button:hover,
.sound-button.active {
  color: var(--white);
  border-color: rgba(157, 92, 255, 0.6);
  background: rgba(157, 92, 255, 0.15);
}

.sound-button.active .sound-icon {
  animation: soundPulse 1s infinite alternate;
}

/* Mobile menu button (hidden on desktop) */

.menu-button {
  position: relative;
  z-index: 210;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.menu-button span {
  width: 18px;
  height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

.menu-button.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-button.open span:nth-child(2) {
  opacity: 0;
}

.menu-button.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 0;
  padding: 0 22px;
  overflow: hidden;
  background: rgba(6, 5, 16, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  transition:
    max-height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 0.45s ease;
}

.mobile-menu.open {
  max-height: 220px;
  padding: 96px 22px 22px;
}

.mobile-menu a {
  padding: 14px 4px;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.mobile-menu a:active {
  color: var(--purple-light);
  transform: translateX(-4px);
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(350px, 1.1fr);
  align-items: center;
  gap: 60px;
  width: min(1400px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 130px clamp(22px, 6vw, 90px) 80px;
  isolation: isolate;
}

.hero-content {
  position: relative;
  z-index: 5;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--purple-light);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.eyebrow::before {
  content: "";
  width: 38px;
  height: 1px;
  background: linear-gradient(to left, var(--purple-light), transparent);
}

.hero h1 {
  max-width: 700px;
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: clamp(48px, 6.2vw, 100px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -4px;
}

.hero h1 span,
.section-heading h2 span {
  color: transparent;
  background: linear-gradient(
    120deg,
    #ffffff,
    var(--purple-light),
    #669bff,
    #ffffff
  );
  background-size: 250% 250%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textGradient 6s linear infinite;
}

.hero p {
  max-width: 650px;
  margin-top: 26px;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 2;
}

.explore-button {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  margin-top: 38px;
  padding: 15px 24px;
  overflow: hidden;
  color: var(--white);
  border: 1px solid rgba(198, 146, 255, 0.4);
  border-radius: 4px;
  background: rgba(157, 92, 255, 0.12);
  box-shadow:
    inset 0 0 20px rgba(157, 92, 255, 0.08),
    0 10px 40px rgba(0, 0, 0, 0.3);
  transition: 0.4s ease;
}

.explore-button:hover,
.explore-button:active {
  gap: 35px;
  border-color: var(--purple-light);
  background: rgba(157, 92, 255, 0.25);
  box-shadow: 0 15px 50px rgba(157, 92, 255, 0.18);
}

.explore-button .arrow {
  display: inline-block;
  font-size: 25px;
  animation: arrowNudge 1.8s ease-in-out infinite;
}

.floating-preview {
  position: relative;
  height: 650px;
  perspective: 1200px;
}

.preview-frame {
  position: absolute;
  overflow: hidden;
  box-sizing: border-box;
  padding: var(--frame-padding);
  border: var(--frame-border-width) solid var(--frame-border-color);
  border-radius: var(--frame-radius);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.35),
    rgba(157, 92, 255, 0.08)
  );
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(157, 92, 255, 0.15);
  transform-style: preserve-3d;
}

.preview-frame::before {
  content: "";
  position: absolute;
  inset: var(--frame-padding);
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1px;
}

.preview-one {
  z-index: 3;
  top: 12%;
  right: 12%;
  width: 55%;
  height: 65%;
  transform: rotateY(-12deg) rotateZ(3deg);
  animation: previewFloatOne 7s ease-in-out infinite;
}

.preview-two {
  z-index: 2;
  top: 3%;
  left: 4%;
  width: 42%;
  height: 49%;
  transform: rotateY(15deg) rotateZ(-8deg);
  animation: previewFloatTwo 9s ease-in-out infinite;
}

.preview-three {
  z-index: 4;
  right: 0;
  bottom: 3%;
  width: 38%;
  height: 43%;
  transform: rotateY(-10deg) rotateZ(7deg);
  animation: previewFloatThree 8s ease-in-out infinite;
}

.hero-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(157, 92, 255, 0.15);
  border-radius: 50%;
}

.hero-orbit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 20px var(--purple-light);
}

.orbit-one {
  top: 18%;
  left: 42%;
  width: 530px;
  height: 530px;
  animation: orbitRotate 22s linear infinite;
}

.orbit-two {
  top: 28%;
  left: 48%;
  width: 350px;
  height: 350px;
  animation: orbitRotate 14s linear infinite reverse;
}

.scroll-indicator {
  position: absolute;
  bottom: 25px;
  right: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  transform: translateX(50%);
}

.mouse {
  position: relative;
  width: 20px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
}

.mouse span {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 2px;
  height: 6px;
  border-radius: 5px;
  background: var(--white);
  animation: mouseScroll 1.6s infinite;
}

/* Gallery */

.gallery-section {
  position: relative;
  width: min(1440px, 100%);
  margin: auto;
  padding: 130px clamp(20px, 5vw, 75px);
}

.section-heading {
  max-width: 800px;
  margin: 0 auto 80px;
  text-align: center;
}

.section-heading .eyebrow::after {
  content: "";
  width: 38px;
  height: 1px;
  background: linear-gradient(to right, var(--purple-light), transparent);
}

.section-heading h2 {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: clamp(34px, 4.4vw, 65px);
  line-height: 1.5;
}

.section-heading p {
  max-width: 600px;
  margin: 20px auto 0;
  color: var(--muted);
  line-height: 2;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 70px 35px;
  perspective: 1400px;
}

.art-card {
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --mouse-x: 50%;
  --mouse-y: 50%;
  --idle-delay: 0s;

  position: relative;
  min-width: 0;
  cursor: pointer;
  perspective: 1000px;
}

.art-card:nth-child(3n + 2) {
  transform: translateY(55px);
}

.art-card:nth-child(2n) {
  --idle-delay: -3s;
}

.art-card:nth-child(3n) {
  --idle-delay: -5.5s;
}

.card-inner {
  position: relative;
  box-sizing: border-box;
  padding: var(--frame-padding);
  border: var(--frame-border-width) solid var(--frame-border-color);
  border-radius: var(--frame-radius);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.09),
    rgba(255, 255, 255, 0.015)
  );
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
  transform-style: preserve-3d;
  transition:
    transform 0.12s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  animation: cardIdleFloat 7s ease-in-out infinite;
  animation-delay: var(--idle-delay);
}

.card-inner::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    300px circle at var(--mouse-x) var(--mouse-y),
    rgba(198, 146, 255, 0.2),
    transparent 45%
  );
  transition: opacity 0.4s ease;
}

.art-card:hover .card-inner,
.art-card:active .card-inner {
  border-color: var(--frame-border-color-hover);
  box-shadow:
    0 45px 90px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(157, 92, 255, 0.12);
}

.art-card:hover .card-inner::before {
  opacity: 1;
}

.art-image {
  position: relative;
  height: clamp(380px, 40vw, 590px);
  overflow: hidden;
  border-radius: 1px;
  background: #0c0b12;
  transform: translateZ(25px);
}

.art-image::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.art-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 1s cubic-bezier(0.2, 0.75, 0.2, 1),
    filter 0.7s ease;
}

.art-card:hover .art-image img {
  transform: scale(1.08) rotate(1deg);
  filter: saturate(1.12) contrast(1.04);
}

.image-shine {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  z-index: 3;
  width: 35%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.9s ease;
}

.art-card:hover .image-shine {
  left: 130%;
}

/* Number badge — overlaid on the artwork, no painting names anywhere */

.art-number {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(3, 3, 10, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.art-card:hover .art-number,
.art-card:active .art-number {
  opacity: 1;
  transform: translateY(0);
}

/* Expand/view icon — replaces the old text button, purely iconographic */

.view-icon {
  position: absolute;
  right: 50%;
  bottom: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(3, 3, 10, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translate(50%, 50%) scale(0.7);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.view-icon svg {
  width: 22px;
  height: 22px;
}

.art-card:hover .view-icon,
.art-card:active .view-icon {
  opacity: 1;
  transform: translate(50%, 50%) scale(1);
}

/* Reveal motion */

.reveal {
  opacity: 0;
  transform: translateY(70px) rotateX(8deg);
  transform-origin: center top;
  transition:
    opacity 0.9s ease var(--delay, 0s),
    transform 1.1s cubic-bezier(0.2, 0.75, 0.2, 1) var(--delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

.art-card:nth-child(3n + 2).reveal.visible {
  transform: translateY(55px) rotateX(0);
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 40px 100px;
  visibility: hidden;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(39, 21, 73, 0.8), transparent 60%),
    rgba(1, 1, 6, 0.94);
  backdrop-filter: blur(22px);
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

.modal.active {
  visibility: visible;
  opacity: 1;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 1000px);
  max-height: 90vh;
  transform: scale(0.75) rotateY(25deg);
  transition: transform 0.7s cubic-bezier(0.17, 0.89, 0.32, 1.25);
  perspective: 1200px;
}

.modal.active .modal-content {
  transform: scale(1) rotateY(0);
}

.modal-image-frame {
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
  max-height: 75vh;
  padding: var(--frame-padding);
  border: var(--frame-border-width) solid rgba(255, 255, 255, 0.25);
  border-radius: var(--frame-radius);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 50px 100px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(157, 92, 255, 0.15);
  touch-action: pan-y;
}

.modal-image-frame::before,
.modal-image-frame::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
}

.modal-image-frame::before {
  top: -6px;
  right: -6px;
  border-top: 1px solid var(--purple-light);
  border-right: 1px solid var(--purple-light);
}

.modal-image-frame::after {
  bottom: -6px;
  left: -6px;
  border-bottom: 1px solid var(--purple-light);
  border-left: 1px solid var(--purple-light);
}

.modal-image-frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(75vh - 20px);
  object-fit: contain;
  border-radius: 1px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.modal-image-frame img.changing-next {
  opacity: 0;
  transform: scale(0.92) translateX(40px) rotateY(-12deg);
}

.modal-image-frame img.changing-previous {
  opacity: 0;
  transform: scale(0.92) translateX(-40px) rotateY(12deg);
}

.modal-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 25px;
}

.modal-details span {
  color: var(--purple-light);
  font-family: Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
}

.modal-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 260px;
}

.modal-dot {
  width: 6px;
  height: 6px;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.modal-dot.active {
  background: var(--purple-light);
  transform: scale(1.6);
  box-shadow: 0 0 10px rgba(198, 146, 255, 0.7);
}

.modal-close {
  position: absolute;
  top: 30px;
  left: 40px;
  z-index: 5;
  width: 48px;
  height: 48px;
  color: var(--white);
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 28px;
  line-height: 1;
  transition: 0.3s ease;
}

.modal-close:hover {
  border-color: var(--purple-light);
  background: rgba(157, 92, 255, 0.2);
  transform: rotate(90deg);
}

.modal-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 55px;
  height: 80px;
  color: var(--white);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 45px;
  line-height: 1;
  transform: translateY(-50%);
  transition: 0.3s ease;
}

.modal-arrow:hover {
  border-color: var(--purple-light);
  background: rgba(157, 92, 255, 0.22);
}

.modal-next {
  left: 30px;
}

.modal-previous {
  right: 30px;
}

/* Footer */

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1300px, calc(100% - 40px));
  margin: 40px auto 0;
  padding: 40px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

/* Animations */

@keyframes starsMove {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(150px, 250px, 0);
  }
}

@keyframes starPulse {
  from {
    opacity: 0.2;
  }

  to {
    opacity: 0.55;
  }
}

@keyframes nebulaFloat {
  from {
    transform: translate3d(-30px, -30px, 0) scale(0.9);
  }

  to {
    transform: translate3d(70px, 70px, 0) scale(1.2);
  }
}

@keyframes planetFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-35px) rotate(12deg);
  }
}

@keyframes logoRotate {
  from {
    transform: rotate(45deg);
  }

  to {
    transform: rotate(405deg);
  }
}

@keyframes soundPulse {
  from {
    transform: scale(0.85);
  }

  to {
    transform: scale(1.25);
  }
}

@keyframes textGradient {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 250% 50%;
  }
}

@keyframes arrowNudge {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-6px);
  }
}

@keyframes cardIdleFloat {
  0%,
  100% {
    transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y)) translateY(0);
  }

  50% {
    transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y))
      translateY(-8px);
  }
}

@keyframes previewFloatOne {
  0%,
  100% {
    transform: translateY(0) rotateY(-12deg) rotateZ(3deg);
  }

  50% {
    transform: translateY(-25px) rotateY(-5deg) rotateZ(1deg);
  }
}

@keyframes previewFloatTwo {
  0%,
  100% {
    transform: translateY(0) rotateY(15deg) rotateZ(-8deg);
  }

  50% {
    transform: translateY(25px) rotateY(5deg) rotateZ(-4deg);
  }
}

@keyframes previewFloatThree {
  0%,
  100% {
    transform: translateY(0) rotateY(-10deg) rotateZ(7deg);
  }

  50% {
    transform: translateY(-18px) rotateY(-3deg) rotateZ(4deg);
  }
}

@keyframes orbitRotate {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes mouseScroll {
  0% {
    opacity: 0;
    transform: translateY(0);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Tablet */

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .hero h1 {
    letter-spacing: -2px;
  }

  .floating-preview {
    height: 520px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .art-card:nth-child(3n + 2) {
    transform: none;
  }

  .art-card:nth-child(even) {
    transform: translateY(45px);
  }

  .art-card:nth-child(3n + 2).reveal.visible {
    transform: none;
  }

  .art-card:nth-child(even).reveal.visible {
    transform: translateY(45px);
  }
}

/* Mobile */

@media (max-width: 767px) {
  :root {
    /* Slightly tighter frame on small screens so the artwork gets more room */
    --frame-padding: 8px;
  }

  .site-header {
    min-height: 72px;
    padding: 12px 18px;
  }

  .logo-shape {
    width: 32px;
    height: 32px;
  }

  .logo-text strong {
    font-size: 15px;
  }

  .logo-text small {
    font-size: 8px;
  }

  .navigation > a {
    display: none;
  }

  .sound-button {
    padding: 9px 12px;
    min-height: 40px;
  }

  .sound-text {
    display: none;
  }

  .menu-button {
    display: flex;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    min-height: auto;
    padding: 112px 20px 70px;
    text-align: center;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 58px);
    letter-spacing: -1.5px;
    line-height: 1.28;
  }

  .hero p {
    font-size: 14.5px;
    line-height: 1.9;
  }

  .explore-button {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
  }

  .floating-preview {
    width: 100%;
    height: 380px;
    margin-top: 16px;
  }

  .preview-one {
    right: 20%;
    width: 60%;
    height: 65%;
  }

  .preview-two {
    left: 0;
    width: 43%;
  }

  .preview-three {
    right: 3%;
    width: 40%;
  }

  .hero-orbit {
    display: none;
  }

  .scroll-indicator {
    display: none;
  }

  .planet-one {
    width: 110px;
    height: 110px;
  }

  .planet-two {
    width: 56px;
    height: 56px;
  }

  .gallery-section {
    padding: 80px 16px;
  }

  .section-heading {
    margin-bottom: 44px;
  }

  .section-heading h2 {
    font-size: 30px;
    line-height: 1.4;
  }

  .section-heading p {
    font-size: 14px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .art-card,
  .art-card:nth-child(even),
  .art-card:nth-child(3n + 2),
  .art-card.reveal.visible,
  .art-card:nth-child(even).reveal.visible,
  .art-card:nth-child(3n + 2).reveal.visible {
    transform: none;
  }

  /* Idle floating motion is subtle on desktop but distracting on small
     screens where the whole card fills the viewport — turn it off and
     rely on tap feedback instead. */
  .card-inner {
    animation: none;
  }

  .art-card:active .card-inner {
    transform: scale(0.985);
  }

  .art-image {
    height: min(118vw, 520px);
  }

  /* Reveal always-on affordances on touch since there is no hover state */
  .art-number,
  .view-icon {
    opacity: 1;
    transform: translateY(0);
  }

  .view-icon {
    width: 46px;
    height: 46px;
    transform: translate(50%, 50%) scale(1);
  }

  .art-card:hover .image-shine {
    left: -60%;
  }

  .modal {
    padding: 76px 14px 108px;
  }

  .modal-content {
    width: 100%;
  }

  .modal-image-frame {
    max-height: 68vh;
  }

  .modal-image-frame img {
    max-height: calc(68vh - 16px);
  }

  .modal-close {
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
  }

  .modal-arrow {
    top: auto;
    bottom: 20px;
    width: 58px;
    height: 52px;
    transform: none;
  }

  .modal-next {
    left: calc(50% - 68px);
  }

  .modal-previous {
    right: calc(50% - 68px);
  }

  .modal-details {
    gap: 10px;
    margin-top: 16px;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    padding: 32px 0;
    text-align: center;
  }
}

/* Small phones */

@media (max-width: 380px) {
  .hero h1 {
    font-size: 34px;
  }

  .art-image {
    height: 68vw;
  }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
