:root {
  --primary: #d4af37;
  --secondary: #f5d06f;
  --accent: #b8860b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Space Grotesk", sans-serif;
}

.header-logo {
  width: 210px;
  max-width: 55vw;
  height: auto;
}

@media (min-width: 768px) {
  .header-logo {
    width: 250px;
    max-width: none;
  }
}

/* Grain Overlay */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Gradient Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Text Scramble Effect */
.scramble-text {
  display: inline-block;
}

/* Magnetic Button */
.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50px;
  font-weight: 600;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.magnetic-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.15);
}

.magnetic-btn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 5px 12px rgba(212, 175, 55, 0.1);
}

.magnetic-btn .submit-label {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.magnetic-btn.has-submit-icon {
  gap: 0.5rem;
}

.magnetic-btn .submit-icon {
  flex-shrink: 0;
}

.magnetic-btn.is-submitting {
  opacity: 0.8;
  cursor: wait;
}

.magnetic-btn.is-submit-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.magnetic-btn::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: left 0.5s;
}

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

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card:hover {
  transform: translateY(-10px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  animation: marquee 30s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* Navigation */
.nav-link {
  position: relative;
  overflow: hidden;
}

.site-nav {
  transition: transform 0.35s ease, background-color 0.35s ease,
    backdrop-filter 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.site-nav.nav-hidden {
  transform: translateY(-100%);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: white;
  transform: translateX(-105%);
  transition: transform 0.3s;
}

.nav-link:hover::after {
  transform: translateX(0);
}

/* Project Card */
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.project-card img {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card:hover img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.stock-card:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 10001;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-panel {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 88vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s ease;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-prev svg,
.lightbox-next svg {
  width: 24px;
  height: 24px;
}

/* Horizontal Scroll Section */
.horizontal-section {
  display: flex;
  flex-wrap: nowrap;
  width: fit-content;
}

/* Stats Counter */
.stat-number {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}

.stat-suffix {
  font-size: 0.7em;
}

.instagram-shell {
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(8, 8, 8, 0.92);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28);
}

.instagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.instagram-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.instagram-avatar-ring {
  width: 88px;
  height: 88px;
  padding: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  flex-shrink: 0;
}

.instagram-avatar {
  width: 100%;
  height: 100%;
  padding: 4px;
  border-radius: 999px;
  background: #090909;
}

.instagram-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.instagram-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 999px;
  background: #0ea5e9;
  color: white;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}

.instagram-follow:hover {
  transform: translateY(-1px);
  background: #0284c7;
}

.machine-shell {
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(8, 8, 8, 0.92);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28);
}

.machine-carousel-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  text-align: center;
}

.machine-carousel-viewport {
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.machine-carousel-viewport.is-native-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.machine-carousel-viewport.is-native-scroll::-webkit-scrollbar {
  display: none;
}

.machine-carousel-marquee {
  display: flex;
  gap: 20px;
  width: max-content;
  will-change: transform;
}

.machine-carousel-track {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.machine-carousel-track-clone {
  display: none;
}

.machine-carousel-marquee.is-ready .machine-carousel-track-clone {
  display: flex;
}

.machine-carousel-viewport.is-dragging {
  cursor: grabbing;
}

.machine-carousel-viewport.is-native-scroll .machine-carousel-marquee {
  transform: none !important;
}

.machine-carousel-viewport.is-native-scroll .machine-carousel-track-clone {
  display: none !important;
}

.machine-card {
  width: min(340px, 78vw);
  flex: 0 0 auto;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.machine-card-wide {
  width: min(540px, 88vw);
  aspect-ratio: auto;
}

.machine-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 208, 111, 0.45);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.machine-card:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 4px;
}

.machine-card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.machine-card:hover .machine-card-media {
  transform: scale(1.03);
}

.machine-card .project-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.machine-card:hover .project-overlay,
.machine-card:focus-visible .project-overlay {
  opacity: 1;
}

.machine-card-kicker {
  color: rgba(245, 208, 111, 0.8);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  margin-bottom: 8px;
  white-space: nowrap;
}

.machine-card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

/* Form Input Animation */
.input-group {
  position: relative;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  outline: none;
  transition: all 0.3s;
}

.input-group label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: all 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group input:not(:placeholder-shown),
.input-group textarea:not(:placeholder-shown) {
  border-color: var(--primary);
}

.input-group input:focus+label,
.input-group textarea:focus+label,
.input-group input:not(:placeholder-shown)+label,
.input-group textarea:not(:placeholder-shown)+label {
  top: -10px;
  left: 12px;
  font-size: 12px;
  background: #0a0a0a;
  padding: 0 4px;
  color: var(--primary);
}

.input-group.invalid input,
.input-group.invalid textarea {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.45);
}

.input-group.invalid label {
  color: #f5d06f;
}

.field-error {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #f5d06f;
  letter-spacing: 0.02em;
}

.form-feedback {
  min-height: 3.4em;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.form-feedback.is-success {
  color: #34d399;
}

.form-feedback.is-error {
  color: #fca5a5;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-text {
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.loader-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  animation: load 2s ease-in-out forwards;
}

@keyframes load {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-size: 2rem;
  margin: 1rem 0;
  opacity: 0;
  transform: translateY(20px);
}

.mobile-menu.active a {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s;
}

@media (max-width: 767px) {
  .instagram-shell {
    padding: 22px;
  }

  .machine-shell {
    padding: 22px;
  }

  .instagram-header,
  .instagram-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .machine-carousel-viewport {
    cursor: auto;
    touch-action: pan-x;
  }

  .machine-carousel-viewport.is-native-scroll {
    padding-bottom: 8px;
  }

  .machine-card {
    width: min(300px, 82vw);
    scroll-snap-align: start;
  }

  .machine-card-wide {
    width: min(420px, 92vw);
  }
}