/* ========================================
   QINĀRĀ AI - COMPLETE STYLES
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600&display=swap');

/* ========================================
   VARIABLES
======================================== */
:root {
  --bg: #F7F5F2;
  --bg-alt: #EDEBE8;
  --text: #1A1A1A;
  --text-light: #4A4A4A;
  --text-muted: #6A6A6A;
  --accent: #5C4B6B;
  --border: rgba(26, 26, 26, 0.08);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --rainbow: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #ff6b6b);
}

/* ========================================
   RESET
======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ========================================
   RAINBOW UNDERLINE ANIMATION
======================================== */
@keyframes rainbowMove {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* ========================================
   NAVIGATION
======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 120px;
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(20px);
}

.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  opacity: 0;
  animation: fadeIn 0.6s ease 0.1s forwards;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9375rem;
  position: relative;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  transition: color 0.2s;
}

.nav-links a:nth-child(1) { animation-delay: 0.2s; }
.nav-links a:nth-child(2) { animation-delay: 0.3s; }
.nav-links a:nth-child(3) { animation-delay: 0.4s; }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.mobile-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: 0.3s;
}

.mobile-toggle.active span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 48px;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: 0.4s;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-family: var(--serif);
  font-size: 2rem;
  transition: color 0.2s;
  position: relative;
}

.mobile-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.mobile-menu a:hover::after {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.upper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  padding-top: 80px;
  position: relative;
}

.vertical-line {
  position: absolute;
  top: 120px;
  bottom: 40px;
  left: 50%;
  width: 1px;
  background: var(--border);
  opacity: 0;
  animation: fadeIn 0.8s ease 0.6s forwards;
}

/* Left Side */
.left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 96px 96px 120px;
}

.headline {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}

.headline span {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 500;
  line-height: 1.05;
  opacity: 0;
  animation: fadeLeft 0.7s ease forwards;
}

.headline span:nth-child(1) { animation-delay: 0.2s; }
.headline span:nth-child(2) { animation-delay: 0.35s; }
.headline span:nth-child(3) { animation-delay: 0.5s; }

.divider {
  width: 64px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 32px;
  opacity: 0;
  animation: expandWidth 0.5s ease 0.7s forwards;
}

.context {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeIn 0.5s ease 0.85s forwards;
}

.categories li {
  opacity: 0;
  animation: fadeLeft 0.5s ease forwards;
}

.categories li:nth-child(1) { animation-delay: 0.95s; }
.categories li:nth-child(2) { animation-delay: 1.05s; }
.categories li:nth-child(3) { animation-delay: 1.15s; }

.categories a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.2s;
  position: relative;
}

.categories a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.categories a:hover::after {
  width: calc(100% - 28px);
  animation: rainbowMove 2s linear infinite;
}

.categories a svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  transition: transform 0.2s;
}

.categories a:hover {
  color: var(--text);
}

.categories a:hover svg {
  transform: translateX(-4px);
}

/* Right Side */
.right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  min-height: 400px;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.3s forwards;
}

/* Lower Section */
.lower {
  border-top: 1px solid var(--border);
  padding: 80px 120px;
  opacity: 0;
  animation: fadeUp 0.7s ease 1.3s forwards;
}

.lower-headline {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 20px;
}

.lower-line {
  width: 100%;
  max-width: 600px;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
  margin-bottom: 40px;
}

.description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-light);
  max-width: 800px;
  margin-bottom: 40px;
}

/* Buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.btn-primary {
  padding: 18px 32px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 2px;
  transition: 0.3s;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: 0.2s;
}

.btn-secondary::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(26, 26, 26, 0.2);
  transition: opacity 0.3s;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
  z-index: 1;
}

.btn-secondary:hover::before {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

.btn-secondary:hover::after {
  opacity: 0;
}

.btn-secondary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.btn-secondary:hover {
  color: var(--text);
}

.btn-secondary:hover svg {
  transform: translateX(4px);
}

/* ========================================
   ABOUT SECTION
======================================== */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
  background: var(--bg-alt);
}

.about-content {
  padding: 120px 80px 120px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 24px;
}

.about-headline {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 32px;
}

.about-text {
  margin-bottom: 40px;
}

.about-text p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-light);
  margin-bottom: 16px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-visual {
  position: relative;
  background: var(--bg);
}

#aboutCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ========================================
   RESEARCH PILLARS SECTION
======================================== */
.pillars {
  padding: 120px 120px;
  background: var(--bg);
}

.pillars-header {
  text-align: center;
  margin-bottom: 80px;
}

.pillars-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 24px;
}

.pillars-intro {
  font-size: 1.125rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Pillar Cards */
.pillar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 48px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s ease,
              background 0.4s ease;
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  background: #F2F0ED;
}

.card-dots {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
}

.card-dots .dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--text);
  opacity: 0.1;
  border-radius: 50%;
  transition: opacity 0.4s, transform 0.4s;
}

.card-dots .dot.accent {
  background: var(--accent);
  opacity: 0.25;
}

.pillar-card:hover .dot {
  opacity: 0.18;
  transform: scale(1.3);
}

.pillar-card:hover .dot.accent {
  opacity: 0.35;
}

.card-number {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
  margin-top: 48px;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.2;
}

.card-divider {
  width: 40px;
  height: 2px;
  background: rgba(26, 26, 26, 0.15);
  margin-bottom: 20px;
  transition: width 0.3s, background 0.3s;
}

.pillar-card:hover .card-divider {
  width: 60px;
  background: var(--accent);
}

.card-description {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-light);
  margin-bottom: 32px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
  position: relative;
}

.card-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.card-link:hover::after {
  width: calc(100% - 24px);
  animation: rainbowMove 2s linear infinite;
}

.card-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.card-link:hover {
  color: var(--text);
}

.card-link:hover svg {
  transform: translateX(4px);
}

/* ========================================
   WHY THIS MATTERS SECTION
======================================== */
.why {
  padding: 140px 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#whyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.6;
}

.why-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
}

.why-quote {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 40px;
}

.why-diamond {
  font-size: 0.5rem;
  color: var(--accent);
  margin-bottom: 40px;
  animation: pulse 3s ease-in-out infinite;
}

.why-text {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   CTA SECTION
======================================== */
.cta {
  padding: 120px 120px;
  text-align: center;
  position: relative;
  background: var(--bg-alt);
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.cta-headline {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  margin-bottom: 20px;
}

.cta-line {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 32px;
}

.cta-text {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-light);
  margin-bottom: 48px;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}

/* ========================================
   FOOTER
======================================== */
.footer {
  background: var(--bg);
  padding: 80px 120px 40px;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  margin-bottom: 60px;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  display: block;
  margin-bottom: 16px;
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.footer-email {
  font-size: 0.9375rem;
  color: var(--accent);
  transition: opacity 0.2s;
  position: relative;
}

.footer-email::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.footer-email:hover::after {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.footer-col a {
  display: inline-block;
  font-size: 0.9375rem;
  color: var(--text-light);
  padding: 6px 0;
  transition: color 0.2s;
  position: relative;
}

.footer-col a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-col a:hover::after {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 32px;
}

.footer-legal a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.footer-legal a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rainbow);
  background-size: 200% 100%;
  transition: width 0.3s ease;
}

.footer-legal a:hover {
  color: var(--text);
}

.footer-legal a:hover::after {
  width: 100%;
  animation: rainbowMove 2s linear infinite;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes expandWidth {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: 64px;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* ========================================
   SCROLL ANIMATIONS
======================================== */
.pillars,
.why,
.about,
.cta {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.pillars.visible,
.why.visible,
.about.visible,
.cta.visible {
  opacity: 1;
  transform: translateY(0);
}

.pillar-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease,
              box-shadow 0.4s ease, background 0.4s ease;
}

.pillar-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.pillar-card:nth-child(1) { transition-delay: 0.1s; }
.pillar-card:nth-child(2) { transition-delay: 0.2s; }
.pillar-card:nth-child(3) { transition-delay: 0.3s; }

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
  .nav,
  .lower,
  .pillars,
  .why,
  .cta,
  .footer {
    padding-left: 48px;
    padding-right: 48px;
  }
  
  .left {
    padding: 80px 48px;
  }
  
  .about-content {
    padding: 80px 48px;
  }
}

@media (max-width: 968px) {
  .upper {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  
  .vertical-line {
    display: none;
  }
  
  .left {
    padding: 120px 48px 48px;
    order: 1;
  }
  
  .right {
    padding: 32px 48px;
    min-height: 350px;
    order: 2;
  }
  
  .pillars-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  
  .about {
    grid-template-columns: 1fr;
  }
  
  .about-visual {
    min-height: 300px;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  
  .buttons,
  .cta-buttons {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .cta-buttons {
    align-items: center;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 20px 24px;
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-toggle {
    display: flex;
  }
  
  .left {
    padding: 100px 24px 32px;
  }
  
  .right {
    padding: 24px;
    min-height: 300px;
  }
  
  .lower,
  .pillars,
  .why,
  .cta,
  .footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  
  .pillars {
    padding-top: 80px;
    padding-bottom: 80px;
  }
  
  .why {
    padding-top: 100px;
    padding-bottom: 100px;
  }
  
  .pillar-card {
    padding: 32px;
  }
  
  .headline span {
    font-size: 2.5rem;
  }
  
  .categories a {
    font-size: 1.125rem;
  }
  
  .description,
  .cta-text,
  .why-text {
    font-size: 1rem;
  }
  
  .btn-primary {
    width: 100%;
    text-align: center;
  }
  
  .about-content {
    padding: 60px 24px;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .headline span {
    font-size: 2rem;
  }
  
  .lower-headline {
    font-size: 1.25rem;
  }
  
  .card-title {
    font-size: 1.5rem;
  }
  
  .why-quote {
    font-size: 1.25rem;
  }
  
  .cta-headline {
    font-size: 1.75rem;
  }
}

/* ========================================
   REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

