/* ═══════════════════════════════════════════════════════════════════════════
   BibitStudio — Official Studio & Portfolio Design System
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Brand Accents */
  --brand-primary: #2E7CFC;
  --brand-secondary: #609BFD;
  --brand-gradient: linear-gradient(135deg, #609BFD 0%, #2E7CFC 60%, #1D4ED8 100%);
  --brand-gradient-hover: linear-gradient(135deg, #93C5FD 0%, #3B82F6 50%, #1D4ED8 100%);
  --brand-glow: 0 12px 40px -8px rgba(46, 124, 252, 0.35);

  /* Dark Theme Surfaces (Default) */
  --bg-main: #070F1C;
  --bg-subtle: #0F1D2E;
  --bg-card: rgba(19, 32, 50, 0.85);
  --bg-card-hover: rgba(25, 46, 82, 0.9);
  --bg-glass: rgba(15, 29, 46, 0.85);
  --bg-pill: rgba(255, 255, 255, 0.06);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: #192E52;
  --border-hover: rgba(96, 155, 253, 0.4);

  /* Text Colors */
  --text-white: #FFFFFF;
  --text-primary: #EFF6FF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #609BFD;

  /* Typography */
  --font-main: 'Inter', system-ui, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Layout */
  --max-w: 1180px;
  --header-h: 74px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px -8px rgba(0, 0, 0, 0.5);
}

/* Light Theme */
[data-theme="light"] {
  --brand-primary: #2E7CFC;
  --brand-secondary: #2E7CFC;
  --brand-gradient: linear-gradient(135deg, #609BFD 0%, #2E7CFC 60%, #1D4ED8 100%);
  --brand-gradient-hover: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  --brand-glow: 0 12px 40px -8px rgba(46, 124, 252, 0.2);

  --bg-main: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-card: #F5F8FA;
  --bg-card-hover: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-pill: rgba(46, 124, 252, 0.08);

  --border-subtle: #E2E8F0;
  --border-card: #E2E8F0;
  --border-hover: rgba(46, 124, 252, 0.4);

  --text-white: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-accent: #2E7CFC;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px -8px rgba(0, 0, 0, 0.08);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glow Wrapper (Strict Overflow Barrier) */
.bg-glow-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Background Glow Orbs (GPU Accelerated, No Repaint Glitch) */
.bg-glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

[data-theme="light"] .bg-glow-orb { opacity: 0.2; }

.orb-1 {
  top: -80px;
  left: 25%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle closest-side, rgba(0, 198, 255, 0.35) 0%, rgba(0, 102, 255, 0.12) 60%, transparent 100%);
}

.orb-2 {
  top: 700px;
  right: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle closest-side, rgba(139, 92, 246, 0.25) 0%, rgba(0, 102, 255, 0.08) 60%, transparent 100%);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-white);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-accent);
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 50px auto;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #FFFFFF !important;
  box-shadow: var(--brand-glow);
}

.btn-primary:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -4px rgba(0, 102, 255, 0.45);
}

.btn-outline {
  background: var(--bg-pill);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(0, 102, 255, 0.1);
  border-color: var(--brand-secondary);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 15px 34px;
  font-size: 1.05rem;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transform: translateZ(0);
  will-change: background-color, border-color, box-shadow;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.3);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.03em;
}

.brand-title span {
  color: var(--brand-secondary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-white);
}

.mobile-only-item {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(0, 102, 255, 0.12);
  color: var(--text-white);
}

/* Hero */
.hero {
  padding-top: calc(var(--header-h) + 70px);
  padding-bottom: 80px;
  text-align: center;
}

.hero-inner {
  max-width: 840px;
  margin: 0 auto;
}

.hero-headline {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-subheadline {
  font-size: 1.18rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Featured App Spotlight Card (ShareBy) */
.featured-section {
  padding: 40px 0 80px 0;
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--brand-gradient);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 102, 255, 0.15);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.featured-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.featured-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tag-item {
  padding: 6px 12px;
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.featured-visual {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.15) 0%, rgba(0, 198, 255, 0.08) 100%);
  border: 1px solid rgba(0, 198, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.featured-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
  margin-bottom: 16px;
}

/* Services / Tech Grid */
.services-section {
  padding: 80px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 18px;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
}

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

/* Creator About */
.about-section {
  padding: 80px 0;
  border-top: 1px solid var(--border-subtle);
}

.about-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 36px;
}

.about-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
}

.about-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.about-role {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-secondary);
  margin-bottom: 12px;
}

.about-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 32px 0;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 16px;
  max-width: 320px;
  line-height: 1.6;
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--brand-secondary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal-links {
  display: flex;
  gap: 20px;
}

.footer-theme-toggle {
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.footer-theme-toggle:hover {
  color: var(--text-white);
  border-color: var(--brand-secondary);
  background: var(--bg-pill);
}

/* Footer Language Selector */
.footer-lang-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  transition: all 0.2s ease;
}

.footer-lang-selector:hover {
  border-color: var(--brand-secondary);
}

.footer-lang-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.footer-lang-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.footer-lang-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Responsive */
.mobile-toggle {
  display: none;
}

@media (max-width: 860px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding: 0 16px;
  }

  /* Top Bar Fix - Prevents Truncation & Clamping on Mobile */
  .nav-actions .btn {
    display: none;
  }

  .nav-actions {
    gap: 8px;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-pill);
    border: 1px solid var(--border-subtle);
    color: var(--text-white);
    cursor: pointer;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 20px 20px 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    gap: 4px;
  }

  .nav-menu.open {
    display: flex;
    animation: fadeInSlide 0.25s ease-out;
  }

  .nav-link {
    display: block;
    padding: 12px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
  }

  .mobile-only-item {
    display: block !important;
    width: 100%;
    margin-top: 8px;
  }

  .hero-inner {
    text-align: center;
    margin: 0 auto;
  }

  .hero-headline {
    text-align: center;
  }

  .hero-subheadline {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .hero-cta-row {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .featured-card {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .featured-tags {
    justify-content: center;
  }

  .featured-card > div:first-child > div:last-child {
    justify-content: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-box {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .footer-bottom-actions {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .footer-legal-links {
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }

  .footer-brand-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-links-list {
    align-items: center;
  }
  .hero-headline {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .hero-subheadline {
    font-size: 0.95rem;
  }

  .hero-cta-row {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-row .btn {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
  }

  .featured-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .featured-title {
    font-size: 1.4rem;
  }

  .featured-tags {
    gap: 6px;
  }

  .tag-item {
    font-size: 0.74rem;
    padding: 4px 10px;
  }

  .about-avatar {
    width: 72px;
    height: 72px;
  }
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
