/* ============================================================
   Crown Creatives — Master Stylesheet (v5, Unified)
   JS-driven theme system • Hero crown • Gallery engine
   Production-ready, cleaned, merged, conflict-free
   ============================================================ */


/* ------------------------------------------------------------
   GOOGLE FONTS
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&display=swap');


/* ------------------------------------------------------------
   GLOBAL RESET + BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Cinzel Decorative', serif;
  overflow-x: hidden;
}


/* ------------------------------------------------------------
   THEME ENGINE — JS-DRIVEN (Option A)
   ------------------------------------------------------------ */
:root {
  --bg-day: radial-gradient(circle at top, #ffe9b8 0%, #f7c6ff 40%, #2b2c5f 100%);
  --bg-night: radial-gradient(circle at top, #05030b 0%, #151533 35%, #020008 100%);

  --text-day: #1b1230;
  --text-night: #f5ecff;

  --glow-day: rgba(255, 210, 150, 0.45);
  --glow-night: rgba(120, 200, 255, 0.55);
}

body[data-theme="day"] {
  background: var(--bg-day);
  color: var(--text-day);
}

body[data-theme="night"] {
  background: var(--bg-night);
  color: var(--text-night);
}


/* ------------------------------------------------------------
   HEADER — LOGO, TOGGLE, NAV
   ------------------------------------------------------------ */
.site-header {
  position: relative;
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  position: relative;
}

/* Unified toggle */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 9999;
}

.theme-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.7));
  animation: themePulse 3.5s ease-in-out infinite;
}

@keyframes themePulse {
  0%   { transform: scale(1);   filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)); }
  50%  { transform: scale(1.06); filter: drop-shadow(0 0 16px rgba(255,255,255,0.9)); }
  100% { transform: scale(1);   filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)); }
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.header-logo {
  width: 150px;
  height: auto;
}

.header-title {
  font-size: 2rem;
  letter-spacing: 0.18em;
  margin: 0.3rem 0 0 0;
}

.header-tagline {
  font-size: 1rem;
  opacity: 0.85;
  margin: 0;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 1.2rem auto 0 auto;
  display: flex;
  justify-content: center;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.site-nav a {
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  text-shadow: 0 0 4px rgba(255,255,255,0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.site-nav a:hover {
  opacity: 0.7;
  transform: translateY(-2px);
}


/* ------------------------------------------------------------
   HERO SECTION — CROWN + GALLERY
   ------------------------------------------------------------ */
.home-hero {
  position: relative;
  width: 100%;
  margin-top: 20px;
  text-align: center;
  z-index: 5;
}

.hero-crown-wrapper {
  position: relative;
  width: 100%;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Unified crown visibility */
.home-crown {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(180px, 40vw, 420px);
  height: auto;
  pointer-events: none;
  transition: opacity 8s ease-in-out;
  opacity: 0;
}

body[data-theme="day"] .home-crown.day {
  opacity: 1;
}

body[data-theme="night"] .home-crown.night {
  opacity: 1;
}

/* Unified gallery */
.hero-gallery {
  position: absolute;
  top: clamp(140px, 22vw, 220px);
  left: 0;
  width: 100%;
  height: 320px;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.gallery-left,
.gallery-right {
  width: 25%;
  height: 100%;
  position: absolute;
  top: 0;
  overflow: hidden;
}

.gallery-left { left: 0; }
.gallery-right { right: 0; }

.lane-img {
  position: absolute;
  width: 90%;
  left: 5%;
  opacity: 0;
  transition: opacity 2s ease-in-out;
}


/* ------------------------------------------------------------
   HOME CARDS
   ------------------------------------------------------------ */
.home-cards {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  margin-top: calc(18rem + 10mm) !important;
}

.home-cards .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 260px;
}

.card {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 2rem;
  width: 280px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body[data-theme="night"] .card {
  border-color: rgba(255, 255, 255, 0.25);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}


/* ------------------------------------------------------------
   INSPIRATION TICKER
   ------------------------------------------------------------ */
.inspiration-ticker {
  width: 100%;
  overflow: hidden;
  margin-top: calc(1rem + 10mm) !important;
  padding: 0.7rem 0;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: tickerScroll 35s linear infinite;
  padding-left: 100%;
}

.ticker-track span {
  display: inline-block;
  padding-right: 4rem;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}


/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.site-footer {
  padding: 2rem 0 2.5rem 0;
  text-align: center;
  background: transparent;
  margin-top: calc(2rem + 10mm) !important;
  position: relative;
}

.footer-icons img { width: 48px; height: auto; }
.footer-backtotop img { width: 48px; cursor: pointer; }

.footer-backtotop {
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
  z-index: 50;
}


/* ------------------------------------------------------------
   GALLERY PAGE
   ------------------------------------------------------------ */
.gallery-page {
  max-width: 1200px;
  margin: 0 auto 4rem auto;
  padding: 5rem 1.5rem 3rem 1.5rem;
  text-align: center;
}

body[data-theme="day"] .gallery-page {
  background: radial-gradient(circle at top, rgba(255,233,184,0.35), rgba(247,198,255,0.25), transparent 70%);
  border-radius: 24px;
}

body[data-theme="night"] .gallery-page {
  background: radial-gradient(circle at top, rgba(40,30,90,0.7), rgba(90,40,140,0.5), transparent 70%);
  border-radius: 24px;
}

.gallery-header h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }

.gallery-tagline {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0.5rem auto 2.5rem auto;
}

.magic-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  position: relative;
}

.magic-gallery-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  cursor: pointer;
  transform-origin: center center;
  animation: tileFloat 14s ease-in-out infinite;
  opacity: 0;
  animation-fill-mode: forwards;
  box-shadow: 0 0 18px var(--glow-day);
}

body[data-theme="night"] .magic-gallery-tile {
  box-shadow: 0 0 22px var(--glow-night);
}

.magic-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, filter 0.6s ease, opacity 0.6s ease;
}

@media (hover:hover) and (pointer:fine) {
  .magic-gallery-tile:hover img {
    transform: scale(1.06);
    filter: brightness(1.08);
  }

  .magic-gallery-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.35) 40%, transparent 80%);
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
  }

  .magic-gallery-tile:hover::after {
    opacity: 1;
    animation: shimmerSweep 1.2s ease-out;
  }
}

@keyframes tileFloat {
  0% { transform: translate3d(0,0,0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  25% { transform: translate3d(2px,-3px,0) rotate(-1.2deg); }
  50% { transform: translate3d(-3px,2px,0) rotate(1.4deg); }
  75% { transform: translate3d(1px,-2px,0) rotate(-0.8deg); }
  100% { transform: translate3d(0,0,0) rotate(0deg); }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}


/* ------------------------------------------------------------
   ABOUT PAGE
   ------------------------------------------------------------ */
.about-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1.5rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

body[data-theme="day"] .about-page {
  background: radial-gradient(circle at top,
    rgba(255,233,184,0.35),
    rgba(247,198,255,0.25),
    transparent 70%
  );
  border-radius: 24px;
}

body[data-theme="night"] .about-page {
  background: radial-gradient(circle at top,
    rgba(40,30,90,0.7),
    rgba(90,40,140,0.5),
    transparent 70%
  );
  border-radius: 24px;
}

.about-crown-hero {
  width: clamp(220px, 40vw, 420px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 2.5rem auto;
  filter: drop-shadow(0 0 18px rgba(255, 215, 120, 0.55));
}

.about-img-small,
.about-img-medium {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin: 2.5rem auto;
}

.about-img-small { width: 120px; }
.about-img-medium { width: clamp(140px, 22vw, 200px); }

.about-visual { margin: 2.5rem auto; }

.about-intro p {
  max-width: 680px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
}


/* ------------------------------------------------------------
   RESPONSIVE TUNING
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  .home-crown { width: 189px; max-width: 189px; }
  .hero-gallery { top: 60px; height: 300px; }
  .home-cards { margin-top: calc(8rem + clamp(6rem, 12vw, 10rem)); }
}

@media (max-width: 768px) {
  .home-crown { width: 85vw; max-width: 300px; }
  .hero-gallery { top: 40px; height: 260px; }
  .lane-img { width: 70vw; left: 15vw; }
  .home-cards { margin-top: calc(6rem + clamp(6rem, 12vw, 10rem)); gap: 1.5rem; }
  .card { width: 85%; padding: 1.5rem; }
  .site-nav ul { gap: 1rem; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .home-crown { width: 200px; max-width: 200px; }
  .hero-gallery { top: 30px; height: 220px; }
  .lane-img { width: 65%; left: 17%; }
  .home-cards { margin-top: calc(5rem + clamp(6rem, 12vw, 10rem)); }
  .card { width: 90%; }
}
.theme-icon {
  width: 40px !important;
  height: 40px !important;
  outline: 2px solid red !important;
  background: yellow !important;
}
