/* ═══════════════════════════════════════════════════════════
   BLAB TECHNOLOGIES — STYLES
   Design inspired by: Stripe, Vercel, Linear
   ═══════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f5f7;
  --color-border: rgba(0, 0, 0, 0.07);
  --color-border-strong: rgba(0, 0, 0, 0.12);

  --color-text-primary: #0a0a0a;
  --color-text-secondary: #525252;
  --color-text-muted: #9ca3af;

  --color-accent: #5b4cf5;          /* purple-blue */
  --color-accent-hover: #4538d9;
  --color-accent-soft: rgba(91, 76, 245, 0.08);
  --color-accent-glow: rgba(91, 76, 245, 0.15);

  --color-green: #10b981;
  --color-green-soft: rgba(16, 185, 129, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-accent: 0 8px 32px rgba(91,76,245,0.2);

  --transition-fast: 150ms ease;
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --container-max: 1120px;
  --container-pad: clamp(1.25rem, 5vw, 2rem);
  --section-gap: clamp(5rem, 10vw, 8rem);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, textarea { font-family: inherit; }

/* ─── LAYOUT ────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--section-gap) 0;
}

.section-alt {
  background: var(--color-surface-alt);
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.section-title-centered {
  text-align: center;
  margin: 0 auto;
}

.section-sub {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 1rem auto 3.5rem;
  text-align: center;
  line-height: 1.7;
}

.gradient-text {
  background: linear-gradient(135deg, #5b4cf5 0%, #8b5cf6 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.625rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91,76,245,0.25);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border-strong);
}

.btn-ghost:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: rgba(0,0,0,0.2);
  box-shadow: var(--shadow-sm);
}

.btn-full {
  width: 100%;
}

/* ─── NAVBAR ─────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

#navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--color-accent);
  color: white;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-text-primary);
  background: rgba(0,0,0,0.04);
}

.nav-links .nav-cta {
  background: var(--color-accent);
  color: white;
  padding: 0.5rem 1.125rem;
  margin-left: 0.5rem;
}

.nav-links .nav-cta:hover {
  background: var(--color-accent-hover);
  color: white;
  box-shadow: 0 4px 12px rgba(91,76,245,0.3);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 8rem 0 5rem;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91,76,245,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,76,245,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 20%, transparent 100%);
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(91,76,245,0.1) 0%, transparent 65%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideDown 0.7s ease both;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--color-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--color-green-soft);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--color-green-soft); }
  50% { box-shadow: 0 0 0 6px var(--color-green-soft); }
}

.hero-headline {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.7s 0.1s ease both;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fadeSlideUp 0.7s 0.2s ease both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.7s 0.3s ease both;
}

.hero-scroll-hint {
  position: absolute;
  bottom: -3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  animation: fadeSlideUp 0.7s 0.6s ease both;
}

/* ─── ABOUT ──────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  align-items: start;
}

.about-body {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.stat-card {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-accent);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ─── SERVICES ───────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.service-card {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: default;
}

.service-card:hover {
  border-color: rgba(91,76,245,0.2);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(91,76,245,0.1);
  transform: translateY(-3px);
}

.service-icon {
  width: 48px;
  height: 48px;
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
  transition: all var(--transition-base);
}

.service-card:hover .service-icon {
  background: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-accent);
}

.service-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.625rem;
}

.service-desc {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ─── WORK ───────────────────────────────────────────────── */
.work-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 2.5rem;
}

.work-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(91,76,245,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.work-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--color-green-soft);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-green);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--color-green);
  border-radius: 50%;
  animation: pulse 2.5s infinite;
}

.work-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  max-width: 600px;
}

.work-desc {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 680px;
  margin-bottom: 2rem;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.375rem 0.875rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(91,76,245,0.12);
}

/* ─── TECH STACK ─────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.stack-item {
  padding: 1.75rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: default;
}

.stack-item:hover {
  border-color: rgba(91,76,245,0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.stack-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stack-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ─── CONTACT ────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: start;
}

.contact-body {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin: 1.25rem 0 2rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-accent);
  padding: 0.625rem 1rem;
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  border: 1px solid rgba(91,76,245,0.12);
  transition: all var(--transition-base);
}

.contact-email:hover {
  background: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-accent);
}

/* ─── FORM ───────────────────────────────────────────────── */
.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  resize: none;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-success {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: var(--color-green-soft);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  color: var(--color-green);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  background: var(--color-text-primary);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand .logo-mark {
  background: var(--color-accent);
}

.footer-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.footer-tagline {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.footer-copy {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  width: 100%;
  text-align: right;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-copy { text-align: left; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; gap: 0.25rem; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 1rem var(--container-pad); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero-headline { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .about-stats { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .work-card { padding: 1.75rem; }
  .contact-form { padding: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: stretch; max-width: 280px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 380px) {
  .stack-grid { grid-template-columns: 1fr; }
}

/* ─── FOCUS STYLES (ACCESSIBILITY) ──────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
