/* ══════════════════════════════════════════
   GLOBAL DESIGN SYSTEM — Manikandan G Mani
   All pages link to this file for shared tokens,
   resets, orb animations and premium injections.
══════════════════════════════════════════ */

/* ──────────────── TOKENS ──────────────── */
:root {
  --bg: #04060f;
  --surface: #090e1f;
  --surface2: #0e1530;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --text: #e2e8f0;
  --muted: #7b8eb0;
  --border: rgba(255, 255, 255, .07);
  --glow: rgba(56, 189, 248, .18);
  --radius: 18px;
  --transition: .32s cubic-bezier(.4, 0, .2, 1);
  --trans: .32s cubic-bezier(.4, 0, .2, 1);
}

/* ──────────────── LIGHT MODE ──────────────── */
body.light {
  --bg: #FFFFFF;
  --surface: #F5F5F7;
  --surface2: #F5F5F7;
  --text: #1D1D1F;
  --muted: #000000;
  --border: #d2d2d7;
  --glow: rgba(0, 102, 204, 0.15);
  --accent: #0066CC;
  --accent2: #1D1D1F;
}

body.light header,
body.light .top-bar {
  background: rgba(255, 255, 255, .8) !important;
  border-bottom: 1px solid rgba(0, 0, 0, .05) !important;
  backdrop-filter: blur(20px);
}

body.light .btn.primary {
  color: #ffffff;
}

body.light .filter-tab.active {
  color: #ffffff;
}

body.light .in-progress-badge {
  background: rgba(245, 158, 11, .15);
  border-color: rgba(245, 158, 11, .4);
  color: #d97706;
}

body.light .in-progress-badge .pulse-dot {
  background: #d97706;
}

body.light .orb {
  display: none;
}

/* ──────────────── RESET ──────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Scroll behavior handled by Lenis engine */
  height: -webkit-fill-available;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);

  /* Senior Rendering Suite */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

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

/* ──────────────── AMBIENT ORBS ──────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  z-index: -1;
  pointer-events: none;
}

.orb1 {
  width: 500px;
  height: 500px;
  background: #38bdf8;
  top: -160px;
  left: -160px;
  opacity: .12;
  animation: drift 14s ease-in-out infinite alternate;
}

.orb2 {
  width: 400px;
  height: 400px;
  background: #818cf8;
  bottom: -140px;
  right: -140px;
  opacity: .10;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  to {
    transform: translate(40px, 30px);
  }
}

/* ──────────────── SHARED ANIMATION ──────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

/* ──────────────── TYPEWRITER CURSOR ──────────────── */
.typed-cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ──────────────── SHARED LOGO STRUCTURE ──────────────── */
.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: .3px;
  flex-shrink: 0;
}

.logo span {
  color: var(--text);
  font-weight: 400;
  font-size: 13px;
  display: block;
  margin-top: -2px;
}

.site-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
}

/* ──────────────── PREMIUM INJECTIONS ──────────────── */
/* 1. Custom Selection Highlight */
::selection {
  background: var(--glow);
  color: var(--accent);
}

/* 1.1 Custom Premium Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 20px;
  border: 3px solid var(--bg);
  /* Creates the floating effect + better target */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* 2. Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 99999;
  box-shadow: 0 0 10px var(--glow);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* 3. Page Transition Overlay */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
  pointer-events: none;
}

.page-transition-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ──────────────── SHARED HEADER / TOP-BAR ──────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 8%;
  background: rgba(4, 6, 15, .75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 30px;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, .35);
  font-size: 13px;
  font-weight: 500;
  transition: var(--trans);
}

.back-btn:hover {
  background: rgba(56, 189, 248, .1);
  transform: translateX(-3px);
}

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


.figma-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: #020617;
  transition: var(--trans);
}

.figma-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--glow);
}

/* ──────────────── SHARED CASE HERO ──────────────── */
.case-hero {
  text-align: center;
  padding: 80px 8% 50px;
  animation: fadeUp .8s ease both;
}

.case-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .2);
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.case-hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.15;
}

.case-hero h1 span {
  color: var(--accent);
}

.case-hero p {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.case-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.meta-chip i {
  color: var(--accent);
}

/* ──────────────── SHARED DIVIDER ──────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 8%;
}

/* ──────────────── SHARED FOOTER ──────────────── */
.case-footer {
  text-align: center;
  padding: 40px 8%;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.case-footer a {
  color: var(--accent);
  font-weight: 500;
}

.case-footer a:hover {
  text-decoration: underline;
}

/* ──────────────── SHARED LIGHTBOX ──────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 24px;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
}

.lightbox.active {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 1100px;
  width: 100%;
  animation: fadeUp .3s ease;
}

.lightbox-inner img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
}

.lb-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #020617;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--trans);
}

.lb-close:hover {
  transform: scale(1.15);
}

/* ──────────────── MOBILE ──────────────── */
@media (max-width: 768px) {
  .top-bar {
    padding: 14px 6%;
  }

  .case-hero {
    padding: 60px 6% 40px;
  }

  .site-logo {
    display: none;
  }
}

/* ──────────────── PREMIUM BUTTONS ──────────────── */
#scrollTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100px) rotate(45deg);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#scrollTop.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) rotate(0);
}

#scrollTop:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--glow);
}

#scrollTop::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(1);
}

#scrollTop:hover::before {
  animation: pulseRotate 2s infinite;
}

@keyframes pulseRotate {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ──────────────── SUCCESS CHECKMARK ──────────────── */
.success-checkmark {
  width: 80px;
  height: 115px;
  margin: 0 auto;
}

.check-icon {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid var(--accent);
}

.check-icon::before {
  top: 3px;
  left: -2px;
  width: 30px;
  transform-origin: 100% 50%;
  border-radius: 100px 0 0 100px;
}

.check-icon::after {
  top: 0;
  left: 30px;
  width: 60px;
  transform-origin: 0 50%;
  border-radius: 0 100px 100px 0;
  animation: rotatePlaceholder 4.25s ease-in;
}

.check-icon .icon-line {
  height: 5px;
  background-color: var(--accent);
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
}

.check-icon .icon-line.line-tip {
  top: 46px;
  left: 14px;
  width: 25px;
  transform: rotate(45deg);
  animation: icon-line-tip 0.75s;
}

.check-icon .icon-line.line-long {
  top: 38px;
  right: 8px;
  width: 47px;
  transform: rotate(-45deg);
  animation: icon-line-long 0.75s;
}

.check-icon .icon-circle {
  top: -4px;
  left: -4px;
  z-index: 10;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: absolute;
  box-sizing: content-box;
  border: 4px solid rgba(56, 189, 248, .2);
}

.check-icon .icon-fix {
  top: 8px;
  left: 28px;
  width: 5px;
  height: 70px;
  position: absolute;
  z-index: 1;
}

@keyframes icon-line-tip {
  0% {
    width: 0;
    left: 1px;
    top: 19px;
  }

  54% {
    width: 0;
    left: 1px;
    top: 19px;
  }

  70% {
    width: 50px;
    left: -8px;
    top: 37px;
  }

  84% {
    width: 17px;
    left: 21px;
    top: 48px;
  }

  100% {
    width: 25px;
    left: 14px;
    top: 46px;
  }
}

@keyframes icon-line-long {
  0% {
    width: 0;
    right: 46px;
    top: 54px;
  }

  65% {
    width: 0;
    right: 46px;
    top: 54px;
  }

  84% {
    width: 55px;
    right: 0px;
    top: 35px;
  }

  100% {
    width: 47px;
    right: 8px;
    top: 38px;
  }
}

/* ──────────────── THEME TOGGLE ──────────────── */
.toggle-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.toggle-btn:hover {
  background: var(--accent);
  color: #000;
}

/* ──────────────── PROJECT NAVIGATION GRID ──────────────── */
.project-nav-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.nav-box {
  padding: 80px 8%;
  display: flex;
  flex-direction: column;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

.nav-box.prev {
  align-items: flex-start;
  text-align: left;
  border-right: 1px solid var(--border);
}

.nav-box.next {
  align-items: flex-end;
  text-align: right;
}

.nav-box:hover {
  background: var(--surface);
}

.nav-label {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  max-width: 400px;
  transition: var(--trans);
}

.nav-box:hover .nav-title {
  color: var(--accent);
}

.nav-box.prev:hover .nav-title {
  transform: translateX(10px);
}

.nav-box.next:hover .nav-title {
  transform: translateX(-10px);
}

@media (max-width: 768px) {
  .project-nav-container {
    grid-template-columns: 1fr;
  }
  .nav-box {
    padding: 48px 6%;
    text-align: center !important;
    align-items: center !important;
  }
  .nav-box.prev {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .nav-title {
    max-width: 100%;
    font-size: 24px;
  }
  /* Vertical hover motion for stacked mobile view */
  .nav-box.prev:hover .nav-title,
  .nav-box.next:hover .nav-title {
    transform: translateY(-5px);
  }
}

/* ──────────────── PAGE TRANSITIONS (DIRECTIONAL) ──────────────── */
.page-transition-overlay.slide-left {
  transform-origin: right !important;
}

.page-transition-overlay.slide-left.animate-out {
  animation: slideLeftOut .6s cubic-bezier(.77, 0, .18, 1) forwards !important;
}

@keyframes slideLeftOut {
  0% { transform: scaleX(0); transform-origin: right; }
  50% { transform: scaleX(1); transform-origin: right; }
  50.01% { transform-origin: left; }
  100% { transform: scaleX(0); transform-origin: left; }
}

.page-transition-overlay.slide-right {
  transform-origin: left !important;
}

.page-transition-overlay.slide-right.animate-out {
  animation: slideRightOut .6s cubic-bezier(.77, 0, .18, 1) forwards !important;
}

@keyframes slideRightOut {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.01% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ──────────────── COPY TOAST ──────────────── */
.copy-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #020617;
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 15px 35px var(--glow);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.5px;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}