/* Font smoothing — improves text rendering on dark backgrounds */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar — force GPU compositing layer on Safari iOS to prevent scroll bleed-through */
#navbar {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backdrop-filter: blur(12px);
}

/* Noise overlay — pseudo-element, can't be done in Tailwind */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* Nav logo — height controls size; SVG calculates width from viewBox ratio */
.nav-logo {
  height: 32px;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .nav-logo {
    height: 20px;
  }
}
.nav-logo svg {
  height: 100%;
  width: auto;
  display: block;
}

/* clip-path on buttons — not in Tailwind core */
.btn-clip {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.btn-clip-lg {
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

/* Display font helpers */
.font-display-heavy {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.92;
}
.font-display-bold {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Crosshair pseudo-elements */
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: #e8c700;
}
.crosshair::before {
  width: 1px;
  height: 100%;
  left: 50%;
}
.crosshair::after {
  width: 100%;
  height: 1px;
  top: 50%;
}

/* Built-for card bottom border animation on hover */
.built-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #e8c700;
  transition: width 0.4s ease;
}
.built-card:hover::after {
  width: 100%;
}

/* Scroll fade animation — only when served via http */
.fade-up {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.fade-up.animate {
  opacity: 0;
  transform: translateY(24px);
}
.fade-up.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* CAD SVG canvas fill */
.cad-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}
.cad-line {
  stroke: #e8c700;
  stroke-width: 0.8;
  fill: none;
  opacity: 0.6;
}
.cad-dim {
  stroke: #666;
  stroke-width: 0.5;
  fill: none;
}
.cad-dash {
  stroke: #444;
  stroke-width: 0.5;
  fill: none;
  stroke-dasharray: 6 4;
}
.cad-text {
  fill: #666;
  font-family: monospace;
  font-size: 10px;
}

/* Mini CAD SVGs in portfolio */
.cad-mini {
  opacity: 0.4;
  transition: opacity 0.3s;
}
.portfolio-item:hover .cad-mini {
  opacity: 0.7;
}

/* FAQ accordion max-height animation */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}
.faq-icon {
  transition: transform 0.3s;
}

/* Tab panels */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Form select arrow colour fix for dark bg */
select option {
  background: #272a2f;
  color: #e8e5da;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #161719;
}
::-webkit-scrollbar-thumb {
  background: #32363d;
  border-radius: 3px;
}

.input-field {
  background: #272A2F;
  border: 1px solid #32363D;
  color: #E8E5DA;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease;
}
.input-field:focus {
  border-color: #E8C700;
}
