/* ============================================
   DIIM Digital Twin Technologies
   Main Stylesheet
   ============================================ */

/* Import variables (for customization) */
@import url("variables.css");

/* --------------------------------------------
   Reset & Base
   -------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--text-primary);
  background: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------
   Typography
   -------------------------------------------- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* --------------------------------------------
   Layout Components
   -------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 900px;
}

.container--wide {
  max-width: 1400px;
}

section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 4rem;
}

/* --------------------------------------------
   Navigation
   -------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  transition: all var(--transition-base);
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.nav__container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__logo-img {
  height: 60px;
  width: auto;
}

.nav__logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav__logo-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav__link:hover {
  color: var(--primary);
}

/* --------------------------------------------
   Buttons
   -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn--primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-hover);
}

.btn--secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--link {
  padding: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
}

.btn--link:hover {
  gap: 0.75rem;
}

.btn--link svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn--link:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------
   Hero Section
   -------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay for better text readability */
.hero__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(248, 250, 252, 1) 100%
  );
}

/* Ensure content stays above the image */
.hero__bg,
.hero__mesh,
.hero__content {
  position: relative;
  z-index: 1;
}

/* Dark overlay variant for dark images */
.hero--dark .hero__image::after {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(15, 23, 42, 0.8) 50%,
    rgba(15, 23, 42, 0.95) 100%
  );
}

.hero--dark .hero__title,
.hero--dark .hero__badge {
  color: #ffffff;
}

.hero--dark .hero__description {
  color: rgba(255, 255, 255, 0.8);
}

.hero--dark .gradient-text {
  background: linear-gradient(135deg, #38bdf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 50% at 50% -20%,
      rgba(14, 165, 233, 0.15),
      transparent
    ),
    radial-gradient(
      ellipse 60% 40% at 80% 60%,
      rgba(6, 182, 212, 0.1),
      transparent
    ),
    radial-gradient(
      ellipse 50% 30% at 20% 80%,
      rgba(14, 165, 233, 0.08),
      transparent
    );
}

.hero__mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

.hero__content {
  position: relative;
  max-width: 900px;
  text-align: center;
  z-index: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease forwards;
}

.hero__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  animation: fadeInUp 0.8s ease 0.1s forwards;
  opacity: 0;
}

.hero__description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.3s forwards;
  opacity: 0;
}

/* --------------------------------------------
   Project Cards
   -------------------------------------------- */
.projects {
  background: var(--bg-light);
}

.projects__grid {
  max-width: 900px;
  margin: 0 auto;
}

.project-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition-slow);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 165, 233, 0.3);
}

.project-card__image {
  position: relative;
  height: 280px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  overflow: hidden;
}

.project-card__image::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Dark tint over the whole image for colour unity */
  background: rgba(15, 23, 42, 0.45);
  z-index: 1;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.project-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  padding-top: 4rem;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.97) 0%,
    rgba(15, 23, 42, 0.7) 55%,
    transparent 100%
  );
  z-index: 2;
}

.project-card__tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(14, 165, 233, 0.4);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(4px);
}

.project-card__title {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.project-card__author {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-card__content {
  padding: 1.75rem 2rem;
}

.project-card__description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* --------------------------------------------
   About Section
   -------------------------------------------- */
.about {
  background: var(--bg-white);
}

.about__content {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 3rem;
}

.about__text {
  text-align: center;
}

.about__text p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
}

.stat {
  text-align: center;
}

.stat__value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat__label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* --------------------------------------------
   Contact Section
   -------------------------------------------- */
.contact {
  background: linear-gradient(to bottom, var(--bg-light), var(--bg-white));
}

.contact__grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 900px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  padding: 2rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card:hover {
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: var(--shadow-md);
}

.contact-card__icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.1),
    rgba(6, 182, 212, 0.1)
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.contact-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.contact-card__pi-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.contact-card__pi-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.contact-card__divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.contact-card__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-card__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.contact-card__row-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--text-secondary);
}

.contact-card__text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.contact-card__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.contact-card__link {
  font-size: 0.95rem;
  color: var(--primary);
  text-decoration: none;
}

.contact-card__link:hover {
  text-decoration: underline;
}

.contact-card__links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-card__ext-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.contact-card__ext-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

.contact-card__ext-link:hover {
  color: var(--primary);
}

/* --------------------------------------------
   Footer
   -------------------------------------------- */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 2rem;
}

.footer__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-white);
  font-weight: 600;
}

.footer__logo-img {
  height: 60px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--text-white);
}

.footer__copy {
  width: 100%;
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

/* --------------------------------------------
   Animations
   -------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-animation);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--transition-slow);
}

.project-card.animate {
  opacity: 0;
  transform: translateY(40px);
}

.project-card.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------
   Responsive
   -------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1.5rem;
  }

  .nav {
    padding: 1rem;
  }

  .nav__links {
    display: none;
  }

  .hero {
    padding: 7rem 1.5rem 3rem;
  }

  .project-card__image {
    height: 200px;
  }

  .project-card__content {
    padding: 1.5rem;
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* --------------------------------------------
   Utility Classes
   -------------------------------------------- */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}
