@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f4f4f4;
  font-family: 'Inter', 'Noto Sans Tamil', sans-serif;
}

html[lang="ta"] body {
  font-family: 'Noto Sans Tamil', 'Inter', sans-serif;
}

html[lang="ta"] .back-link {
  text-transform: none;
  letter-spacing: 0.02em;
}

:root {
  --item1-transform: translateX(-100%) translateY(-5%) scale(1.5);
  --item1-filter: blur(30px);
  --item1-zIndex: 11;
  --item1-opacity: 0;

  --item2-transform: translateX(0);
  --item2-filter: blur(0px);
  --item2-zIndex: 10;
  --item2-opacity: 1;

  --item3-transform: translate(50%, 10%) scale(0.8);
  --item3-filter: blur(10px);
  --item3-zIndex: 9;
  --item3-opacity: 1;

  --item4-transform: translate(90%, 20%) scale(0.5);
  --item4-filter: blur(30px);
  --item4-zIndex: 8;
  --item4-opacity: 1;

  --item5-transform: translate(120%, 30%) scale(0.3);
  --item5-filter: blur(40px);
  --item5-zIndex: 7;
  --item5-opacity: 0;

  /* Preloader Variables */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gold: #c5a059;
  --gold-glow: rgba(197, 160, 89, 0.25);
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.68);
}



/* carousel */
.carousel {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.carousel .list {
  position: absolute;
  inset: 0;
  width: min(1140px, 90vw);
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
}

.carousel .list .item {
  position: absolute;
  left: 0;
  width: 70%;
  height: 100%;
  font-size: 15px;
  transition:
    left 0.5s,
    opacity 0.5s,
    width 0.5s;
}

.carousel .list .item:nth-child(n + 6) {
  opacity: 0;
}

.carousel .list .item:nth-child(2) {
  z-index: 10;
  transform: translateX(0);
}

.carousel .list .item img {
  width: 50%;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: right 1.5s;
  max-height: 80vh;
  object-fit: contain;
}

/* introduce */
.carousel .list .item .introduce {
  opacity: 0;
  pointer-events: none;
}

.carousel .list .item:nth-child(2) .introduce {
  opacity: 1;
  pointer-events: auto;
  width: 45%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.5s;
}

.carousel .list .item .introduce .title {
  font-size: clamp(1rem, 1.8vw, 2em);
  font-weight: 500;
  line-height: 1em;
}

.carousel .list .item .introduce .topic {
  font-size: clamp(2rem, 4vw, 4em);
  font-weight: 500;
}

.carousel .list .item .introduce .des {
  font-size: clamp(11px, 1vw, 14px);
  color: #5559;
  line-height: 1.7;
}



/* item positioning */
.carousel .list .item:nth-child(1) {
  transform: var(--item1-transform);
  filter: var(--item1-filter);
  z-index: var(--item1-zIndex);
  opacity: var(--item1-opacity);
  pointer-events: none;
}

.carousel .list .item:nth-child(3) {
  transform: var(--item3-transform);
  filter: var(--item3-filter);
  z-index: var(--item3-zIndex);
}

.carousel .list .item:nth-child(4) {
  transform: var(--item4-transform);
  filter: var(--item4-filter);
  z-index: var(--item4-zIndex);
}

.carousel .list .item:nth-child(5) {
  transform: var(--item5-transform);
  filter: var(--item5-filter);
  opacity: var(--item5-opacity);
  pointer-events: none;
}

/* text animation */
.carousel .list .item:nth-child(2) .introduce .title,
.carousel .list .item:nth-child(2) .introduce .topic,
.carousel .list .item:nth-child(2) .introduce .des,
.carousel .list .item:nth-child(2) .introduce .seeMore {
  opacity: 0;
  animation: showContent 0.5s 1s ease-in-out 1 forwards;
}

@keyframes showContent {
  from {
    transform: translateY(-30px);
    filter: blur(10px);
  }
  to {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
}

.carousel .list .item:nth-child(2) .introduce .topic {
  animation-delay: 1.2s;
}
.carousel .list .item:nth-child(2) .introduce .des {
  animation-delay: 1.4s;
}


/* next */
.carousel.next .item:nth-child(1) {
  animation: transformFromPosition2 0.5s ease-in-out 1 forwards;
}
@keyframes transformFromPosition2 {
  from {
    transform: var(--item2-transform);
    filter: var(--item2-filter);
    opacity: var(--item2-opacity);
  }
}
.carousel.next .item:nth-child(2) {
  animation: transformFromPosition3 0.7s ease-in-out 1 forwards;
}
@keyframes transformFromPosition3 {
  from {
    transform: var(--item3-transform);
    filter: var(--item3-filter);
    opacity: var(--item3-opacity);
  }
}
.carousel.next .item:nth-child(3) {
  animation: transformFromPosition4 0.9s ease-in-out 1 forwards;
}
@keyframes transformFromPosition4 {
  from {
    transform: var(--item4-transform);
    filter: var(--item4-filter);
    opacity: var(--item4-opacity);
  }
}
.carousel.next .item:nth-child(4) {
  animation: transformFromPosition5 1.1s ease-in-out 1 forwards;
}
@keyframes transformFromPosition5 {
  from {
    transform: var(--item5-transform);
    filter: var(--item5-filter);
    opacity: var(--item5-opacity);
  }
}

/* prev */
.carousel.prev .list .item:nth-child(5) {
  animation: transformFromPosition4 0.5s ease-in-out 1 forwards;
}
.carousel.prev .list .item:nth-child(4) {
  animation: transformFromPosition3 0.7s ease-in-out 1 forwards;
}
.carousel.prev .list .item:nth-child(3) {
  animation: transformFromPosition2 0.9s ease-in-out 1 forwards;
}
.carousel.prev .list .item:nth-child(2) {
  animation: transformFromPosition1 1.1s ease-in-out 1 forwards;
}
@keyframes transformFromPosition1 {
  from {
    transform: var(--item1-transform);
    filter: var(--item1-filter);
    opacity: var(--item1-opacity);
  }
}

/* detail */
.carousel .list .item .detail {
  opacity: 0;
  pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(3),
.carousel.showDetail .list .item:nth-child(4) {
  left: 100%;
  opacity: 0;
  pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) {
  width: 100%;
}

.carousel.showDetail .list .item:nth-child(2) .introduce {
  opacity: 0;
  pointer-events: none;
}

.carousel.showDetail .list .item:nth-child(2) img {
  right: 50%;
}

.carousel.showDetail .list .item:nth-child(2) .detail {
  opacity: 1;
  width: 46%;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  pointer-events: auto;
}

.carousel.showDetail .list .item:nth-child(2) .detail .title {
  font-size: clamp(2rem, 3.5vw, 4em);
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications {
  display: flex;
  gap: 10px;
  width: 100%;
  border-top: 1px solid #5553;
  margin-top: 20px;
  overflow-x: auto;
}

.carousel.showDetail .list .item:nth-child(2) .detail .specifications div {
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.carousel.showDetail
  .list
  .item:nth-child(2)
  .detail
  .specifications
  div
  p:nth-child(1) {
  font-weight: bold;
  font-size: 12px;
}

.carousel.showDetail
  .list
  .item:nth-child(2)
  .detail
  .specifications
  div
  p:nth-child(2) {
  font-size: 11px;
  color: #5559;
}

/* detail text animation */
.carousel.showDetail .list .item:nth-child(2) .detail .title,
.carousel.showDetail .list .item:nth-child(2) .detail .des,
.carousel.showDetail .list .item:nth-child(2) .detail .specifications,
.carousel.showDetail .list .item:nth-child(2) .detail .checkout {
  opacity: 0;
  animation: showContent 0.5s 1s ease-in-out 1 forwards;
}

.carousel.showDetail .list .item:nth-child(2) .detail .des {
  animation-delay: 1.2s;
}
.carousel.showDetail .list .item:nth-child(2) .detail .specifications {
  animation-delay: 1.4s;
}
.carousel.showDetail .list .item:nth-child(2) .detail .checkout {
  animation-delay: 1.6s;
}



/* ambient glow */
.carousel::before {
  width: 500px;
  height: 300px;
  content: "";
  background-image: linear-gradient(70deg, #dc422a, blue);
  position: absolute;
  z-index: -1;
  border-radius: 20% 30% 80% 10%;
  filter: blur(150px);
  top: 50%;
  left: 50%;
  transform: translate(-10%, -50%);
  transition: 1s;
}

.carousel.showDetail::before {
  transform: translate(-100%, -50%) rotate(90deg);
  filter: blur(130px);
}

/* responsive */
@media screen and (max-width: 991px) {
  .carousel .list .item {
    width: 90%;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .title {
    font-size: 2em;
  }
}


/* dark mode */
html[data-theme="dark"] body {
  background-color: #111;
  color: #eee;
}
html[data-theme="dark"] body .carousel::before {
  opacity: 0.6;
}
html[data-theme="dark"] body .carousel .list .item .introduce .des {
  color: #aaa9;
}

html[data-theme="dark"] body
  .carousel.showDetail
  .list
  .item:nth-child(2)
  .detail
  .specifications {
  border-color: #aaa3;
}

html[data-theme="dark"] body .controls button {
  background: rgba(30, 30, 30, 0.7);
  border-color: rgba(200, 170, 130, 0.3);
  color: #d4b896;
}


/* controls top-right */
.controls {
  position: fixed;
  top: 1.5rem;
  right: 5vw;
  display: flex;
  gap: 10px;
  z-index: 999;
}
.controls button {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(120, 90, 60, 0.3);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: Poppins;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #4a3728;
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.2s;
}
.controls button:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.05);
}

/* Home Navigation */
.home-nav {
  position: fixed;
  top: 1.5rem;
  left: 5vw;
  z-index: 999;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 42px;
  width: fit-content;
  height: 42px;
  border-radius: 50px;
  border: 1px solid var(--gold);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #4a3728;
  transition: all 420ms var(--ease);
  padding: 0 11px;
  box-sizing: border-box;
}

.back-text {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: all 420ms var(--ease);
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0;
}

.back-link:hover .back-text {
  max-width: 150px;
  opacity: 1;
  margin-left: 8px;
}

.back-link:hover {
  background: var(--gold);
  color: #0a140f;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--gold-glow);
}

.back-link .home-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 420ms var(--ease);
}

.back-link:hover .home-icon {
  transform: scale(1.1);
}

html[data-theme="dark"] body .back-link {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--gold);
  color: var(--text);
}

html[data-theme="dark"] body .back-link:hover {
  background: var(--gold);
  color: #0a140f;
}



/* ADDED BACK BUTTON BOTTOM RIGHT */

/* dark mode */
html[data-theme="dark"] body {
  background-color: #111;
  color: #eee;
}
html[data-theme="dark"] body .carousel::before {
  opacity: 0.6;
}
html[data-theme="dark"] body .carousel .list .item .introduce .des {
  color: #aaa9;
}

html[data-theme="dark"] body
  .carousel.showDetail
  .list
  .item:nth-child(2)
  .detail
  .specifications {
  border-color: #aaa3;
}

html[data-theme="dark"] body .controls button {
  background: rgba(30, 30, 30, 0.7);
  border-color: rgba(200, 170, 130, 0.3);
  color: #d4b896;
}


/* controls top-right */
.controls {
  position: fixed;
  top: 1.5rem;
  right: 5vw;
  display: flex;
  gap: 10px;
  z-index: 999;
}
.controls button {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(120, 90, 60, 0.3);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: Poppins;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #4a3728;
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.2s;
}
.controls button:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.05);
}

/* back detail button — bottom right */
/* #backDetail {
    position: absolute;
    bottom: 30px;
    right: 24px;
    z-index: 100;
    border: none;
    border-bottom: 1px solid rgba(120, 90, 60, 0.5);
    font-family: Poppins;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: transparent;
    color: #4a3728;
    padding: 10px 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, color 0.3s;
    cursor: pointer;
    white-space: nowrap;
} */
.carousel.showDetail #backDetail {
  opacity: 1;
  pointer-events: auto;
}

/* Cinematic Preloader Styles */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 50%,
    #0a140d 0%,
    #020503 80%,
    #000 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.2rem);
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition:
    opacity 0.85s var(--ease),
    background 0.85s var(--ease),
    visibility 0.85s linear;
}

.loader-overlay.is-morphing {
  background: transparent !important;
  pointer-events: none;
}

.loader-overlay.is-morphing .preloader-ambient-light,
.loader-overlay.is-morphing #preloader-fx-canvas,
.loader-overlay.is-morphing .preloader-golden-glow,
.loader-overlay.is-morphing .preloader-text-content {
  opacity: 0 !important;
  transition: opacity 0.6s var(--ease);
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-ambient-light {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vmin;
  height: 100vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(15, 35, 20, 0.3) 0%,
    rgba(5, 10, 5, 0) 70%
  );
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.preloader-golden-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(180px, 50vw, 280px);
  height: clamp(180px, 50vw, 280px);
  background: radial-gradient(
    circle,
    rgba(197, 160, 89, 0.25) 0%,
    rgba(197, 160, 89, 0.05) 40%,
    rgba(197, 160, 89, 0) 70%
  );
  border-radius: 50%;
  z-index: 3;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: preloader-aura 3.5s ease-in-out infinite;
}

@keyframes preloader-aura {
  0%,
  100% {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(0.85);
  }
  50% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

.preloader-logo-wrapper {
  position: relative;
  z-index: 10;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
  animation: preloader-logo-float 4.5s ease-in-out infinite;
  transition:
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.1s var(--ease),
    opacity 1.1s var(--ease);
  will-change: transform, opacity;
}

.loader-overlay.is-morphing .preloader-logo-wrapper {
  animation: none;
}

@keyframes preloader-logo-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
  }
  50% {
    transform: translateY(-12px) scale(1.02);
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.2));
  }
}

.preloader-logo-wrapper img {
  width: clamp(100px, 20vw, 140px);
  height: auto;
  display: block;
  opacity: 0.45;
  transition: opacity 0.5s var(--ease);
}

#preloader-fx-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.preloader-text-content {
  text-align: center;
  z-index: 10;
  width: 100%;
  pointer-events: none;
  animation: preloader-content-in 1.2s var(--ease) forwards;
}

@keyframes preloader-content-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preloader-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.8rem, 5.2vw, 3.2rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  margin: 0;
  padding-left: 0.32em;
  color: var(--text);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.preloader-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateX(-20px);
  animation: char-flow 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.preloader-subtitle {
  font-family: "Inter", sans-serif;
  font-size: clamp(0.75rem, 1.5vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-top: 1.5rem;
  color: var(--muted);
  opacity: 0;
  animation: subtitle-fade 7s ease-in-out infinite;
}

@keyframes char-flow {
  0% {
    opacity: 0;
    transform: translateX(-25px) translateY(8px);
    filter: blur(6px);
  }
  20%,
  80% {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(25px) translateY(-8px);
    filter: blur(6px);
  }
}

@keyframes subtitle-fade {
  0%,
  15% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  35%,
  65% {
    opacity: 0.75;
    transform: translateY(0);
    filter: blur(0);
  }
  85%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(4px);
  }
}

.char:nth-child(1) { animation-delay: 0.1s; }
.char:nth-child(2) { animation-delay: 0.2s; }
.char:nth-child(3) { animation-delay: 0.3s; }
.char:nth-child(4) { animation-delay: 0.4s; }
.char:nth-child(5) { animation-delay: 0.5s; }
.char:nth-child(6) { animation-delay: 0.6s; }
.char:nth-child(7) { animation-delay: 0.7s; }

/* Mobile query placed at the end to correctly override styles */
@media screen and (max-width: 767px) {
  .carousel .list .item {
    width: 100%;
    font-size: clamp(10px, 2.5vw, 13px);
  }
  .carousel .list .item:nth-child(2) .introduce {
    width: 55%;
    padding-right: 12px;
    box-sizing: border-box;
  }
  .carousel .list .item img {
    width: 42%;
    right: -2%;
    max-height: 65vh;
  }
  .carousel.showDetail .list .item:nth-child(2) img {
    right: 55%;
    width: 45%;
    max-height: 65vh;
  }
  .carousel .list .item:nth-child(2) .introduce .title {
    font-size: 1.4em;
    word-break: break-word;
    margin-bottom: 4px;
    line-height: 1.2;
  }
  .carousel .list .item:nth-child(2) .introduce .topic {
    font-size: 1.8em;
    word-break: break-word;
    margin-bottom: 8px;
    line-height: 1.15;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: clamp(10px, 2.5vw, 12px);
    width: 55%;
    padding-left: 12px;
    box-sizing: border-box;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .title {
    font-size: 1.8em;
    word-break: break-word;
    margin-bottom: 8px;
    line-height: 1.15;
  }
  .carousel .list .item:nth-child(2) .introduce .des,
  .carousel.showDetail .list .item:nth-child(2) .detail .des {
    height: auto;
    max-height: 38vh;
    overflow-y: auto;
    line-height: 1.6;
    word-break: break-word;
    font-size: clamp(11px, 2.5vw, 12px);
    padding-right: 4px;
  }
  .carousel .list .item:nth-child(2) .introduce .des::-webkit-scrollbar,
  .carousel.showDetail .list .item:nth-child(2) .detail .des::-webkit-scrollbar {
    width: 3px;
  }
  .carousel .list .item:nth-child(2) .introduce .des::-webkit-scrollbar-thumb,
  .carousel.showDetail .list .item:nth-child(2) .detail .des::-webkit-scrollbar-thumb {
    background-color: var(--gold);
    border-radius: 10px;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .specifications {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    margin-top: 10px;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .specifications div {
    min-width: calc(50% - 4px);
    text-align: right;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .specifications div p:nth-child(1) {
    font-weight: 600;
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 2px;
  }
  .carousel.showDetail .list .item:nth-child(2) .detail .specifications div p:nth-child(2) {
    font-size: 10px;
    line-height: 1.3;
    color: #666;
  }
  html[data-theme="dark"] body .carousel.showDetail .list .item:nth-child(2) .detail .specifications div p:nth-child(2) {
    color: #ccc;
  }
  .arrows {
    padding: 0 8px;
  }
  #prev,
  #next {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  /* Mobile Navigation Button Scaledown */
  .back-link {
    min-height: auto !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
  }
  .back-link .home-icon {
    width: 18px !important;
    height: 18px !important;
  }
  .controls button {
    padding: 6px 12px !important;
    font-size: 11px !important;
    border-radius: 20px !important;
  }
}
