/* P-TECH CNC - Precision Engineering Theme (Vercel/Tailwind Style) */

/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #030712;
  /* Deepest blue-black */
  --bg-secondary: #0f172a;
  /* Slightly lighter for cards */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #38bdf8;
  /* Cyan/Sky blue for precision */
  --accent-dim: rgba(56, 189, 248, 0.1);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.5);
  --grid-line: rgba(255, 255, 255, 0.03);

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  /* Assuming generic mono fallback if not loaded */

  /* Spacing */
  --container-width: 1200px;
}

/* Base Styles */
body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-weight: 700;
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-accent {
  color: var(--accent);
}

.font-mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.navbar-brand:hover {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.navbar-brand span {
  color: var(--accent);
  font-family: var(--font-mono);
  transition: text-shadow 0.2s;
}

.navbar-brand:hover span {
  text-shadow: 0 0 10px var(--accent);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 6px;
}

.nav-link:hover {
  color: #ffffff !important;
  background: transparent !important;
  text-shadow: 0 0 10px var(--accent), 0 0 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* Active Nav Link - Glow Text Only */
.nav-link.active {
  color: #ffffff !important;
  background: transparent !important;
  text-shadow: 0 0 10px var(--accent), 0 0 20px rgba(56, 189, 248, 0.5);
  box-shadow: none;
  font-weight: 600;
}

/* Navbar Phone - Styled as Button */
.navbar-phone {
  font-family: var(--font-mono);
  color: var(--text-primary) !important;
  border: 1px solid var(--accent);
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.1);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.navbar-phone:hover {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  padding: 8rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hero "Glow" Effect */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1000px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 600;
}

.btn-primary:hover {
  background: #e2e8f0;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

/* Technical Label */
.tech-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1.5rem;
}

/* Bento Grid / Services */
.section {
  padding: 6rem 0;
  border-top: 1px solid var(--border-color);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.border-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.border-card:hover {
  border-color: var(--border-highlight);
}

.border-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.border-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.border-card .icon {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Stats (Precision Specs) */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-color);
  /* Grid line color */
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.spec-item {
  background: var(--bg-primary);
  /* Card bg */
  padding: 2rem;
  text-align: center;
}

.spec-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.5rem;
}

.spec-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Contact Box */
.contact-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
}

/* Glowing Border Effect (Pseudo) */
.contact-box::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 16px;
  background: linear-gradient(45deg, transparent, rgba(56, 189, 248, 0.3), transparent);
}

.phone-display {
  font-family: var(--font-mono);
  font-size: 3rem;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin: 2rem 0;
  display: block;
}

/* Footer - Tech Grid */
.footer {
  background: #020617;
  border-top: 1px solid var(--border-color);
  padding: 5rem 0 2rem;
  margin-top: 6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.text-muted {
  color: #ffffff !important;
  /* Force full white */
  opacity: 0.9;
}

.footer-col p {
  color: #ffffff;
  opacity: 0.9;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
  padding-left: 2px;
}

/* System Status Footer */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

/* CNC Milling Animation */
@keyframes spin-drill {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.cnc-spinner {
  display: inline-flex;
  color: var(--accent);
  animation: spin-drill 3s linear infinite;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-highlight);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

/* Animation Keyframes */
@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Mobile Footer */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .phone-display {
    font-size: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Work / Portfolio Grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.work-item {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.work-item:hover {
  border-color: var(--border-highlight);
}

.work-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.5s;
  opacity: 0.8;
}

.work-item:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.work-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.9) 0%, transparent 100%);
}

.work-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.work-item p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0;
}

/* HERO ENGRAVING ANIMATION */
.hero-visual-right {
  width: 100%;
  height: 400px;
  position: relative;
  /* Not absolute, sits in column */
  opacity: 0.8;
}

/* Remove old centered class if unused or keep for safety */
.hero-visual {
  display: none;
}

/* ... keep keyframes ... */

.engraving-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#engrave-path {
  stroke-dasharray: 1000;
  /* Approx length of path */
  stroke-dashoffset: 1000;
  animation: engrave 6s linear infinite;
}

#tool-head {
  offset-path: path("M50,100 L100,20 L300,20 L350,100 L300,180 L100,180 Z");
  animation: trace 6s linear infinite;
}

.spark {
  opacity: 0;
  animation: spark-flash 0.5s ease-in-out infinite alternate;
}

.s1 {
  animation-delay: 0.1s;
}

.s2 {
  animation-delay: 0.3s;
}

.s3 {
  animation-delay: 0.5s;
}

@keyframes engrave {
  0% {
    stroke-dashoffset: 1000;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes trace {
  0% {
    offset-distance: 0%;
  }

  100% {
    offset-distance: 100%;
  }
}

@keyframes spark-flash {
  0% {
    opacity: 0;
    transform: scale(1) translate(0, 0);
  }

  50% {
    opacity: 1;
    transform: scale(1.5) translate(2px, -2px);
  }

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

/* Ensure Text stays above animation */
.z-2 {
  z-index: 2;
}

/* REALISTIC CNC MILLING KEYFRAMES */

/* Path Reveal - Mimic Cutting */
/* Exact path length is approx 475px. We set 475 to sync 0-100% exactly */
#engrave-path {
  stroke-dasharray: 475;
  stroke-dashoffset: 475;
  animation: mill-cut 6s linear infinite;
}

/* Tool Movement - Precisely Matched to Block Transform (50, 50) */
#cnc-assembly {
  offset-path: path("M100,200 L150,100 L250,100 L300,200 L200,200 L200,150");
  offset-rotate: 0deg;
  animation: mill-move 6s linear infinite;
}

@keyframes mill-move {
  0% {
    offset-distance: 0%;
    transform: translate(0, -25px);
  }

  100% {
    offset-distance: 100%;
    transform: translate(0, -25px);
  }
}

@keyframes mill-cut {
  0% {
    stroke-dashoffset: 475;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* Bit Rotation */
#bit-rotation {
  transform-origin: 0 10px;
  animation: spin-bit 0.1s linear infinite;
}

@keyframes spin-bit {
  0% {
    transform: scaleX(1);
  }

  50% {
    transform: scaleX(0.2);
  }

  100% {
    transform: scaleX(1);
  }
}

/* Chips Flying */
.chip {
  opacity: 0;
  animation: chip-fly 0.3s ease-out infinite;
}

.c1 {
  animation-delay: 0.05s;
}

.c2 {
  animation-delay: 0.15s;
}

.c3 {
  animation-delay: 0.25s;
}

@keyframes chip-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx, 10px), var(--dy, -25px)) scale(0.5);
  }
}

.c1 {
  --dx: -15px;
  --dy: -30px;
}

.c2 {
  --dx: 15px;
  --dy: -35px;
}

.c3 {
  --dx: 5px;
  --dy: -20px;
}


/* Mobile Hiding */
@media (max-width: 991px) {

  /* Bootstrap LG breakpoint */
  .hero-visual-right {
    display: none;
  }
}