/* ==========================================================================
   FORGE FIRST - MASTER DESIGN SYSTEM & LAYOUT ENGINE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Strict Palette: No high-contrast neon or overused purple gradients */
  --bg-dark: #0A0D14;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  --primary-navy: #0F172A;
  --accent-cyan: #00E5FF;
  --accent-blue: #1E40AF;
  --accent-blue-glow: rgba(37, 99, 235, 0.15);
  
  /* Neutral scale */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dark: #64748B;
  
  /* Borders, Lines & Layout Utilities */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(0, 229, 255, 0.5);
  --glass-blur: blur(20px);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Structural Tokens */
  --section-pad: 140px 0;
  --border-radius-lg: 20px;
  --border-radius-md: 10px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Core Adjustments */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1.08; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15; margin-bottom: 1.5rem; }
h3 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

p { color: var(--text-muted); font-size: 1.1rem; font-weight: 400; }
p.lead { font-size: 1.25rem; color: var(--text-muted); max-width: 650px; margin: 0 auto; }

/* Structural Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Layout Utilities & Asymmetry Settings */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.align-center { align-items: center; }
.text-center { text-align: center; }
.asymmetric-reverse { direction: rtl; }
.asymmetric-reverse > * { direction: ltr; }

/* Buttons & Navigation Anchors */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.4s var(--ease-out-expo);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.12);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Navigation Architecture */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 90;
  padding: 24px 0;
  transition: padding 0.3s var(--ease-out-expo), background 0.3s ease;
}

header.scrolled {
  padding: 16px 0;
  background: rgba(10, 13, 20, 0.75);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
}

/* Mobile Menu Toggle Button */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 100;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Interactive Components (Glass Panels) */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 48px;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out-expo), border-color 0.5s ease, box-shadow 0.5s ease;
}

.glass-panel:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Subtle Glowing Indicators */
.glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* Hero Context & Ambient Light */
.hero-wrapper {
  padding: 220px 0 120px 0;
  position: relative;
}

.ambient-glow {
  position: absolute;
  width: 800px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-blue-glow) 0%, rgba(10, 13, 20, 0) 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}

/* Portfolio Work Showcase Cards */
.work-showcase {
  margin-top: 64px;
}

.work-item {
  height: 480px;
  border-radius: var(--border-radius-lg);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 40px;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.work-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,13,20,0) 30%, rgba(10,13,20,0.95) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

.work-content {
  position: relative;
  z-index: 2;
  transform: translateY(10px);
  transition: transform 0.4s var(--ease-out-expo);
}

.work-item:hover .work-content {
  transform: translateY(0);
}

/* Service Specifications Grid Alignment */
.service-feature-list {
  list-style: none;
  margin-top: 24px;
}

.service-feature-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.service-feature-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

/* Interactive Pricing Tiers */
.price-card {
  display: flex;
  flex-direction: column;
}

.price-card.popular {
  border-color: rgba(0, 229, 255, 0.25);
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
}

.price-tag {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.04em;
  margin: 24px 0;
}

.price-tag span {
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 400;
  letter-spacing: 0;
}

/* Clean Form Component Blocks */
.form-section { padding: var(--section-pad); background: rgba(255,255,255,0.005); }
.form-container { max-width: 680px; margin: 0 auto; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.form-group { margin-bottom: 28px; }

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 18px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s var(--ease-out-expo);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 4px var(--border-focus);
}

/* Accordion Interaction Framework */
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding: 24px 0;
}

.faq-trigger {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 500;
}

.faq-icon {
  font-size: 1.5rem;
  color: var(--text-dark);
  transition: transform 0.3s ease;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out-expo);
}

.faq-content p {
  padding-top: 16px;
  font-size: 1rem;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--accent-cyan);
}

/* Scroll Animation Hooks via JS */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Global Footer Alignment */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 100px 0 40px 0;
  background: #080A0F;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 64px;
  margin-bottom: 80px;
}

.footer-column ul { list-style: none; }
.footer-column ul li { margin-bottom: 14px; }
.footer-column ul li a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; font-size: 0.95rem; }
.footer-column ul li a:hover { color: var(--text-main); }

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 80;
  backdrop-filter: var(--glass-blur);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Responsive Structural Breakpoints */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr repeat(2, 1fr); gap: 40px; }
}

@media (max-width: 768px) {
  :root { --section-pad: 90px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 32px; }
  .mobile-toggle { display: block; }
  
  .nav-links {
    position: fixed;
    top: 0; right: -100%; width: 80%; height: 100vh;
    background: #0A0D14;
    border-left: 1px solid var(--border-subtle);
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    transition: right 0.4s var(--ease-out-expo);
    z-index: 99;
  }
  
  .nav-links.active { right: 0; }
  .form-grid-2 { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* Accessibility: Reduced Motion Custom Overrides */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}