/* =========================================
   CORE.CSS — MERGED & FIXED
   ========================================= */

/* 1) VARIABLES + RESET */
:root {
  /* Reference Variables */
  --bg-body: #fbfbfd;
  --text-main: #1d1d1f;
  --text-gray: #86868b;
  --nexus-orange: #ff9500;
  --studio-blue: #007aff;
  --core-purple: #5e5ce6;
  --growth-green: #34c759;
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-blur: blur(20px);
  --radius-card: 32px;
  --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
  
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Menlo", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; border: 2px solid #000; }

a { text-decoration: none !important; color: inherit; transition: opacity 0.2s; }
button { text-decoration: none !important; cursor: pointer; border: none; outline: none; }

body {
  background-color: var(--bg-body);
  font-family: var(--font-stack);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* Utilities */
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-nexus-orange { color: var(--nexus-orange); font-weight: 600; } /* Added bold for Webilax */
.text-red { color: #ff2d55; }
.text-gray { color: #86868b; }
.pt-140 { padding-top: 140px; }
.headline { font-size: clamp(32px, 6vw, 64px); line-height: 1.05; font-weight: 700; margin-bottom: 15px; letter-spacing: -0.03em; text-wrap: balance; }
.subhead { font-size: 21px; font-weight: 400; margin-bottom: 35px; color: var(--text-gray); letter-spacing: -0.01em; line-height: 1.5; }

/* =========================================
 2. DYNAMIC ISLAND NAVIGATION (Reference Style)
 ========================================= */
.nav-wrapper { position: fixed; top: 20px; left: 0; width: 100%; display: flex; justify-content: center; z-index: 9999; pointer-events: none; }

.vision-nav { 
  pointer-events: auto; background: var(--glass-bg); backdrop-filter: saturate(180%) var(--glass-blur); 
  padding: 8px 12px; border-radius: 100px; display: flex; align-items: center; justify-content: space-between; 
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.4); 
  min-width: 320px; transition: transform 0.3s var(--ease-apple); 
}
.vision-nav:hover { transform: scale(1.02); }

.nav-logo-container { padding: 0 15px 0 10px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.custom-logo-img { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; margin: -12px -5px -12px 0; }
.nav-logo-text { font-weight: 600; font-size: 15px; letter-spacing: -0.3px; color: #000; }

.desktop-nav-links { display: flex; padding-right: 5px; border-left: 1px solid rgba(0, 0, 0, 0.1); margin-left: 10px; }
.nav-item { background: 0 0; border: none; color: #333; font-size: 13px; font-weight: 500; padding: 10px 18px; border-radius: 20px; cursor: pointer; transition: 0.2s; }
.nav-item:hover { background: rgba(0, 0, 0, 0.05); }
.nav-item.active { background: #1d1d1f; color: #fff; }

.burger-menu-btn { display: none; width: 40px; height: 40px; background: 0 0; border: none; cursor: pointer; position: relative; margin-right: 5px; }
.burger-line { width: 18px; height: 2px; background: #1d1d1f; position: absolute; left: 50%; transform: translateX(-50%); border-radius: 2px; transition: 0.3s var(--ease-apple); }
.top { top: 16px; } .bot { bottom: 16px; }
.burger-menu-btn.active .top { top: 50%; transform: translate(-50%, -50%) rotate(45deg); }
.burger-menu-btn.active .bot { bottom: 50%; transform: translate(-50%, 50%) rotate(-45deg); }

.mobile-menu-overlay { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(251, 251, 253, .98); 
  backdrop-filter: blur(20px); z-index: 9990; padding: 120px 40px; display: flex; flex-direction: column; 
  gap: 20px; opacity: 0; pointer-events: none; transform: translateY(-20px); transition: 0.4s var(--ease-apple); 
}
.mobile-menu-overlay.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mm-link { 
  font-size: 28px; font-weight: 600; color: #1d1d1f; text-decoration: none; border-bottom: 1px solid rgba(0, 0, 0, .05); 
  padding-bottom: 20px; opacity: 0; transform: translateY(10px); transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.mobile-menu-overlay.open .mm-link:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.open .mm-link:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.open .mm-link:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.mobile-menu-overlay.open .mm-link:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* =========================================
 3. CORE PAGE SPECIFIC CONTENT
 ========================================= */
.core-page-bg { background-color: #000 !important; color: #f5f5f7; min-height: 100vh; }

.detail-page { display: block; width: 100%; padding-bottom: 140px; animation: fadePage .8s var(--ease-apple); }
@keyframes fadePage { from { opacity: 0; } to { opacity: 1; } }

.detail-hero { text-align: center; max-width: 900px; margin: 0 auto; padding: 0 20px; }
.core-badge-container { position: relative; display: inline-block; margin-bottom: 10px; }
.core-eyebrow { color: var(--core-purple); font-weight: 700; text-transform: uppercase; font-size: 14px; letter-spacing: 1px; display: block; margin-bottom: 10px; }
.core-corner-logo { position: absolute; top: -10px; right: -20px; width: 28px; height: auto; transform: rotate(15deg); filter: drop-shadow(0 2px 5px rgba(94, 92, 230, 0.3)); }
.core-hero-text { max-width: 800px; margin: 0 auto 80px; color: #a1a1a6; }

/* Reveal Animation */
.reveal-on-scroll { opacity: 0; transform: translateY(30px); transition: all .8s cubic-bezier(.2, .8, .2, 1); }
.is-visible { opacity: 1; transform: translateY(0); }

/* Terminal */
.terminal-window {
  width: 100%; max-width: 1000px; margin: 0 auto 120px; background: #0d0d0d; border: 1px solid #333;
  border-radius: 16px; box-shadow: 0 0 80px rgba(94, 92, 230, 0.15); overflow: hidden; font-family: var(--font-mono); position: relative;
}
.terminal-header { background: #1a1a1a; padding: 12px 20px; display: flex; gap: 8px; border-bottom: 1px solid #333; }
.light { width: 12px; height: 12px; border-radius: 50%; }
.light.red { background: #ff5f56; } .light.yellow { background: #ffbd2e; } .light.green { background: #27c93f; }
.terminal-body { padding: 30px; font-size: 14px; line-height: 1.6; color: #d4d4d4; height: 400px; overflow: hidden; position: relative; }
.code-line { display: block; margin-bottom: 5px; opacity: 0; animation: fadeInCode .5s forwards; }
@keyframes fadeInCode { to { opacity: 1; } }
.c-kw { color: #ff79c6; } .c-fn { color: #8be9fd; } .c-st { color: #f1fa8c; } .c-cm { color: #6272a4; }

/* API Flow */
.api-flow { max-width: 1000px; margin: 0 auto 100px; text-align: center; position: relative; }
.flow-header { font-size: 32px; margin-bottom: 20px; color: #fff; }
.flow-line { height: 2px; background: linear-gradient(90deg, transparent, var(--core-purple), transparent); width: 100%; margin: 40px 0; opacity: 0.5; position: relative; }
.data-packet {
  position: absolute; top: -4px; left: 0; width: 50px; height: 10px; background: #fff; border-radius: 10px;
  box-shadow: 0 0 20px var(--core-purple); animation: moveData 3s infinite ease-in-out;
}
@keyframes moveData { 0% { left: 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.flow-labels { display: flex; justify-content: space-between; max-width: 600px; margin: 0 auto; color: #888; font-family: var(--font-mono); font-size: 14px; }

/* Tech Grid */
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1100px; margin: 0 auto 120px; padding: 0 20px; }
.tech-card { background: #111; border: 1px solid #222; border-radius: 24px; padding: 40px; transition: 0.3s; position: relative; overflow: hidden; color: #fff; }
.tech-card:hover { border-color: var(--core-purple); transform: translateY(-5px); background: #161616; }
.tc-icon { font-size: 32px; margin-bottom: 20px; background: linear-gradient(135deg, #fff, #555); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tc-title { font-size: 24px; font-weight: 600; margin-bottom: 10px; color: #fff; }
.tc-desc { font-size: 16px; color: #86868b; line-height: 1.5; }

/* =========================================
 5. MEGA FOOTER (OPDATERET DESIGN)
 ========================================= */
.mega-footer { 
  background: #f5f5f7; /* Lys grå baggrund som screenshot */
  padding: 80px 0 0; 
  position: relative; 
  margin-top: auto; 
  overflow: hidden; 
  display: flex; 
  flex-direction: column; 
  z-index: 20; 
  border-top: 1px solid #e5e5e5;
}

.mf-content { 
  max-width: 1200px; 
  margin: 0 auto; 
  position: relative; 
  z-index: 2; 
  width: 100%; 
  padding: 0 40px;
}

/* Bagvedliggende stor tekst */
.mf-brand-wrap { position: absolute; bottom: 40px; left: 0; width: 100%; text-align: center; z-index: 1; pointer-events: none; line-height: 0.75; }
.mf-big-text { font-size: 14vw; font-weight: 800; color: rgba(0,0,0,0.03); letter-spacing: -0.05em; }

/* Links sektion */
.mf-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-bottom: 80px; }
.mf-col h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #86868b; margin-bottom: 16px; letter-spacing: 0.5px; }
.mf-col ul { list-style: none; }
.mf-col li { margin-bottom: 12px; }
.mf-col a { font-size: 13px; color: #424245; transition: 0.2s; text-decoration: none; }
.mf-col a:hover { color: #000; text-decoration: underline; }

/* DENNE BAR ER OPDATERET TIL SCREENSHOT DESIGN */
.mf-bottom { 
  width: 100%; 
  background: #f5f5f7; /* Samme farve som footer baggrund */
  border-top: 1px solid rgba(0,0,0,0.06); /* Subtil separator linje */
  padding: 24px 40px; 
  display: flex; 
  flex-wrap: wrap; 
  justify-content: space-between; 
  align-items: center; 
  color: #86868b; 
  font-size: 12px; 
  z-index: 10; 
  position: relative; /* Ikke absolute */
}

/* 6) RESPONSIVE */
@media (max-width: 1024px) {
  .mf-top { grid-template-columns: 1fr 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .desktop-nav-links { display: none; }
  .burger-menu-btn { display: block; }
  .vision-nav { padding: 8px 12px; max-width: 100%; }
  
  .mf-top { grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 60px; }
  .mf-content { padding: 0 20px; }
  
  /* Mobil justering for footer bar */
  .mf-bottom { padding: 20px; flex-direction: column; text-align: center; gap: 10px; }
  
  .terminal-body { height: 300px; padding: 20px; }
}