/* ============================================================
   STYLES.CSS — N8 Secure Solutions
   Structure:
     1.  Design tokens (CSS custom properties)
     2.  Reset & base
     3.  Layout utilities
     4.  Background decorations (noise, grid, orbs)
     5.  Header & nav
     6.  Hero section
     7.  Feature strip
     8.  Bottom banner
     9.  Footer
    10.  Reveal / scroll animations
    11.  Keyframe animations
    12.  Responsive breakpoints
   ============================================================ */


/* ── 1. DESIGN TOKENS ─────────────────────────────────────────
   All colours, shadows, radii and transitions live here.
   Edit these variables and changes cascade site-wide.
──────────────────────────────────────────────────────────────── */
:root {
  /* Background shades */
  --bg:           #050814;
  --bg-2:         #0b0f1f;

  /* Panel fills for glass cards */
  --panel:        rgba(12, 16, 32, 0.75);
  --panel-strong: rgba(16, 24, 43, 0.82);

  /* Card border colours — low-opacity teal for a subtle glow line */
  --border:        rgba(28, 179, 179, 0.18);
  --border-strong: rgba(28, 179, 179, 0.28);

  /* Typography */
  --text:  #c9cacc;   /* Body / primary text */
  --muted: #8c98a8;   /* Secondary / label text */

  /* Brand teal */
  --primary:   #1cb3b3;
  --primary-2: #159a9a; /* Slightly darker for gradients */
  --accent:    #1cb3b3; /* Alias of primary — handy for quick overrides */

  /* Danger colour — unused for now, kept for future status badges */
  --danger: #ff9d7a;

  /* Card elevation shadow */
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

  /* Border radius scale */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;

  /* Max content width */
  --max: 1240px;

  /* Default transition speed for hover effects */
  --transition: 220ms ease;
}


/* ── 2. RESET & BASE ──────────────────────────────────────────
──────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Prevent anchor targets jumping behind the fixed header */
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  /* Layered radial + linear gradients give ambient depth without images */
  background:
    radial-gradient(circle at 10% 20%, rgba(28, 179, 179, 0.12), transparent 20%),
    radial-gradient(circle at 85% 15%, rgba(28, 179, 179, 0.08), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(140, 152, 168, 0.08), transparent 25%),
    linear-gradient(160deg, var(--bg) 0%, #080c18 45%, #0b1020 100%);
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll from parallax offsets */
}

a {
  color: inherit; /* Links inherit surrounding text colour */
}

img {
  max-width: 100%; /* Images never overflow their container */
}


/* ── 3. LAYOUT UTILITIES ──────────────────────────────────────
   .container: centres content and enforces the max-width.
   Used as the direct child of every <section>.
──────────────────────────────────────────────────────────────── */
.container {
  /* min() picks the smaller of (100% minus gutters) or the hard max-width */
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}


/* ── 4. BACKGROUND DECORATIONS ────────────────────────────────
   Fixed layers that sit behind all page content (z-index: 0).
   pointer-events: none so they never intercept clicks.
──────────────────────────────────────────────────────────────── */
.noise,
.grid,
.bg-orb {
  pointer-events: none;
  position: fixed;
  inset: 0; /* Shorthand for top/right/bottom/left: 0 */
}

/* Dot noise — tiny repeating radial dots at very low opacity */
.noise {
  z-index: 0;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 20%, #fff 0.5px, transparent 0.6px),
    radial-gradient(circle at 80% 40%, #fff 0.5px, transparent 0.6px),
    radial-gradient(circle at 40% 70%, #fff 0.5px, transparent 0.6px);
  background-size: 180px 180px;
  mix-blend-mode: screen;
}

/* Grid lines — drifts slowly downward via the driftGrid keyframe */
.grid {
  z-index: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  /* Fade toward the edges so the grid doesn't look clipped */
  -webkit-mask-image: radial-gradient(circle at center, black 42%, transparent 90%);
          mask-image: radial-gradient(circle at center, black 42%, transparent 90%);
  animation: driftGrid 18s linear infinite;
}

/* Shared base for the three ambient glow orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px); /* Heavy blur creates a soft colour wash */
  z-index: 0;
}

/* Top-left orb — strongest teal */
.orb-1 {
  width: 340px;
  height: 340px;
  top: 4%;
  left: 4%;
  background: rgba(28, 179, 179, 0.12);
  animation: floatOrb 12s ease-in-out infinite;
}

/* Mid-right orb — softer teal */
.orb-2 {
  width: 300px;
  height: 300px;
  top: 45%;
  left: 70%;
  background: rgba(28, 179, 179, 0.08);
  animation: floatOrb 16s ease-in-out infinite reverse; /* Moves opposite to orb-1 */
}

/* Bottom-left orb — neutral grey-blue */
.orb-3 {
  width: 240px;
  height: 240px;
  top: 70%;
  left: 18%;
  background: rgba(140, 152, 168, 0.08);
  animation: floatOrb 14s ease-in-out infinite;
}

/* Header, main and footer all sit above the bg layers */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}


/* ── 5. HEADER & NAV ──────────────────────────────────────────
   Pill-shaped frosted-glass bar inside the page header.
──────────────────────────────────────────────────────────────── */
.site-header {
  padding: 1.25rem 0 0;
  border-bottom: 1px solid rgba(28, 179, 179, 0.08);
}

/* The pill bar — backdrop-filter gives the frosted glass look */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.56);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  border-radius: 999px; /* Large value = always fully pill-shaped */
  box-shadow: var(--shadow);
}

/* Brand link: logo + name + tagline */
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Logo container with subtle inner glow */
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(28, 179, 179, 0.2), rgba(140, 152, 168, 0.12)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.03),
    0 0 30px rgba(28, 179, 179, 0.22);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Company name and tagline stacked vertically */
.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
}

.brand-copy span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Shared base for inline flex pill/indicator elements */
.nav-pill,
.live-indicator,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

/* "Site in development" status pill — hidden on mobile */
.nav-pill {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: rgba(28, 179, 179, 0.08);
  border: 1px solid rgba(28, 179, 179, 0.18);
  color: var(--text);
  font-size: 0.88rem;
}

/* Pulsing teal dot — used in nav pill, live indicator, and eyebrow pill */
.dot,
.pulse {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  animation: pulse 2s infinite;
}


/* ── 6. HERO SECTION ──────────────────────────────────────────
──────────────────────────────────────────────────────────────── */
.hero {
  padding: 4.5rem 0 2rem;
}

/* Two-column grid: copy slightly wider on the left, cards on the right */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

/* Left column glass card */
.hero-copy {
  padding: clamp(1.8rem, 4vw, 4rem); /* Fluid padding scales with viewport */
}

/* Small label pill above the headline */
.eyebrow {
  margin-bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(28, 179, 179, 0.16);
  background: rgba(28, 179, 179, 0.08);
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: fit-content; /* Shrinks to content, doesn't stretch full row */
}

/* Hero headline — large, tight tracking */
.hero-copy h1 {
  margin: 0 0 1.2rem;
  font-size: clamp(2.8rem, 7vw, 6rem); /* Fluid type: min / preferred / max */
  line-height: 0.94;
  letter-spacing: -0.05em;
  max-width: 10ch;
}

/* Accent words in the headline get the brand teal colour */
.hero-copy h1 span {
  display: inline-block;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(28, 179, 179, 0.22);
}

/* Subtitle paragraph */
.lead {
  margin: 0 0 2rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

/* CTA button row */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

/* ── Buttons ── */
.btn {
  min-height: 50px;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition:
    transform    var(--transition),
    box-shadow   var(--transition),
    background   var(--transition),
    border-color var(--transition);
}

.btn:hover {
  transform: translateY(-2px); /* Subtle lift on hover */
}

/* Filled teal gradient — primary CTA */
.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--primary-2));
  box-shadow: 0 12px 32px rgba(28, 179, 179, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(28, 179, 179, 0.32);
}

/* Ghost button — secondary CTA */
.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* FIX: Was repeat(3, 1fr) with 4 cards — the 4th card orphaned alone on
   a second row. Changed to repeat(2, 1fr) so all four sit in a 2×2 grid. */
.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

/* Individual selling-point card */
.point-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
}

.point-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.point-card span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Right column — stacks the two cards vertically */
.hero-side {
  display: grid;
  gap: 1rem;
}

/* ── Shared glass card base ──
   Applied to every frosted-glass panel on the page */
.point-card,
.feature-box,
.status-card,
.terminal-card,
.bottom-card,
.hero-copy {
  border: 1px solid var(--border);
  background: var(--panel);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

/* Darker glass variant used on the right-column hero cards */
.glass {
  background: linear-gradient(
    180deg,
    rgba(10, 14, 28, 0.82),
    rgba(7, 10, 20, 0.68)
  );
}

/* Padding on the two hero-side cards */
.status-card,
.terminal-card {
  padding: 1.2rem;
}

/* Reusable space-between flex row — used in card headers, footer, etc. */
.card-header,
.progress-meta,
.status-row,
.bottom-card,
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Small all-caps label above card headings */
.card-label {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.card-header h2,
.bottom-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

/* "Live build" label in the status card header */
.live-indicator {
  white-space: nowrap;
  color: var(--text);
  font-size: 0.82rem;
}

/* Stack of task status rows */
.status-list {
  display: grid;
  gap: 0.7rem;
  margin: 1.15rem 0 1.3rem;
}

/* Individual status row: task name left, badge right */
.status-row {
  padding: 0.9rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-row span:first-child {
  color: var(--text);
}

/* Status badge — base */
.status {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
}

/* Add more variants here if you need additional task states */
.status.good  { color: var(--text); background: rgba(28, 179, 179, 0.1);   border: 1px solid rgba(28, 179, 179, 0.18);  }
.status.warn  { color: var(--text); background: rgba(140, 152, 168, 0.12); border: 1px solid rgba(140, 152, 168, 0.18); }
.status.muted { color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }

/* Progress bar section */
.progress-wrap {
  margin-top: 0.4rem;
}

/* Row above the bar: label left, percentage right */
.progress-meta {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Bar track (unfilled background) */
.progress-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Bar fill — width set by JS from data-progress on .progress-wrap.
   Do NOT add a hardcoded width here; JS controls it dynamically. */
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22c7c7, #7ea3b0);
  box-shadow: 0 0 20px rgba(28, 179, 179, 0.28);
  animation: progressGlow 3s ease-in-out infinite;
  /* width is applied inline by script.js */
}

/* ── Terminal card ── */

/* Header row: traffic-light dots + path label */
.terminal-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 1rem;
}

.terminal-top p {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Decorative macOS-style window control dots */
.terminal-dots {
  display: flex;
  gap: 0.35rem;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff7a7a; } /* Red */
.terminal-dots span:nth-child(2) { background: #ffd36e; } /* Amber */
.terminal-dots span:nth-child(3) { background: #6dffb3; } /* Green */

/* Terminal log area */
.terminal-body {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
  min-height: 150px;
}

/* FIX: Unified animation class for ALL terminal lines.
   Previously: HTML lines used CSS @keyframes, JS-added lines used inline
   style transitions — two separate animation systems on the same element.
   Now every line (static or JS-appended) uses .term-line for consistency. */
.terminal-body .term-line {
  margin: 0 0 0.55rem;
  opacity: 0;
  transform: translateY(8px);
  animation: terminalLine 0.45s forwards;
  /* animation-delay is set inline on each element to stagger the lines */
}

/* Teal $ prefix on each terminal line */
.terminal-accent {
  color: var(--accent);
}


/* ── 7. FEATURE STRIP ─────────────────────────────────────────
   Three service-highlight cards in a horizontal row.
──────────────────────────────────────────────────────────────── */
.feature-strip {
  padding: 1.5rem 0 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-box {
  padding: 1.4rem;
}

/* Emoji icon in a small tinted square */
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.9rem;
  font-size: 1.3rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(28, 179, 179, 0.16),
    rgba(140, 152, 168, 0.12)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-box h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}

.feature-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}


/* ── 8. BOTTOM BANNER ─────────────────────────────────────────
   Final CTA strip just above the footer.
──────────────────────────────────────────────────────────────── */
.bottom-banner {
  padding: 1rem 0 4rem;
}

.bottom-card {
  padding: 1.5rem;
}


/* ── 9. FOOTER ────────────────────────────────────────────────
──────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 0 0 2rem;
}

.footer-inner {
  color: var(--muted);
  font-size: 0.92rem;
}


/* ── 10. REVEAL / SCROLL ANIMATIONS ──────────────────────────
   .reveal elements start hidden (opacity 0, shifted down).
   The IntersectionObserver in script.js adds .visible when they
   enter the viewport, which triggers the CSS transition.
   Use .delay-1/2/3 on siblings to stagger their entrances.
──────────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity   700ms ease,
    transform 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 120ms; }
.delay-2 { transition-delay: 240ms; }
.delay-3 { transition-delay: 360ms; }


/* ── 11. KEYFRAME ANIMATIONS ──────────────────────────────────
──────────────────────────────────────────────────────────────── */

/* Pulsing dot — scale and opacity oscillation */
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1;    }
  50%       { transform: scale(1.18); opacity: 0.72; }
}

/* Ambient orb drift — gentle diagonal float */
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0);        }
  50%       { transform: translate(18px, -22px); }
}

/* Grid drift — slow downward movement for subtle motion */
@keyframes driftGrid {
  from { transform: translateY(0);    }
  to   { transform: translateY(42px); }
}

/* Progress bar brightness pulse */
@keyframes progressGlow {
  0%, 100% { filter: brightness(1);    }
  50%       { filter: brightness(1.18); }
}

/* Terminal line fade-up — shared by .term-line on all log lines */
@keyframes terminalLine {
  to { opacity: 1; transform: translateY(0); }
}


/* ── 12. RESPONSIVE BREAKPOINTS ───────────────────────────────
──────────────────────────────────────────────────────────────── */

/* Tablet — collapse multi-column grids to a single column */
@media (max-width: 1080px) {
  .hero-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  /* hero-points intentionally stays at 2 columns here — 2×2 is fine on tablet */

  .hero-copy h1 {
    max-width: 100%; /* Remove ch-based cap on narrower viewports */
  }
}

/* Mobile — stack everything, tighten padding */
@media (max-width: 720px) {
  .site-header {
    padding-top: 1rem;
  }

  /* Stack these flex rows vertically on small screens */
  .nav,
  .bottom-card,
  .footer-inner,
  .card-header,
  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Status pill hidden — no room in the header bar on mobile */
  .nav-pill {
    display: none;
  }

  .hero {
    padding-top: 3rem;
  }

  /* Reduce card padding and border radius on mobile */
  .hero-copy,
  .status-card,
  .terminal-card,
  .feature-box,
  .bottom-card {
    padding: 1.1rem;
    border-radius: 22px;
  }

  /* Collapse hero-points to single column on small phones */
  .hero-points {
    grid-template-columns: 1fr;
  }

  /* Stack CTA buttons full-width */
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
    display: inline-flex;
  }

  .footer-inner {
    gap: 0.5rem;
  }
}

/* Accessibility — respect the user's reduced-motion OS preference.
   Disables all animations and transitions site-wide. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  /* Make reveal elements immediately visible (skip the fade-in) */
  .reveal {
    opacity: 1;
    transform: none;
  }
}
