/* ============================================
   ELFC — Main Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0b1121;
  --bg-secondary: #111a2e;
  --bg-card: #141d2f;
  --bg-card-hover: #192540;
  --border: #1e2a42;
  --border-light: #253352;
  --accent: #4f8fff;
  --accent-hover: #6ba1ff;
  --accent-glow: rgba(79, 143, 255, 0.15);
  --cta: #06d6a0;
  --cta-hover: #0ae8b0;
  --cta-glow: rgba(6, 214, 160, 0.15);
  --text: #e1e7ef;
  --text-muted: #7a8ba8;
  --text-heading: #f0f4f8;
  --danger: #ef4444;
  --success: #06d6a0;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --max-width: 1200px;
  --header-height: 72px;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ebeef3;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f7;
  --border: #d8dde6;
  --border-light: #c5ccd8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --cta: #059669;
  --cta-hover: #047857;
  --cta-glow: rgba(5, 150, 105, 0.1);
  --text: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.mono {
  font-family: var(--font-mono);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section-sm {
  padding: 60px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

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

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* --- Section Headers --- */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 4px 12px;
  background: var(--accent-glow);
  border-radius: 4px;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
}

.section-header {
  margin-bottom: 56px;
}

.section-header.centered {
  text-align: center;
}

.section-header.centered .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--cta);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--cta-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--cta-glow);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
}

.btn-ghost:hover {
  color: var(--accent-hover);
}

.btn-ghost .arrow {
  transition: transform var(--transition);
}

.btn-ghost:hover .arrow {
  transform: translateX(4px);
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(11, 17, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              right 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
  top: 8px;
  left: clamp(12px, 4vw, 80px);
  right: clamp(12px, 4vw, 80px);
  border-radius: 999px;
  background: rgba(11, 17, 33, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .site-header {
  background: rgba(245, 247, 250, 0.88);
}

[data-theme="light"] .site-header.scrolled {
  background: rgba(245, 247, 250, 0.94);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-links {
  background: var(--bg-primary);
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding var(--transition);
}

.scrolled .header-inner {
  padding: 0 32px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 3px;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  padding: 8px 20px !important;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 255, 0.3);
  border-radius: var(--radius);
  color: var(--accent) !important;
  font-weight: 500;
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  background: rgba(79, 143, 255, 0.2) !important;
  border-color: var(--accent);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg canvas {
  width: 100%;
  height: 100%;
}

.hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 24px;
  padding: 6px 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: 20px;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--cta);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin-bottom: 24px;
  font-weight: 700;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 560px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Stat Bar --- */
.stat-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.stat-bar .container {
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  padding-bottom: 40px;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}

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

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.card-link:hover .arrow {
  transform: translateX(4px);
}

.card-link .arrow {
  transition: transform var(--transition);
}

/* --- Service Detail Cards --- */
.service-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
}

.service-detail:last-child {
  margin-bottom: 0;
}

.service-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.service-detail-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: var(--radius);
  font-size: 1.5rem;
}

.service-detail h3 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.service-detail .service-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.service-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.flow-step {
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flow-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.flow-label.problem { color: #f59e0b; }
.flow-label.solution { color: var(--accent); }
.flow-label.outcome { color: var(--cta); }

.flow-step p {
  font-size: 0.9rem;
  color: var(--text);
}

.service-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

/* --- About Page --- */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-intro-text h2 {
  margin-bottom: 20px;
}

.about-intro-text p {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-visual {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.about-visual .code-block {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.about-visual .code-block .key {
  color: var(--accent);
}

.about-visual .code-block .value {
  color: var(--cta);
}

.about-visual .code-block .bracket {
  color: var(--text-muted);
}

.about-visual .code-block .comment {
  color: #4a5568;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.value-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.value-card h4 {
  margin-bottom: 10px;
  color: var(--text-heading);
}

.value-card p {
  font-size: 0.95rem;
}

/* --- CTA Section --- */
.cta-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 16px;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}

.contact-info h2 {
  margin-bottom: 16px;
}

.contact-info > p {
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-detail-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}

.contact-detail h4 {
  margin-bottom: 4px;
}

.contact-detail p {
  font-size: 0.9rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #4a5568;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-group.error input,
.form-group.error textarea {
  border-color: var(--danger);
}

.form-group .error-msg {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-group.error .error-msg {
  display: block;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.form-success {
  text-align: center;
  padding: 40px 20px;
  display: none;
}

.form-success.show {
  display: block;
}

.form-success .check-icon {
  width: 60px;
  height: 60px;
  background: var(--cta-glow);
  border: 2px solid var(--cta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
}

.form-success h3 {
  margin-bottom: 8px;
}

/* --- Floating Contact Button & Panel --- */
.floating-contact-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cta);
  color: #0b1121;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(6, 214, 160, 0.3);
  transition: all var(--transition);
}

.floating-contact-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(6, 214, 160, 0.4);
}

.floating-contact-btn.active {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.contact-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.contact-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

.contact-panel {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 1001;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 32px 28px;
}

.contact-panel.open {
  right: 0;
}

.contact-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.contact-panel-header h3 {
  font-size: 1.3rem;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
  line-height: 1;
}

.panel-close:hover {
  color: var(--text);
}

.contact-panel > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* --- Blog --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.blog-card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.blog-card-meta span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.blog-card-meta .category {
  color: var(--accent);
}

.blog-card h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.blog-card h3 a {
  color: var(--text-heading);
  text-decoration: none;
}

.blog-card h3 a:hover {
  color: var(--accent);
}

.blog-card p {
  font-size: 0.9rem;
  flex-grow: 1;
}

.blog-card .card-link {
  margin-top: auto;
  padding-top: 16px;
}

/* Blog Layout with Sidebar */
.blog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.blog-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 32px);
}

.blog-sidebar-section {
  margin-bottom: 32px;
}

.blog-sidebar-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.blog-sidebar-section ul li {
  margin-bottom: 4px;
}

.blog-sidebar-section ul a {
  display: block;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.blog-sidebar-section ul a:hover,
.blog-sidebar-section ul a.active {
  color: var(--text);
  background: var(--bg-card);
}

.blog-sidebar-section ul a.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 500;
}

.blog-filter-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 4px 8px 0;
  cursor: pointer;
  transition: all var(--transition);
}

.blog-filter-tag:hover,
.blog-filter-tag.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.blog-main .blog-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .blog-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }

  .blog-sidebar-section {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
  }
}

/* Blog Post */
.blog-post {
  max-width: 760px;
  margin: 0 auto;
}

.blog-post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.blog-post-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.blog-post-header .back-link:hover {
  color: var(--accent);
}

.blog-post-header h1 {
  margin-bottom: 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.blog-post-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.blog-post-body {
  font-size: 1.05rem;
  line-height: 1.9;
}

.blog-post-body h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.blog-post-body h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.blog-post-body p {
  margin-bottom: 20px;
  color: var(--text);
}

.blog-post-body ul,
.blog-post-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.blog-post-body ul {
  list-style: disc;
}

.blog-post-body ol {
  list-style: decimal;
}

.blog-post-body li {
  margin-bottom: 8px;
  color: var(--text);
}

.blog-post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.blog-post-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.blog-post-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.blog-post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 28px 0;
  color: var(--text-muted);
  font-style: italic;
}

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

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

.footer-brand .logo {
  display: inline-block;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-nav h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-nav ul li {
  margin-bottom: 10px;
}

.footer-nav ul a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-nav ul a:hover {
  color: var(--text);
}

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

/* --- Page Banner --- */
.page-banner {
  padding: 140px 0 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.page-banner h1 {
  margin-bottom: 12px;
}

.page-banner p {
  font-size: 1.1rem;
  max-width: 560px;
}

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

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .about-intro {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .service-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 24px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .blog-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    text-align: center;
    justify-content: center;
  }

  .stat-bar .container {
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat-item {
    min-width: 45%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

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

  .section {
    padding: 60px 0;
  }

  .contact-panel {
    width: 100vw;
  }

  .service-detail {
    padding: 28px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .stat-item {
    min-width: 100%;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
}

/* --- Light Theme Overrides --- */
[data-theme="light"] .floating-contact-btn {
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .floating-contact-btn.active {
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .about-visual .code-block .comment {
  color: #94a3b8;
}

[data-theme="light"] .form-group input::placeholder,
[data-theme="light"] .form-group textarea::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .hero-gradient {
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

[data-theme="light"] .contact-panel {
  background: var(--bg-primary);
}

[data-theme="light"] .contact-panel-overlay {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .nav-cta {
  background: var(--accent-glow);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent) !important;
}

[data-theme="light"] .nav-cta:hover {
  background: rgba(37, 99, 235, 0.15) !important;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
