/* ============================================================
   Binary.com — Cyber-Industrial Theme
   ------------------------------------------------------------
   Deep midnight blue/black canvas with neon green/cyan accents,
   glassmorphism cards, subtle animated background, and a
   premium typographic system.
   ============================================================ */

:root {
  --bn-bg:          #05070d;
  --bn-bg-2:        #0a0f1c;
  --bn-bg-3:        #10172a;
  --bn-line:        rgba(255, 255, 255, 0.06);
  --bn-line-strong: rgba(255, 255, 255, 0.12);
  --bn-text:        #e2e8f0;
  --bn-text-dim:    #94a3b8;
  --bn-green:       #00ffa3;
  --bn-green-soft:  rgba(0, 255, 163, 0.12);
  --bn-cyan:        #22d3ff;
  --bn-glow:        0 0 30px rgba(0, 255, 163, 0.35);
  --bn-glow-strong: 0 0 60px rgba(0, 255, 163, 0.55);
}

html { scroll-behavior: smooth; }
body { background: var(--bn-bg); overflow-x: hidden; }

/* ------------------------------------------------------------
   Animated background layers
   ------------------------------------------------------------ */
.bn-bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 255, 163, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 163, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.9), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.9), transparent 70%);
  opacity: 0.5;
}

.bn-bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 600px; height: 600px; border-radius: 50%;
  filter: blur(120px); opacity: 0.35;
  animation: bn-float 18s ease-in-out infinite;
}
.bn-bg-glow--a { top: -200px; left: -150px; background: radial-gradient(circle, rgba(0, 255, 163, 0.45), transparent 65%); }
.bn-bg-glow--b { bottom: -250px; right: -150px; background: radial-gradient(circle, rgba(34, 211, 255, 0.4),  transparent 65%); animation-delay: -9s; }

@keyframes bn-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, 60px) scale(1.1); }
}

main, header, footer { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   Typography helpers
   ------------------------------------------------------------ */
.bn-grad-text {
  background: linear-gradient(135deg, var(--bn-green) 0%, var(--bn-cyan) 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(0, 255, 163, 0.25));
}

.bn-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bn-green);
  background: var(--bn-green-soft);
  border: 1px solid rgba(0, 255, 163, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.bn-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bn-green);
  box-shadow: 0 0 12px var(--bn-green);
  animation: bn-pulse 1.6s ease-in-out infinite;
}
@keyframes bn-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.4); }
}

/* ------------------------------------------------------------
   Glassmorphism
   ------------------------------------------------------------ */
.bn-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--bn-line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 1.25rem;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.bn-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem; font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
}
.bn-btn--lg { padding: 0.95rem 1.6rem; font-size: 1rem; }

.bn-btn--primary {
  color: #02110b;
  background: linear-gradient(135deg, var(--bn-green) 0%, var(--bn-cyan) 100%);
  box-shadow: 0 10px 30px -10px rgba(0, 255, 163, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}
.bn-btn--primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 60%);
  opacity: 0; transition: opacity 0.25s ease;
}
.bn-btn--primary:hover { transform: translateY(-2px); box-shadow: var(--bn-glow-strong), inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.bn-btn--primary:hover::before { opacity: 1; }

.bn-btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--bn-line-strong);
  backdrop-filter: blur(8px);
}
.bn-btn--ghost:hover {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.4);
  color: var(--bn-green);
}

/* ------------------------------------------------------------
   Navbar
   ------------------------------------------------------------ */
.bn-nav {
  background: rgba(5, 7, 13, 0);
  backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
}
.bn-nav.is-scrolled {
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--bn-line);
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.6);
}

.bn-link {
  position: relative; padding: 0.4rem 0; color: #cbd5e1;
  transition: color 0.2s ease;
}
.bn-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: linear-gradient(90deg, var(--bn-green), var(--bn-cyan));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 2px;
}
.bn-link:hover { color: #fff; }
.bn-link:hover::after { transform: scaleX(1); }
.bn-link.is-active { color: var(--bn-green); }
.bn-link.is-active::after { transform: scaleX(1); }

/* Logo */
.bn-logo { position: relative; display: inline-flex; align-items: center; }
.bn-logo__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--bn-green) 0%, var(--bn-cyan) 100%);
  color: #02110b; font-weight: 900; font-family: "Space Grotesk", sans-serif;
  box-shadow: var(--bn-glow);
}
.bn-logo__pulse {
  position: absolute; inset: -3px; border-radius: 12px;
  border: 1px solid rgba(0, 255, 163, 0.6);
  animation: bn-pulse-ring 2s ease-out infinite;
}

/* Uploaded logo variant (replaces the "B" badge when the admin
   uploads a custom logo in the dashboard Branding tab). */
.bn-logo--img {
  height: 40px;
  display: inline-flex; align-items: center;
}
.bn-logo--img img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 14px rgba(0, 255, 163, 0.18));
}
@keyframes bn-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0;   }
}

/* Mobile menu */
.bn-burger {
  width: 42px; height: 42px;
  display: inline-flex; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--bn-line-strong);
  background: rgba(255, 255, 255, 0.03);
}
.bn-burger span {
  display: block; width: 18px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.bn-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bn-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bn-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.bn-mobile {
  display: none;
  padding: 1rem 1.25rem 1.5rem;
  background: rgba(5, 7, 13, 0.95);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--bn-line);
  flex-direction: column; gap: 0.4rem;
}
.bn-mobile.is-open { display: flex; }
.bn-mobile__link {
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  color: #cbd5e1;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.bn-mobile__link:hover {
  color: var(--bn-green);
  background: rgba(0, 255, 163, 0.06);
  border-color: rgba(0, 255, 163, 0.2);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.bn-stat {
  padding: 0.9rem 1rem;
  border-left: 2px solid rgba(0, 255, 163, 0.4);
  background: linear-gradient(90deg, rgba(0, 255, 163, 0.05), transparent);
  border-radius: 0 0.5rem 0.5rem 0;
}
.bn-stat__value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem; font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--bn-green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bn-stat__label {
  font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bn-text-dim); margin-top: 2px;
}

.bn-hero-card { overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); }
.bn-hero-card__bar {
  display: flex; align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--bn-line);
}
.bn-hero-card__dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.bn-pill {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--bn-line);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex; flex-direction: column;
}
.bn-pill span { font-size: 0.65rem; color: var(--bn-text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.bn-pill b { font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; color: var(--bn-green); }

.bn-caret { animation: bn-blink 1s steps(2) infinite; }
@keyframes bn-blink { 50% { opacity: 0; } }

.bn-scrollcue {
  position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px; display: none;
}
.bn-scrollcue__dot {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  width: 4px; height: 8px; background: var(--bn-green); border-radius: 2px;
  animation: bn-cue 1.6s ease-in-out infinite;
}
@keyframes bn-cue {
  0%, 100% { transform: translate(-50%, 0);   opacity: 1; }
  50%      { transform: translate(-50%, 14px); opacity: 0.2; }
}
@media (min-width: 1024px) { .bn-scrollcue { display: block; } }

/* ------------------------------------------------------------
   Services
   ------------------------------------------------------------ */
.bn-service {
  position: relative;
  padding: 2rem;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.bn-service::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 255, 163, 0.12), transparent 50%);
  opacity: 0; transition: opacity 0.4s ease;
  pointer-events: none;
}
.bn-service:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 255, 163, 0.35);
  box-shadow: 0 30px 70px -30px rgba(0, 255, 163, 0.4);
}
.bn-service:hover::before { opacity: 1; }

.bn-service__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--bn-green);
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.18), rgba(34, 211, 255, 0.1));
  border: 1px solid rgba(0, 255, 163, 0.3);
  box-shadow: inset 0 0 20px rgba(0, 255, 163, 0.15);
}

.bn-service__cta {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px dashed var(--bn-line);
}
.bn-arrow { transition: transform 0.25s ease; display: inline-block; }
.bn-service:hover .bn-arrow { transform: translateX(6px); }

/* ------------------------------------------------------------
   Projects / Gallery
   ------------------------------------------------------------ */
.bn-chip {
  padding: 0.5rem 1rem;
  font-size: 0.8rem; font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bn-line-strong);
  border-radius: 999px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.bn-chip:hover {
  color: var(--bn-green);
  border-color: rgba(0, 255, 163, 0.35);
  background: rgba(0, 255, 163, 0.06);
}
.bn-chip--active {
  color: #02110b;
  background: linear-gradient(135deg, var(--bn-green), var(--bn-cyan));
  border-color: transparent;
}

.bn-project {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--bn-bg-2);
  border: 1px solid var(--bn-line);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.bn-project:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 255, 163, 0.35);
  box-shadow: 0 30px 70px -30px rgba(0, 255, 163, 0.4);
}
.bn-project.is-hidden { display: none; }

.bn-project__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
}
.bn-project__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bn-project:hover .bn-project__media img { transform: scale(1.08); }
.bn-project__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 7, 13, 0.85) 100%);
}
.bn-project__tag {
  position: absolute; top: 1rem; left: 1rem;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600;
  color: var(--bn-green);
  background: rgba(5, 7, 13, 0.7);
  border: 1px solid rgba(0, 255, 163, 0.3);
  backdrop-filter: blur(8px);
}
.bn-project__body { padding: 1.25rem 1.5rem 1.5rem; }

/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */
.bn-about-media {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--bn-line);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}
.bn-about-media img { width: 100%; display: block; aspect-ratio: 4 / 5; object-fit: cover; }
.bn-about-media__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(5, 7, 13, 0.6) 100%),
    linear-gradient(135deg, rgba(0, 255, 163, 0.15), transparent 50%);
}
.bn-about-media__badge {
  position: absolute;
  bottom: 1.25rem; left: 1.25rem; right: 1.25rem;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1rem 1.25rem;
}

.bn-feature {
  padding: 1rem 1.25rem;
  display: flex; align-items: flex-start; gap: 0.85rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.bn-feature:hover { border-color: rgba(0, 255, 163, 0.3); }

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.bn-contact-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.bn-contact-row:hover {
  border-color: rgba(0, 255, 163, 0.3);
  transform: translateX(4px);
}

.bn-form { padding: 2rem; }
@media (min-width: 640px) { .bn-form { padding: 2.5rem; } }

.bn-field label {
  display: block;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.05em;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.bn-input {
  width: 100%;
  padding: 0.85rem 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bn-line-strong);
  border-radius: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
  font-size: 0.95rem;
}
.bn-input::placeholder { color: rgba(148, 163, 184, 0.6); }
.bn-input:hover { border-color: rgba(0, 255, 163, 0.25); }
.bn-input:focus {
  outline: none;
  background: rgba(0, 255, 163, 0.05);
  border-color: var(--bn-green);
  box-shadow: 0 0 0 4px rgba(0, 255, 163, 0.12);
}

select.bn-input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300ffa3' stroke-width='2'><path d='M6 9l6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
select.bn-input option { background: var(--bn-bg-2); color: #fff; }

.bn-error {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #f87171;
}
.bn-form__error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 0.75rem;
  color: #fca5a5;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   Toasts (messages framework)
   ------------------------------------------------------------ */
.bn-toast {
  display: inline-flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem; font-weight: 500;
  backdrop-filter: blur(18px);
  border: 1px solid var(--bn-line-strong);
  background: rgba(10, 15, 28, 0.85);
  color: #fff;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  animation: bn-toast-in 0.4s ease-out;
  max-width: min(640px, calc(100vw - 2rem));
}
.bn-toast--success { border-color: rgba(0, 255, 163, 0.4); color: var(--bn-green); }
.bn-toast--error   { border-color: rgba(248, 113, 113, 0.4); color: #fca5a5; }
.bn-toast__close {
  background: none; border: none; cursor: pointer;
  color: currentColor; opacity: 0.6; font-size: 1.2rem; line-height: 1;
}
.bn-toast__close:hover { opacity: 1; }

@keyframes bn-toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   Social icons
   ------------------------------------------------------------ */
.bn-social {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--bn-line-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--bn-text-dim);
  transition: all 0.2s ease;
}
.bn-social:hover {
  color: var(--bn-green);
  border-color: rgba(0, 255, 163, 0.4);
  transform: translateY(-2px);
}

/* ------------------------------------------------------------
   Scrollbar
   ------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bn-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 255, 163, 0.4), rgba(34, 211, 255, 0.4));
  border-radius: 10px;
  border: 2px solid var(--bn-bg);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--bn-green), var(--bn-cyan)); }

/* Honor reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bn-bg-glow { animation: none; }
}
