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

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Inter', Georgia, serif;
  
  --background: #ffffff;
  --foreground: #fafafa;
  --muted: #a1a1aa;
  --muted-foreground: #71717a;
  --accent: #1a1a1a;
  --accent-foreground: #fafafa;
  --border: rgba(0,0,0,0.1);
  --ring: #fafafa;
  --radius: 0.625rem;
  
  --max-w: 1400px;
  --spacing: 0.25rem;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ========== GRID OVERLAY ========== */
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.06;
}
.grid-overlay::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 120px 120px;
}

/* ========== NOISE TEXTURE ========== */
.noise::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== HEADER ========== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: all 0.5s ease;
}
.header.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 5rem;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.5rem; font-weight: 400; letter-spacing: -0.025em;
  color: var(--foreground); text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.logo span { color: #52525b; font-size: 0.65rem; font-family: var(--font-mono); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.1em; }

.nav { display: flex; gap: 2rem; align-items: center; }
.nav a {
  color: var(--muted-foreground); text-decoration: none; font-size: 0.875rem; font-weight: 400;
  transition: color 0.3s ease; position: relative;
}
.nav a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--foreground); transition: width 0.3s ease;
}
.nav a:hover { color: var(--foreground); }
.nav a:hover::after { width: 100%; }

.mobile-toggle { display: none; background: none; border: none; color: var(--foreground); cursor: pointer; font-size: 1.25rem; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
  transition: all 0.3s ease; cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary {
  background: var(--foreground); color: var(--background);
}
.btn-primary:hover { background: var(--muted); }
.btn-outline {
  background: transparent; color: var(--foreground); border: 1px solid rgba(0,0,0,0.1);
}
.btn-outline:hover { background: rgba(0,0,0,0.05); border-color: rgba(255,255,255,0.3); }
.btn-accent {
  background: var(--foreground); color: var(--background);
}

/* ========== SECTIONS ========== */
.section { position: relative; padding: 6rem 1.5rem; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }

.section-label {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.5rem;
}
.section-label::before {
  content: ''; width: 2rem; height: 1px; background: var(--muted-foreground);
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 400; line-height: 0.95; letter-spacing: -0.025em;
}

h1 { font-size: clamp(3rem, 10vw, 8rem); }
h2 { font-size: clamp(2.5rem, 5vw, 5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }

p.lead {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: #52525b; line-height: 1.5; max-width: 650px;
}

/* ========== CARDS ========== */
.card {
  border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius);
  padding: 2rem; transition: all 0.4s ease; background: transparent;
}
.card:hover {
  border-color: rgba(0,0,0,0.2);
  transform: translateY(-4px);
}

/* ========== SERVICE ROW (Optimus style) ========== */
.service-row {
  display: grid; grid-template-columns: auto 1fr; gap: 2rem;
  padding: 3rem 0; border-bottom: 1px solid rgba(0,0,0,0.1);
  align-items: center; transition: all 0.4s ease;
}
.service-row:hover .service-title { transform: translateX(8px); }
.service-num { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted-foreground); }
.service-title { transition: transform 0.5s ease; font-size: 1.5rem; font-weight: 400; }
.service-desc { color: #52525b; font-size: 1.125rem; margin-top: 0.5rem; line-height: 1.5; }

/* ========== CTA BLOCK ========== */
.cta-block {
  background: var(--foreground); color: var(--background);
  border-radius: var(--radius); padding: 4rem 3rem;
  text-align: center; margin-top: 4rem;
}
.cta-block h3 { font-size: 2rem; font-weight: 400; margin-bottom: 1rem; color: var(--background); }
.cta-block p { color: var(--muted-foreground); margin-bottom: 2rem; font-size: 1.125rem; }
.cta-block .btn { background: var(--background); color: var(--foreground); }
.cta-block .btn:hover { background: #1a1a1a; }

/* ========== FOOTER ========== */
.footer {
  border-top: 1px solid rgba(0,0,0,0.1); padding: 4rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
}
.footer h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--foreground); }
.footer a { color: var(--muted-foreground); text-decoration: none; font-size: 0.875rem; display: block; margin-bottom: 0.75rem; transition: color 0.3s ease; }
.footer a:hover { color: var(--foreground); }
.footer-bottom {
  max-width: var(--max-w); margin: 3rem auto 0; padding-top: 2rem;
  display: flex; justify-content: space-between; color: var(--muted-foreground); font-size: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs { font-size: 0.75rem; color: var(--muted-foreground); margin-bottom: 2rem; font-family: var(--font-mono); }
.breadcrumbs a { color: var(--muted-foreground); text-decoration: none; transition: color 0.3s; }
.breadcrumbs a:hover { color: var(--foreground); }
.breadcrumbs span { color: var(--foreground); }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-in {
  opacity: 0; animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* ========== MARQUEE ========== */
.marquee {
  display: flex; gap: 4rem; overflow: hidden; white-space: nowrap;
  animation: marquee 30s linear infinite;
}

/* ========== HERO METRICS ========== */
.metric { display: flex; align-items: baseline; gap: 1rem; }
.metric-value { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1; }
.metric-label { font-size: 0.875rem; color: var(--muted-foreground); }
.metric-label span { display: block; font-family: var(--font-mono); font-size: 0.75rem; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.form-input {
  width: 100%; padding: 0.875rem 1rem;
  background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius); color: var(--foreground); font-size: 0.875rem;
  transition: border-color 0.3s ease; font-family: var(--font-sans);
}
.form-input:focus { outline: none; border-color: var(--foreground); }
.form-input::placeholder { color: var(--muted-foreground); }

/* ========== TAGS ========== */
.tag {
  display: inline-block; padding: 0.25rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 9999px;
  font-size: 0.75rem; color: var(--muted-foreground); margin-right: 0.5rem; margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

/* ========== CASE CARD ========== */
.case-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1); aspect-ratio: 4/3; background: #ffffff;
}
.case-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.case-card:hover img { transform: scale(1.05); }
.case-card-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem;
}

/* ========== LINK LIST (Optimus style) ========== */
.link-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 0; border-bottom: 1px solid rgba(0,0,0,0.1);
  color: var(--foreground); text-decoration: none; font-size: 1.25rem;
  transition: all 0.3s ease;
}
.link-list a:hover { padding-left: 1rem; color: #52525b; }
.link-list a span { color: var(--muted-foreground); font-size: 0.875rem; font-family: var(--font-mono); }

/* ========== DARK SECTION (like process section) ========== */
.dark-section {
  background: var(--foreground); color: var(--background);
  position: relative; overflow: hidden;
}
.dark-section::before {
  content: ''; position: absolute; inset: 0; opacity: 0.03;
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 40px, currentColor 40px, currentColor 41px);
}

/* ========== HERO BLOB CANVAS PLACEHOLDER ========== */
.hero-blob {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 600px; height: 600px; opacity: 0.4; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: blobPulse 8s ease-in-out infinite;
}
@keyframes blobPulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 0.4; }
  50% { transform: translateY(-50%) scale(1.1); opacity: 0.3; }
}

/* ========== HORIZONTAL LINES (grid) ========== */
.grid-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.3;
}
.grid-lines .h-line {
  position: absolute; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.1);
}
.grid-lines .v-line {
  position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.1);
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-toggle { display: block; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .service-row { grid-template-columns: 1fr; gap: 1rem; }
  h1 { font-size: clamp(2.5rem, 12vw, 4rem); }
  .section { padding: 4rem 1rem; }
  .header-inner { padding: 0 1rem; }
  .hero-blob { width: 300px; height: 300px; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }
