/* ============================================================
   BountySec Technology — styles
   Themes: dark (default) & light, toggled via html[data-theme]
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --max-w: 1120px;
}

html[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-alt: #101013;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --card: #141417;
  --card-hover: #1a1a1f;
  --line: #27272c;
  --accent: #34d399;
  --accent-fg: #052014;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --rack-body: #17171c;
  --slot-face: #202027;
  --vent: #2c2c34;
  --hero-grid: rgba(255, 255, 255, .04);
}

html[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f1f1f3;
  --fg: #101013;
  --muted: #56565e;
  --card: #ffffff;
  --card-hover: #ffffff;
  --line: #e3e3e8;
  --accent: #059669;
  --accent-fg: #ffffff;
  --shadow: 0 10px 30px rgba(16, 16, 19, .08);
  --rack-body: #e7e7ec;
  --slot-face: #f2f2f6;
  --vent: #d8d8e0;
  --hero-grid: rgba(16, 16, 19, .045);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 8px 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.brand-text { font-size: 1.06rem; letter-spacing: -.01em; font-weight: 500; }
.brand-text b { font-weight: 800; }
.brand-text.small { font-size: .95rem; }
.site-nav { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.site-nav a:hover { color: var(--fg); text-decoration: none; }

/* ---------- Nav dropdowns (Product / Services) ---------- */
.nav-item { position: relative; }

.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 2px; background: transparent; border: 0;
  color: var(--muted); font: inherit; font-size: .95rem; font-weight: 500;
  cursor: pointer; transition: color .2s;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--fg); }
.nav-caret { width: 14px; height: 14px; transition: transform .2s ease; }
.nav-link[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translate(-50%, -8px);
  min-width: 268px; margin: 0; padding: 8px; list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; pointer-events: none;
  /* The Product menu carries ten entries. On a short viewport the panel
     would otherwise run off the bottom of the screen, so it is capped
     and scrolls instead. The cap has to be generous enough that all ten
     entries fit on a normal desktop screen without scrolling. */
  max-height: min(640px, calc(100vh - 96px));
  overflow-y: auto;
  overscroll-behavior: contain;
  /* visibility is stepped, not interpolated: it must flip to `visible`
     the instant the menu opens, otherwise a .focus() call in the same
     tick lands on a still-hidden element and silently fails.
     On close it waits for the fade-out to finish. */
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.dropdown.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, 0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
}

/* invisible hover bridge so the pointer can travel from the button
   into the panel without the menu closing in the gap */
.dropdown::before {
  content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 13px;
}

.dropdown li { margin: 0; }
.dropdown a {
  display: block; padding: 9px 12px; border-radius: 9px;
  color: var(--fg); line-height: 1.35;
  transition: background .15s, color .15s;
}
.dropdown a:hover, .dropdown a:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  text-decoration: none;
}
.dd-title { display: block; font-size: .93rem; font-weight: 600; color: var(--fg); }
.dd-note { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  place-items: center;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); cursor: pointer;
}
.nav-toggle .icon-menu, .nav-toggle .icon-close { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle:hover { color: var(--accent); border-color: var(--accent); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle .icon-sun { display: none; width: 19px; height: 19px; }
.theme-toggle .icon-moon { width: 19px; height: 19px; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; padding: 96px 24px 72px; max-width: 760px; }

.kicker {
  font-family: var(--mono); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent); margin-bottom: 10px;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--fg) 20%, var(--accent) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1.13rem; color: var(--muted); max-width: 620px; margin: 20px 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-status {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 34px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .85rem; color: var(--muted);
  background: color-mix(in srgb, var(--card) 60%, transparent);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.status-dot.bad { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); }

/* server rack art */
.hero-art {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .5;
}
.hero-art svg {
  position: absolute; right: -60px; bottom: 0;
  width: min(760px, 78vw); height: 92%;
}
.rack-body { fill: var(--rack-body); stroke: var(--line); stroke-width: 1.4; }
.slot-face { fill: var(--slot-face); stroke: var(--line); stroke-width: 1; }
.vent { fill: var(--vent); }
.led { fill: var(--accent); animation: blink 1.7s ease-in-out infinite; }
.led-2 { animation-delay: .35s; animation-duration: 2.1s; }
.led-3 { animation-delay: .8s;  animation-duration: 1.4s; }
.led-4 { animation-delay: 1.15s; animation-duration: 2.4s; fill: #60a5fa; }
.led-5 { animation-delay: .55s; animation-duration: 1.9s; fill: #60a5fa; }
.led-6 { animation-delay: 1.5s; animation-duration: 1.6s; fill: #fbbf24; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.floor { fill: var(--line); opacity: .7; }

.trust-strip { position: relative; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-alt) 70%, transparent); }
.trust-inner {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 18px; padding: 16px 24px;
  font-size: .88rem; color: var(--muted); font-weight: 500;
}
.trust-inner i { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.grid { display: grid; gap: 22px; }
.services-grid { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--card-hover); }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

.card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  margin-bottom: 16px;
}
.card-icon svg { width: 23px; height: 23px; }

/* product card action row */
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.card-actions .btn { padding: 8px 15px; font-size: .87rem; }

/* why us */
.why-grid { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.why-item {
  padding: 26px 28px; border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.why-item h4 { font-size: 1.05rem; margin-bottom: 6px; }
.why-item p { color: var(--muted); font-size: .95rem; }

/* pricing */
.pricing-grid { grid-template-columns: repeat(3, 1fr); margin-top: 14px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card ul { list-style: none; margin: 14px 0 22px; flex: 1; }
.price-card li { padding: 6px 0 6px 24px; position: relative; color: var(--muted); font-size: .93rem; }
.price-card li::before {
  content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700;
}
.price { font-size: 1rem; color: var(--muted); }
.price b { font-size: 2rem; color: var(--fg); letter-spacing: -.03em; }
.price span { font-size: .9rem; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.badge {
  position: absolute; top: -11px; right: 20px;
  background: var(--accent); color: var(--accent-fg);
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 11px; border-radius: 999px;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border-radius: 11px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-solid { background: var(--accent); color: var(--accent-fg); }
.btn-solid:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-info .lede { margin: 14px 0 26px; max-width: 460px; }
.contact-block { margin-top: 22px; }
.contact-block h5 {
  font-family: var(--mono); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted); margin-bottom: 6px;
}
.contact-block p { color: var(--fg); line-height: 1.7; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; }
.contact-form label span {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.contact-form input, .contact-form select, .contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--fg); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: .9rem; min-height: 1.3em; }
.form-note.ok { color: var(--accent); }
.form-note.err { color: #ef4444; }

/* ---------- Landing pages (services + products) ---------- */

/* The page hero sits below the sticky header and reuses the home page's
   grid backdrop so the two feel like one site. */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 54px 0 58px;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 100% at 30% 0%, black 25%, transparent 78%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.page-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 800;
  margin: 4px 0 0;
}
.page-hero .lede { margin: 16px 0 28px; max-width: 640px; }

/* breadcrumbs */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .84rem; color: var(--muted); margin-bottom: 26px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); text-decoration: none; }
.crumbs span[aria-current="page"] { color: var(--fg); }

/* the menu the current page belongs to */
.nav-current .nav-link { color: var(--fg); }

/* four-up feature grid used across the landing pages */
.feature-grid { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }

/* specification / use-case panels */
.spec-grid { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.spec-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.spec-card h4 {
  font-size: 1.02rem;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.spec-card ul { list-style: none; }
.spec-card li {
  position: relative;
  padding: 5px 0 5px 22px;
  color: var(--muted);
  font-size: .93rem;
}
.spec-card li::before {
  content: "›"; position: absolute; left: 4px; top: 5px;
  color: var(--accent); font-weight: 700;
}
.spec-card a { font-size: .93rem; word-break: break-word; }

/* closing call to action */
.cta-section {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.cta-inner { max-width: 720px; text-align: center; }
.cta-inner .lede { margin: 14px auto 28px; }
.cta-inner .hero-cta { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-addr { color: var(--muted); font-size: .88rem; margin-top: 8px; max-width: 420px; }
.footer-meta { text-align: right; font-size: .88rem; }
.footer-meta .muted { margin-top: 6px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .led { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .spec-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 460px; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-art { opacity: .22; }
}

@media (max-width: 760px) {
  /* the nav collapses behind a toggle button */
  .nav-toggle { display: grid; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    margin-left: 0; padding: 8px 24px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav > a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-item { border-bottom: 1px solid var(--line); }
  .nav-link { width: 100%; justify-content: space-between; padding: 11px 0; }

  /* dropdowns become inline accordions rather than floating panels */
  .dropdown {
    position: static; transform: none;
    min-width: 0; box-shadow: none; background: transparent;
    border: 0; border-radius: 0; padding: 0 0 8px 14px;
    opacity: 1; visibility: visible; pointer-events: auto;
    display: none;
  }
  .dropdown.open { display: block; transform: none; }
  .dropdown::before { display: none; }
  .dropdown a { padding: 8px 10px; }
}

@media (max-width: 640px) {
  .hero-inner { padding: 72px 24px 56px; }
  .services-grid, .why-grid { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
}