/* Linknesis landing page — light/dark responsive stylesheet */

:root {
  --font-sans: 'Google Sans Flex Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-body: #121212;
  --bg-surface: #1e1e1e;
  --bg-surface-2: #252525;
  --bg-hero: #0d0d0d;
  --text-body: #e0e0e0;
  --text-muted: #9e9e9e;
  --border-color: #333333;
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --accent: #8ab4f8;
  --btn-shine: rgba(255, 255, 255, 0.25);
  --navbar-bg: rgba(18, 18, 18, 0.85);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --radius: 0.75rem;
  --transition: 0.2s ease;
}

html[data-bs-theme="light"] {
  --bg-body: #f5f5f5;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8f9fa;
  --bg-hero: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  --text-body: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --accent: #0d6efd;
  --navbar-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --btn-shine: rgba(255, 255, 255, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  background-color: var(--navbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  transition: background-color var(--transition), border-color var(--transition);
}

.navbar-brand img {
  height: 28px;
  width: auto;
  filter: brightness(1.1);
}

html[data-bs-theme="light"] .navbar-brand img {
  filter: none;
}

.navbar-toggler {
  border-color: var(--border-color);
  color: var(--text-body);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

html[data-bs-theme="light"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
  color: var(--text-body);
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--accent);
}

.btn-outline-theme {
  color: var(--text-body);
  border-color: var(--border-color);
  background: transparent;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline-theme:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  background: var(--bg-hero);
  padding: 8rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.badge-pill {
  background: rgba(13, 110, 253, 0.15);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid rgba(13, 110, 253, 0.25);
}

html[data-bs-theme="light"] .badge-pill {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary);
}

.hero-logo {
  max-width: 320px;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.35));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline-secondary {
  color: var(--text-body);
  border-color: var(--border-color);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-surface-2);
  border-color: var(--border-color);
  color: var(--text-body);
}

.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--btn-shine),
    transparent
  );
  transform: rotate(25deg);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.btn:hover::after {
  opacity: 1;
  animation: btnShine 0.45s ease forwards;
}

@keyframes btnShine {
  0% { left: -60%; }
  100% { left: 140%; }
}

html[data-bs-theme="light"] .btn-outline-secondary::after,
html[data-bs-theme="light"] .btn-outline-primary::after {
  --btn-shine: rgba(13, 110, 253, 0.22);
}

/* Sections */
.section {
  padding: 5rem 0;
}

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

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), border-color var(--transition);
}

.feature-card {
  padding: 0.5rem;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: rgba(13, 110, 253, 0.12);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

html[data-bs-theme="light"] .feature-icon {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary);
}

/* Steps */
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.25);
}

/* Architecture diagram */
.arch-diagram-img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

html[data-bs-theme="light"] .arch-diagram-img-light,
html[data-bs-theme="dark"] .arch-diagram-img-dark {
  display: block;
}

html[data-bs-theme="light"] .arch-diagram-img-dark,
html[data-bs-theme="dark"] .arch-diagram-img-light {
  display: none;
}

.arch-diagram {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.arch-layer,
.arch-box {
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.arch-core {
  background: rgba(13, 110, 253, 0.15);
  color: var(--accent);
}

html[data-bs-theme="light"] .arch-core {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary);
}

.arch-box {
  background: var(--bg-surface);
  color: var(--text-body);
  font-weight: 500;
}

.arch-probe {
  background: rgba(25, 135, 84, 0.12);
  color: #20c997;
}

html[data-bs-theme="light"] .arch-probe {
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
}

.arch-conn {
  color: var(--text-muted);
  padding: 0.5rem 0;
  font-size: 1.25rem;
}

.arch-list .arch-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.12);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

html[data-bs-theme="light"] .arch-list .arch-icon {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary);
}

/* Pricing */
.pricing-card {
  text-align: center;
}

.pricing-toggle .btn {
  min-width: 100px;
}

.pricing-toggle .btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pricing-toggle .btn:hover {
  transform: none;
}

.price-wrap {
  min-height: 1.2em;
  white-space: nowrap;
}

.price-year {
  display: none;
}

.pricing-grid.show-yearly .price-month {
  display: none;
}

.pricing-grid.show-yearly .price-year {
  display: inline;
}

html[data-bs-theme="light"] .pricing-card {
  border-color: #adb5bd;
}

.pricing-card ul li {
  padding: 0.35rem 0;
  color: var(--text-muted);
}

.pricing-card ul li i {
  margin-right: 0.5rem;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1080;
  display: block;
  background-color: var(--bg-surface-2);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  padding: 1rem 0;
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, background-color var(--transition), border-color var(--transition);
}

.cookie-banner.hidden {
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cookie-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-body);
}

.cookie-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner .btn-group {
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .cookie-banner .container {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner .btn-group {
    width: 100%;
  }

  .cookie-banner .btn {
    flex: 1;
  }
}

/* Footer */
.footer {
  background-color: var(--bg-surface-2);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-color);
  transition: background-color var(--transition), border-color var(--transition);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer h4 {
  color: var(--text-body);
}

.footer-logo {
  width: auto;
  max-width: 164px;
  height: auto;
}

.footer hr {
  border-color: var(--border-color);
}

/* Form */
.form-control {
  background-color: var(--bg-surface);
  color: var(--text-body);
  border-color: var(--border-color);
}

.form-control:focus {
  background-color: var(--bg-surface);
  color: var(--text-body);
  border-color: var(--primary);
}

/* Utilities */
.text-muted {
  color: var(--text-muted) !important;
}

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

/* Lazy image placeholders */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.loaded {
  opacity: 1;
}

/* Responsive */
@media (max-width: 991.98px) {
  .hero {
    padding-top: 6rem;
    text-align: center;
  }

  .hero-logo {
    max-width: 220px;
    margin-top: 1.5rem;
  }

  .navbar-collapse {
    background-color: var(--bg-surface);
    border-radius: var(--radius);
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
  }

  .navbar-collapse .nav-item:last-child .btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  .section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 575.98px) {
  .hero {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

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

  .hero .btn {
    width: 100%;
  }

  .pricing-card.featured {
    transform: none;
  }
}

/* Scroll-driven reveal animations (native CSS transitions, triggered by IntersectionObserver like lazy loading) */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-hero,
.reveal-hero-delay {
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-hero { transform: translateY(40px); transition-delay: 0.2s; }
.reveal-hero-delay { transform: translateY(40px); transition-delay: 0.5s; }

/* Prevent horizontal overflow from off-screen reveal transforms */
#main {
  overflow-x: hidden;
}

/* Visible state (triggered by JS observer) */
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-hero.is-visible,
.reveal-hero-delay.is-visible,
.no-js .reveal-up,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-hero,
.no-js .reveal-hero-delay {
  opacity: 1;
  transform: translate(0);
}

/* Staggered left-to-right reveals (pricing, how it works) */
.reveal-stagger-1.is-visible { transition-delay: 0s; }
.reveal-stagger-2.is-visible { transition-delay: 0.15s; }
.reveal-stagger-3.is-visible { transition-delay: 0.3s; }

/* Hover lift for interactive elements */
.nav-link,
.navbar-brand,
.btn,
.footer a {
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.navbar-brand:hover,
.btn:hover,
.footer a:hover {
  transform: translateY(-3px);
}

.navbar-brand {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-logo {
    animation: none;
  }

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-hero,
  .reveal-hero-delay {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-link:hover,
  .navbar-brand:hover,
  .btn:hover,
  .footer a:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
