/* =============================================================
   DeryCode Technologies — Enterprise Sub-Page Styles
   September 2026 — Mobile-First
   Includes: enterprise design tokens + service/case-study/blog styles
============================================================= */

/* ===== DESIGN TOKENS (enterprise palette) ===== */
:root {
  --bg:           #070B14;
  --bg-secondary: #0D1424;
  --card-bg:      #111B2E;
  --card-border:  #1E293B;
  --card-hover:   #162236;
  --primary:      #4F7CFF;
  --primary-dark: #3B69E6;
  --primary-light:#7B9BFF;
  --accent:       #22D3EE;
  --cyan:         #22D3EE;
  --success:      #22C55E;
  --text:         #F8FAFC;
  --text-muted:   #94A3B8;
  --text-dim:     #64748B;
  --border:       #1E293B;
  --border-light: #334155;
  --nav-bg:       rgba(7,11,20,0.85);
  --shadow:       0 4px 24px rgba(0,0,0,0.2);
  --shadow-strong:0 12px 48px rgba(0,0,0,0.3);
  --radius:       14px;
  --radius-sm:    8px;
  --transition:   0.3s cubic-bezier(0.4,0,0.2,1);
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter Tight', 'Inter', sans-serif;
  --sp-xs: 8px; --sp-sm: 16px; --sp-md: 24px; --sp-lg: 48px; --sp-xl: 80px; --sp-2xl: 120px;
}

/* Remove theme toggle support - enterprise dark only */
[data-theme="dark"], [data-theme="light"] {
  --bg: #070B14; --bg-secondary: #0D1424; --card-bg: #111B2E;
  --card-border: #1E293B; --text: #F8FAFC; --text-muted: #94A3B8;
  --nav-bg: rgba(7,11,20,0.85); --primary: #4F7CFF; --accent: #22D3EE;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 100%; margin: 0 auto; padding: 0 var(--sp-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; top: -100%; left: var(--sp-sm); z-index: 9999; background: var(--primary); color: #fff; padding: 10px 20px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 0; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; transition: all var(--transition); white-space: nowrap; min-height: 48px; border: 1px solid transparent; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; min-height: 52px; }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; min-height: 40px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 16px rgba(79,124,255,0.25); }
.btn-primary:hover, .btn-primary:active { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,124,255,0.35); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-ghost:hover { background: var(--card-bg); border-color: var(--primary); color: var(--primary-light); }
.btn-full { width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid transparent; transition: all var(--transition); }
.navbar.scrolled { background: rgba(7,11,20,0.97); border-bottom: 1px solid var(--border); }
.nav-container { max-width: 100%; margin: 0 auto; padding: 0 var(--sp-sm); display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text); }
.logo-icon-img { border-radius: 6px; width: 32px; height: 32px; }
.logo-text { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.logo-accent, .accent { color: var(--primary); }
.nav-links { display: none; gap: 32px; list-style: none; align-items: center; }
.nav-links a { font-size: 0.88rem; font-weight: 500; color: var(--text-muted); transition: color var(--transition); position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary); transition: width var(--transition); border-radius: 1px; }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-cta { display: none; padding: 8px 20px; font-size: 0.85rem; }
.theme-toggle { display: none; }
.hamburger { display: flex; flex-direction: column; gap: 5px; padding: 10px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* ===== MOBILE NAV ===== */
.mobile-nav-overlay { position: fixed; inset: 0; z-index: 9998; background: rgba(7,11,20,0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); opacity: 0; visibility: hidden; transition: all 0.4s; }
.mobile-nav-overlay.active { opacity: 1; visibility: visible; }
.mobile-nav-inner { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px var(--sp-sm); overflow-y: auto; }
.mobile-nav-close { position: absolute; top: 20px; right: 20px; font-size: 1.5rem; color: var(--text); padding: 10px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.mobile-nav-links { display: flex; flex-direction: column; gap: 28px; text-align: center; }
.mobile-nav-links a { font-size: 1.4rem; font-weight: 600; color: var(--text); font-family: var(--font-display); transition: color var(--transition); padding: 8px 0; }
.mobile-nav-links a:hover { color: var(--primary); }

/* ===== SERVICE PAGE HERO ===== */
.svc-back { max-width: 100%; margin: 0 auto; padding: 70px var(--sp-sm) 0; }
.svc-back a { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); transition: color var(--transition); }
.svc-back a:hover { color: var(--primary); }
.svc-page-hero { position: relative; padding: 24px var(--sp-sm) 40px; background: var(--bg); overflow: hidden; }
.svc-page-hero-inner { max-width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.svc-page-icon { width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); margin-bottom: var(--sp-sm); border: 1px solid var(--border); background: var(--card-bg); }
.svc-page-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; color: var(--primary); border: 1px solid var(--border-light); padding: 4px 14px; border-radius: 50px; margin-bottom: var(--sp-xs); text-transform: uppercase; letter-spacing: 0.1em; }
.svc-page-title { font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 700; margin-bottom: var(--sp-xs); line-height: 1.15; letter-spacing: -0.02em; }
.svc-page-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.65; max-width: 100%; margin: 0 auto var(--sp-md); }
.svc-page-rating { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-md); color: var(--text-muted); font-size: 0.85rem; }
.svc-page-rating i { color: var(--primary); }

/* ===== SERVICE PAGE CONTENT ===== */
.svc-page-content { max-width: 100%; margin: 0 auto; padding: 0 var(--sp-sm) var(--sp-lg); }
.svc-page-section-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: var(--sp-lg) 0 var(--sp-sm); padding-bottom: var(--sp-xs); border-bottom: 1px solid var(--border); }
.svc-features-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-xs); }
.svc-feature-item { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--card-bg); border: 1px solid var(--border); transition: all var(--transition); }
.svc-feature-item:hover { border-color: var(--primary); }
.svc-feature-item i { color: var(--primary); font-size: 1.1rem; flex-shrink: 0; }
.svc-cat-title { font-size: 0.88rem; font-weight: 700; color: var(--primary); margin-top: var(--sp-md); margin-bottom: var(--sp-sm); padding-bottom: 6px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.05em; }
.svc-cat-title:first-child { margin-top: 0; }

/* ===== PRICING ===== */
.svc-pricing-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-sm); margin-top: var(--sp-md); }
.svc-price-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-md) var(--sp-sm); text-align: center; transition: all var(--transition); }
.svc-price-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.svc-price-card.featured { border-color: var(--primary); background: rgba(79,124,255,0.05); }

/* ===== CTA ===== */
.svc-cta { text-align: center; padding: var(--sp-lg) var(--sp-sm); background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); margin: var(--sp-lg) var(--sp-sm); }
.svc-cta h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: var(--sp-sm); }
.svc-cta p { color: var(--text-muted); margin-bottom: var(--sp-md); font-size: 0.95rem; }

/* ===== RELATED SERVICES ===== */
.svc-related { display: grid; grid-template-columns: 1fr; gap: var(--sp-xs); padding: var(--sp-md) 0; }
.svc-related-card { display: flex; align-items: center; gap: 8px; padding: 12px var(--sp-sm); background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.88rem; transition: all var(--transition); }
.svc-related-card:hover { border-color: var(--primary); color: var(--text); }
.svc-related-card i { color: var(--primary); }

/* ===== CASE STUDY ===== */
.case-hero { padding: 80px var(--sp-sm) var(--sp-md); background: var(--bg); }
.case-hero-inner { max-width: 100%; margin: 0 auto; }
.case-hero h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 700; margin-bottom: var(--sp-sm); letter-spacing: -0.02em; }
.case-hero .case-subtitle { font-size: 1rem; color: var(--text-muted); margin-bottom: var(--sp-md); }
.case-body { max-width: 100%; margin: 0 auto; padding: 0 var(--sp-sm) var(--sp-xl); }
.case-body h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin: var(--sp-lg) 0 var(--sp-sm); }
.case-body p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; margin-bottom: var(--sp-sm); }
.case-body ul { list-style: none; margin-bottom: var(--sp-sm); }
.case-body ul li { padding: 6px 0 6px 24px; position: relative; color: var(--text-muted); font-size: 0.92rem; }
.case-body ul li::before { content: '→'; position: absolute; left: 0; color: var(--primary); }

/* ===== BLOG ===== */
.blog-hero { padding: 80px var(--sp-sm) var(--sp-md); }
.blog-hero h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 6vw, 2.5rem); font-weight: 700; margin-bottom: var(--sp-sm); letter-spacing: -0.02em; }
.blog-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-sm); max-width: 100%; margin: 0 auto; padding: 0 var(--sp-sm) var(--sp-xl); }
.blog-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all var(--transition); }
.blog-card:hover { border-color: rgba(79,124,255,0.3); transform: translateY(-2px); }
.blog-card img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-body { padding: var(--sp-sm) var(--sp-md) var(--sp-md); }
.blog-card-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: var(--sp-xs); }
.blog-card-body p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

/* ===== FOOTER ===== */
.footer { background: var(--bg); border-top: 1px solid var(--border); padding: var(--sp-lg) var(--sp-sm) var(--sp-sm); }
.footer .container { max-width: 100%; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.footer-brand .logo { margin-bottom: var(--sp-xs); }
.footer-brand p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--sp-sm); }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: var(--card-bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 1rem; transition: all var(--transition); }
.footer-socials a:hover { border-color: var(--primary); color: var(--primary); background: var(--card-hover); }
.footer-col h3 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text); margin-bottom: var(--sp-xs); text-transform: uppercase; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.85rem; color: var(--text-muted); transition: color var(--transition); display: inline-block; padding: 2px 0; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-newsletter { display: flex; flex-direction: column; align-items: flex-start; padding: var(--sp-md) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-sm); gap: var(--sp-sm); }
.footer-newsletter p { font-size: 0.88rem; color: var(--text-muted); }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.newsletter-input { padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 0.9rem; width: 100%; font-family: inherit; min-height: 48px; }
.newsletter-input:focus { border-color: var(--primary); outline: none; }
.newsletter-input::placeholder { color: var(--text-dim); }
.newsletter-form .btn { width: 100%; }
.footer-bottom { display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs); text-align: center; }
.footer-bottom p { font-size: 0.78rem; color: var(--text-dim); }
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--primary); }

/* ===== MISC ===== */
.gradient-text { background: linear-gradient(135deg, #4F7CFF 0%, #22D3EE 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.faq-section { max-width: 100%; margin: 0 auto; padding: var(--sp-md) var(--sp-sm); }
.faq-section h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: var(--sp-sm); }
.faq-item { margin-bottom: var(--sp-xs); padding: var(--sp-sm); background: var(--card-bg); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.faq-item h3 { font-size: 0.95rem; color: var(--primary); margin-bottom: 8px; }
.faq-item p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }

/* ===== BACK TO TOP ===== */
.back-to-top { position: fixed; bottom: 20px; right: 20px; z-index: 900; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: 0 4px 16px rgba(79,124,255,0.3); opacity: 0; visibility: hidden; transition: all var(--transition); }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* ===== TABLET (≥640px) ===== */
@media (min-width: 640px) {
  .container { max-width: 600px; padding: 0 var(--sp-sm); }
  .svc-page-hero-inner { max-width: 700px; }
  .svc-page-desc { max-width: 600px; }
  .svc-page-content { max-width: 700px; }
  .svc-features-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-pricing-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .svc-related { grid-template-columns: repeat(2, 1fr); }
  .case-hero-inner, .case-body { max-width: 700px; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); max-width: 700px; }
  .faq-section { max-width: 700px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .newsletter-form { flex-direction: row; }
  .newsletter-input { width: 240px; }
  .newsletter-form .btn { width: auto; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .footer-newsletter { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ===== DESKTOP (≥1024px) ===== */
@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .hamburger { display: none; }
  .nav-container { height: 64px; max-width: 1200px; padding: 0 var(--sp-md); }
  .logo { font-size: 1.15rem; }
  .logo-icon-img { width: 36px; height: 36px; }
  .container { max-width: 1200px; padding: 0 var(--sp-md); }
  .svc-page-hero-inner { max-width: 900px; }
  .svc-page-content { max-width: 900px; }
  .svc-related { grid-template-columns: repeat(3, 1fr); }
  .blog-grid { grid-template-columns: repeat(3, 1fr); max-width: 1200px; }
  .case-hero-inner, .case-body { max-width: 800px; }
  .footer .container { max-width: 1200px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-lg); }
  .footer-brand { grid-column: auto; }
  .faq-section { max-width: 760px; }
}

@media (min-width: 1440px) { .container, .nav-container { max-width: 1320px; } }
@media (min-width: 1920px) { .container, .nav-container { max-width: 1400px; } }
@media (min-width: 2560px) { .container, .nav-container { max-width: 1600px; } html { font-size: 18px; } }

/* ===== NAV DROPDOWN / MEGA MENU (2026 refresh) ===== */
.navbar.scrolled { box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.nav-links li { display: flex; align-items: center; }
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.nav-caret { font-size: 0.62rem; transition: transform 0.25s ease; opacity: 0.7; }
.nav-dropdown:hover .nav-caret, .nav-dropdown:focus-within .nav-caret { transform: rotate(180deg); }
.nav-mega-panel, .nav-simple-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(-8px);
  background: rgba(13,20,36,0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.22s ease;
  z-index: 1200;
}
.nav-dropdown:hover .nav-mega-panel, .nav-dropdown:focus-within .nav-mega-panel,
.nav-dropdown:hover .nav-simple-panel, .nav-dropdown:focus-within .nav-simple-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.nav-mega-panel { width: 340px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-mega-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px; border-radius: 12px; transition: background 0.2s; }
.nav-mega-item:hover { background: rgba(79,124,255,0.1); }
.nav-mega-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.05rem; flex-shrink: 0; }
.nav-mega-title { display: block; font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.nav-mega-desc { display: block; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.nav-simple-panel { width: 220px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-simple-panel a { padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }
.nav-simple-panel a:hover { background: rgba(79,124,255,0.1); color: var(--text); }
.nav-simple-panel a::after { display: none; }
.mobile-nav-group-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-top: 18px; opacity: 0.85; }
.mobile-nav-group-label:first-child { margin-top: 0; }
.mobile-nav-links a { display: flex; align-items: center; justify-content: center; gap: 10px; }
