/* ═══════════════════════════════════════════════════════
   CINQORIA — Premium Design System · Midnight Amethyst
   ═══════════════════════════════════════════════════════ */

:root {
  /* Backgrounds */
  --bg-darkest:    #0C0A14;
  --bg-dark:       #14112A;
  --bg-medium:     #1E1A38;
  --bg-glass:      rgba(30, 26, 56, 0.65);
  --bg-glass-light:rgba(30, 26, 56, 0.35);

  /* Accent palette — Warm Amethyst */
  --accent:          #B388FF;
  --accent-light:    #D0B4FF;
  --accent-dark:     #9065E0;
  --accent-hover:    #CCA8FF;
  --accent-glow:     rgba(179, 136, 255, 0.35);
  --accent-subtle:   rgba(179, 136, 255, 0.15);

  /* Text */
  --text-primary:  #E8E4F0;
  --text-secondary:#9590A8;
  --text-muted:    #58536A;

  /* Typography */
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:  'Outfit', 'Inter', sans-serif;

  /* Spacing */
  --nav-height:    80px;
  
  /* Utils */
  --transition:    0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body:has(.nav-links.open) {
  overflow: hidden;
}

/* Performance sentinel for Navbar IntersectionObserver */
.top-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

/* Ambient glow in the background */
.ambient-light {
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 60vh;
  background: radial-gradient(ellipse at top, var(--accent-subtle) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, .brand-logo {
  font-family: var(--font-heading);
}

.text-gradient-accent {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-hover) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 100;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--accent-subtle);
}

/* Neutralize backdrop-filter when mobile menu is open —
   backdrop-filter creates a containing block for fixed children,
   which traps .nav-links inside the 80px navbar. */
.navbar:has(.nav-links.open) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.logo-svg {
  width: 36px;
  height: 36px;
  display: inline-block;
}

.logo-svg.small {
  width: 24px;
  height: 24px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links a:not(.btn-primary-outline) {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-links a:not(.btn-primary-outline):hover {
  color: var(--accent-light);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
  padding: 4px;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.mobile-toggle.active span:first-child {
  transform: rotate(45deg) translate(3px, 3px);
}

.mobile-toggle.active span:last-child {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg-darkest);
  font-weight: 600;
  border-radius: 4px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--accent-subtle);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary-outline:hover {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
  width: 100%;
}

.subtitle-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.accent-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.hero-subtitle {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  font-weight: 500;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 2rem;
  font-weight: 300;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 3rem;
}

/* ─── HERO VIDEO BACKGROUND ─── */
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  object-fit: cover;
  opacity: 0.4; /* Slight opacity so the dark background bleeds through */
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-darkest) 0%, transparent 40%, var(--bg-darkest) 100%),
              radial-gradient(circle at center, transparent 0%, var(--bg-darkest) 100%);
  z-index: 1;
}

/* ─── SECTIONS ─── */
section {
  padding: 8rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  margin-bottom: 5rem;
  text-align: center;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--accent);
  font-size: 1.1rem;
}

/* ─── PHILOSOPHY ─── */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.phil-card {
  background: var(--bg-dark);
  border: 1px solid var(--bg-glass-light);
  padding: 4rem 3rem;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.phil-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--bg-dark), var(--accent-dark), var(--bg-dark));
  opacity: 0;
  transition: var(--transition);
}

.phil-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-subtle);
  background: var(--bg-medium);
}

.phil-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 3rem;
  font-weight: 200;
  color: var(--accent-subtle);
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  transition: var(--transition);
}

.phil-card:hover .card-icon {
  color: var(--accent-light);
}

.phil-card h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.phil-card p {
  color: var(--text-secondary);
}

/* ─── CRAFTMANSHIP / SERVICES ─── */
.services-list {
  max-width: 900px;
  margin: 0 auto;
}

.craft {
  position: relative;
  overflow: hidden;
}

.craft-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.craft-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-darkest) 0%, transparent 15%, transparent 85%, var(--bg-darkest) 100%);
  z-index: 1;
  pointer-events: none;
}

.service-item {
  display: flex;
  gap: 3rem;
  padding: 4rem 0;
  border-bottom: 1px solid var(--bg-glass-light);
  transition: var(--transition);
}

.service-item:hover {
  border-bottom-color: var(--accent);
}

.service-num {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 200;
  color: var(--accent-subtle);
  line-height: 1;
  width: 80px;
  transition: var(--transition);
}

.service-item:hover .service-num {
  color: var(--accent);
  transform: scale(1.1);
}

.service-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 300;
}

.service-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
}

/* ─── CLIENTS ─── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  align-items: center;
}

.client-logo-box {
  padding: 3rem 2rem;
  background: var(--bg-glass-light);
  border: 1px solid var(--bg-glass);
  border-radius: 8px;
  text-align: center;
  transition: var(--transition);
  filter: grayscale(100%);
  opacity: 0.6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.client-logo-box:hover {
  filter: grayscale(0%);
  opacity: 1;
  border-color: var(--accent-subtle);
  transform: translateY(-5px);
  background: var(--bg-glass);
}

.client-placeholder {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  letter-spacing: 1px;
  font-size: 1.1rem;
}

.client-cta-box {
  border: 1px dashed rgba(179, 136, 255, 0.3);
  text-decoration: none;
  opacity: 0.8;
  filter: none;
  background: rgba(18, 14, 30, 0.4);
}

.client-cta-box:hover {
  border-color: var(--accent);
  border-style: solid;
  opacity: 1;
  background: rgba(30, 20, 52, 0.6);
  box-shadow: 0 10px 30px -10px rgba(179, 136, 255, 0.2);
}

.client-cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.client-cta-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 500;
}

.client-cta-text {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-size: 1.05rem;
  letter-spacing: 1px;
  transition: var(--transition);
}

.client-cta-box:hover .client-cta-text {
  color: #fff;
}

.client-name {
  color: var(--text-primary);
  font-family: var(--font-heading);
  letter-spacing: 1px;
  font-size: 1.1rem;
  transition: var(--transition);
}

a.client-logo-box:hover .client-name {
  color: var(--accent-light);
}

.client-logo-img {
  max-width: 180px;
  max-height: 60px;
  object-fit: contain;
  filter: brightness(0) invert(0.7);
  transition: var(--transition);
}

a.client-logo-box:hover .client-logo-img {
  filter: none;
}

/* ─── CONTACT ─── */
.contact-container {
  display: flex;
  justify-content: center;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--accent-subtle);
  padding: 5rem;
  border-radius: 12px;
  text-align: center;
  max-width: 800px;
  width: 100%;
}

.contact-title {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.btn-primary.lg {
  font-size: 1.2rem;
  padding: 1.2rem 3rem;
}

.contact-direct {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-email-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-heading);
  letter-spacing: 1px;
  font-size: 1.1rem;
  transition: var(--transition);
}

.contact-email-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ─── FOOTER ─── */
.footer {
  padding: 4rem 0;
  border-top: 1px solid var(--bg-glass-light);
  background: #080610;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  letter-spacing: 2px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  color: var(--text-muted);
}

.footer-email {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-email:hover {
  color: var(--accent);
}

/* ─── ANIMATIONS ─── */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s forwards cubic-bezier(0.16, 1, 0.3, 1);
  animation-delay: 0.2s;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1.5s forwards cubic-bezier(0.16, 1, 0.3, 1);
  animation-delay: 0.5s;
}

/* Scroll Reveals */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal {
  transform: translateY(40px);
}

.reveal-left {
  transform: translateX(-50px);
}

.reveal-right {
  transform: translateX(50px);
}

.reveal.active, .reveal-left.active, .reveal-right.active {
  opacity: 1;
  transform: translate(0);
}

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

@keyframes fadeIn {
  to { opacity: 0.3; } /* Hero visual target opacity */
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .service-item {
    flex-direction: column;
    gap: 1rem;
    padding: 3rem 0;
  }
  
  .glass-panel {
    padding: 3rem 2rem;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    background: rgba(12, 10, 20, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-links a:not(.btn-primary-outline) {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .nav-links .btn-primary-outline {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  section {
    padding: 5rem 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
}
