/* ============================================
   MEZENSKY CLOUD — Landing Page
   Design System: Tesla-inspired
   ============================================ */

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

:root {
  /* Tesla Color System */
  --electric-blue: #3E6AE1;
  --electric-blue-hover: #3560d0;
  --pure-white: #FFFFFF;
  --light-ash: #F4F4F4;
  --carbon-dark: #171A20;
  --graphite: #393C41;
  --pewter: #5C5E62;
  --silver-fog: #8E8E8E;
  --cloud-gray: #EEEEEE;
  --pale-silver: #D0D1D2;
  --frosted-glass: rgba(255, 255, 255, 0.75);

  /* Typography */
  --font-display: 'Inter', -apple-system, Arial, sans-serif;
  --font-text: 'Inter', -apple-system, Arial, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Transitions */
  --transition-default: 0.33s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  color: var(--graphite);
  background-color: var(--pure-white);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-default);
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-2xl);
  background: transparent;
  transition: background-color var(--transition-default), backdrop-filter var(--transition-default);
}

.nav--scrolled {
  background: var(--frosted-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--pure-white);
  transition: color var(--transition-default);
  cursor: pointer;
}

.nav--scrolled .nav__logo {
  color: var(--carbon-dark);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--pure-white);
  padding: var(--space-xs) var(--space-md);
  border-radius: 4px;
  transition: background-color var(--transition-default), color var(--transition-default);
  cursor: pointer;
  white-space: nowrap;
}

.nav--scrolled .nav__link {
  color: var(--carbon-dark);
}

.nav__link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.nav--scrolled .nav__link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--pure-white);
  transition: background-color var(--transition-default), transform var(--transition-default);
}

.nav--scrolled .nav__hamburger span {
  background: var(--carbon-dark);
}

/* --- Mobile Nav Overlay --- */
.nav-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--pure-white);
  z-index: 200;
  transition: right var(--transition-default);
  display: flex;
  flex-direction: column;
  padding: var(--space-3xl) var(--space-2xl);
}

.nav-overlay--open {
  right: 0;
}

.nav-overlay__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-2xl);
  background: none;
  border: none;
  font-size: 28px;
  color: var(--carbon-dark);
  cursor: pointer;
  padding: var(--space-sm);
  line-height: 1;
}

.nav-overlay__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.nav-overlay__link {
  font-size: 22px;
  font-weight: 500;
  color: var(--carbon-dark);
  transition: color var(--transition-default);
}

.nav-overlay__link:hover {
  color: var(--electric-blue);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(23, 26, 32, 0.35) 0%,
    rgba(23, 26, 32, 0.15) 40%,
    rgba(23, 26, 32, 0.45) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pure-white);
  letter-spacing: normal;
}

.hero__subtitle {
  font-family: var(--font-text);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
}

.hero__cta-group {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 4px;
  min-height: 40px;
  padding: var(--space-xs) var(--space-xl);
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-default),
              background-color var(--transition-default),
              color var(--transition-default),
              box-shadow 0.25s;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--electric-blue);
  color: var(--pure-white);
  min-width: 200px;
}

.btn--primary:hover {
  background-color: var(--electric-blue-hover);
}

.btn--secondary {
  background-color: var(--pure-white);
  color: var(--graphite);
  min-width: 160px;
}

.btn--secondary:hover {
  background-color: var(--light-ash);
}

/* --- Scroll Indicator --- */
.hero__scroll {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  animation: scrollPulse 2s ease-in-out infinite;
}

.hero__scroll-icon {
  width: 24px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  position: relative;
}

.hero__scroll-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes scrollDot {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 0.3; }
}

/* --- Section Intro --- */
.section-intro {
  padding: var(--space-4xl) var(--space-2xl);
  text-align: center;
  background-color: var(--pure-white);
}

.section-intro__label {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 500;
  color: var(--electric-blue);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.section-intro__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--carbon-dark);
  margin-bottom: var(--space-md);
}

.section-intro__description {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pewter);
  max-width: 520px;
  margin: 0 auto;
}

/* --- Tools Grid --- */
.tools {
  padding: 0 var(--space-2xl) var(--space-4xl);
  background-color: var(--pure-white);
}

.tools__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 1383px;
  margin: 0 auto;
}

/* --- Tool Card --- */
.tool-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform var(--transition-default);
}

.tool-card:hover {
  /* Tesla avoids scale/translate transforms on hover — color only */
}

.tool-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-default);
}

.tool-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(23, 26, 32, 0.1) 0%,
    rgba(23, 26, 32, 0.65) 100%
  );
  transition: background var(--transition-default);
}

.tool-card:hover .tool-card__overlay {
  background: linear-gradient(
    180deg,
    rgba(23, 26, 32, 0.15) 0%,
    rgba(23, 26, 32, 0.75) 100%
  );
}

.tool-card__content {
  position: relative;
  z-index: 2;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tool-card__category {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
}

.tool-card__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--pure-white);
  line-height: 1.18;
}

.tool-card__description {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.43;
  max-width: 380px;
}

.tool-card__links {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.tool-card__link {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition-default);
  position: relative;
}

.tool-card__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--pure-white);
  transition: width var(--transition-default);
}

.tool-card__link:hover {
  color: var(--pure-white);
}

.tool-card__link:hover::after {
  width: 100%;
}

/* --- Featured card (full-width) --- */
.tool-card--featured {
  grid-column: 1 / -1;
  aspect-ratio: 3 / 1;
}

/* --- Footer --- */
.footer {
  background-color: var(--pure-white);
  border-top: 1px solid var(--cloud-gray);
  padding: var(--space-2xl) var(--space-2xl);
}

.footer__inner {
  max-width: 1383px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--carbon-dark);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer__link {
  font-size: 14px;
  font-weight: 400;
  color: var(--pewter);
  transition: color var(--transition-default);
}

.footer__link:hover {
  color: var(--carbon-dark);
}

.footer__copy {
  font-size: 12px;
  color: var(--silver-fog);
  width: 100%;
  text-align: center;
  margin-top: var(--space-md);
}

/* --- Fade-in animations (scroll-triggered) --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
  .tools__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-card--featured {
    aspect-ratio: 2 / 1;
  }

  .hero__title {
    font-size: 34px;
  }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav {
    padding: var(--space-md) var(--space-lg);
  }

  .hero__title {
    font-size: 28px;
  }

  .hero__subtitle {
    font-size: 18px;
    padding: 0 var(--space-md);
  }

  .hero__cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn--primary,
  .btn--secondary {
    min-width: 260px;
  }

  .tools__grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .tools {
    padding: 0 var(--space-md) var(--space-3xl);
  }

  .tool-card,
  .tool-card--featured {
    aspect-ratio: 16 / 10;
    grid-column: auto;
  }

  .section-intro {
    padding: var(--space-3xl) var(--space-md);
  }

  .section-intro__title {
    font-size: 26px;
  }

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

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

@media (max-width: 480px) {
  .hero__title {
    font-size: 24px;
  }

  .hero__subtitle {
    font-size: 16px;
  }

  .tool-card__name {
    font-size: 15px;
  }

  .tool-card__description {
    font-size: 13px;
  }
}
