:root {
  --primary: #3d4094;
  --accent: #ed3338;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --bg-body: #ffffff;
  --bg-alt: #f8fafc;
  --white: #ffffff;
  --border-light: rgba(229, 231, 235, 0.5);
  --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  --nav-height: 80px;
}

/* --- Reset & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  scroll-behavior: auto !important;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html.lenis,
html.lenis body {
  height: auto;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  all: unset;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  position: relative;
}

.logo-img {
  width: 6rem;
  margin-top: 8px;
}

.desktop-menu {
  display: none;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: #4b5563;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
  position: relative;
  cursor: pointer;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #3d4094;
  transition: width 0.3s;
}

.nav-link:hover {
  color: #3d4094;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  color: #4b5563;
  font-size: 28px;
  display: flex;
  z-index: 101;
}

@media (min-width: 1200px) {
  .desktop-menu {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .mobile-menu-btn {
    display: none;
  }
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--nav-height));
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 99;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 30px 20px;
  border-top: 1px solid #e5e7eb;
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-link {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  padding: 16px 20px;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  margin-bottom: 12px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* --- Video Header --- */
.video-header {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #000;
}

.video-header video {
  object-fit: cover;
  object-position: top center;
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

/* --- Machine Sections --- */
.machine-section {
  padding: 60px 0;
  background-color: var(--white);
  position: relative;
}

@media (min-width: 768px) {
  .machine-section {
    padding: 100px 0;
  }
}

@media (min-width: 1024px) {
  .machine-section {
    padding: 140px 0;
  }
}

.machine-section.alt-bg {
  background-color: var(--bg-alt);
  background-image: radial-gradient(
    circle at 2px 2px,
    #e2e8f0 1px,
    transparent 0
  );
  background-size: 32px 32px;
}

.machine-name {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 12px;
  display: block;
  text-align: center;
  font-weight: 600;
}

.machine-spec-title {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 30px;
  text-align: center;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.5px;
}

.machine-image-wrapper {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 1150px;
  margin: 0 auto 40px;
  background: #f1f5f9;
}

@media (min-width: 768px) {
  .machine-image-wrapper {
    border-radius: 40px;
    margin-bottom: 60px;
  }
}

.machine-image-wrapper:hover {
  transform: scale(1.015) translateY(-5px);
}

.machine-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.machine-description {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 950px;
  margin: 0 auto;
  text-align: center;
}

.machine-description p {
  margin-bottom: 20px;
}

/* --- Tech Cards --- */
.tech-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .tech-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 60px;
  }
}

.tech-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .tech-card {
    padding: 45px;
    border-radius: 32px;
  }
}

.tech-card:hover {
  border-color: var(--primary);
  background: var(--white);
  transform: translateY(-5px);
}

.tech-card h4 {
  font-family: "Fredoka", sans-serif;
  color: var(--primary);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tech-card h4 i {
  color: var(--accent);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.tech-list {
  list-style: none;
  text-align: left;
}

.tech-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .tech-list li {
    padding-left: 32px;
    margin-bottom: 16px;
    font-size: 1.05rem;
  }
}

.tech-list li::before {
  content: "\e9b5";
  font-family: "Phosphor";
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--accent);
  font-size: 18px;
  font-weight: bold;
}

/* --- Footer --- */
.footer-section {
  background-color: #1f2937;
  color: #f3f4f6;
  padding: 60px 0 30px 0;
  font-family: "Roboto", sans-serif;
  margin-top: auto;
}

@media (min-width: 768px) {
  .footer-section {
    padding: 80px 0 30px 0;
  }
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-bottom: 60px;
  }
}

.footer-col h3 {
  color: #ffffff;
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: #ed3338;
  border-radius: 2px;
}

/* Fixed stretch by adding height: auto and object-fit */
.footer-logo img {
  width: 6rem;
  height: auto;
  object-fit: contain;
}

.footer-about-text {
  color: #9ca3af;
  line-height: 1.7;
  font-size: 0.95rem;
  max-width: 300px;
  margin-top: 15px;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #d1d5db;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: #ed3338;
  padding-left: 5px;
}

.footer-contact {
  list-style: none;
  padding: 0;
}

.footer-contact li {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  color: #d1d5db;
  align-items: flex-start;
  font-size: 0.9rem;
}

.footer-contact i {
  color: #ed3338;
  font-size: 1.3rem;
  margin-top: 2px;
}

.footer-contact span {
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 25px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* --- Scroll To Top Button --- */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #3d4094;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(61, 64, 148, 0.3);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background-color: #ed3338;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(237, 51, 56, 0.4);
}

@media (max-width: 768px) {
  .scroll-top-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 1199px) {
  :root {
    --nav-height: 70px;
  }

  body {
    padding-top: var(--nav-height);
  }

  .nav-content {
    height: var(--nav-height);
  }

  .mobile-menu {
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
  }
}
