/* ═══════════════════════════════════════════════════════════════
   ABC REPAIR — app.css
   Global: CSS vars, reset, nav, footer, background layers,
   scan beam, circuit grid, noise, shared card animations
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  --bg:    #050d14;
  --green: #73BE9E;
  --cta:   #0D8A68;
  --navy:  #0D1B2A;
  --navy2: #1A3C6B;
  --text:  rgba(255, 255, 255, 0.75);
  --muted: rgba(255, 255, 255, 0.4);
  --dim:   rgba(255, 255, 255, 0.22);
  --card-bg: rgba(255, 255, 255, 0.02);
  --border: rgba(115, 190, 158, 0.1);
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  font-family: Inter, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Skip Link (accessibility) ──────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--cta);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

/* ── Background Layers ──────────────────────────────────────── */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.circuit-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.022;
  background-image:
    linear-gradient(rgba(115, 190, 158, 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(115, 190, 158, 1) 1px, transparent 1px);
  background-size: 48px 48px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.017;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── Scan Beam (green — all pages except 404) ───────────────── */
.scan-beam {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(13, 138, 104, 0.8),
    rgba(115, 190, 158, 0.9),
    rgba(13, 138, 104, 0.8),
    transparent
  );
  box-shadow: 0 0 20px rgba(13, 138, 104, 0.5);
  z-index: 200;
  pointer-events: none;
  animation: scanBeam 5s linear infinite;
}

@keyframes scanBeam {
  0%   { top: -3px; }
  100% { top: 100vh; }
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 13, 20, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(115, 190, 158, 0.08);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--green);
  text-decoration: none;
}

.logo-badge {
  background: var(--green);
  color: var(--bg);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(115, 190, 158, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color 0.15s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

.nav-links a.active {
  color: var(--green);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  background: var(--cta) !important;
  color: #fff !important;
  padding: 9px 20px;
  border-radius: 7px;
  font-weight: 600 !important;
  transition: box-shadow 0.25s, transform 0.2s !important;
}

.nav-cta:hover {
  box-shadow: 0 0 20px rgba(13, 138, 104, 0.5) !important;
  transform: translateY(-1px) !important;
}

.nav-cta::after {
  display: none !important;
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 20, 0.98);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-mobile-overlay.open {
  display: flex;
}

.nav-mobile-overlay a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-mobile-overlay a:hover {
  color: var(--green);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  padding: 64px 56px 40px;
  border-top: 1px solid rgba(115, 190, 158, 0.08);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 48px;
  align-items: start;
}

.footer-brand .nav-logo {
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.7;
}

.footer-col h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col ul a:hover {
  color: var(--green);
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(115, 190, 158, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--dim);
}

/* ── Shared Card Shell ──────────────────────────────────────── */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s var(--transition-smooth),
              box-shadow 0.3s var(--transition-smooth),
              border-color 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 40px rgba(13, 138, 104, 0.07);
  border-color: rgba(115, 190, 158, 0.2);
}

/* ── Rotating Neon Border ───────────────────────────────────── */
.card-neon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--angle),
    transparent 70%,
    rgba(115, 190, 158, 0.5) 85%,
    rgba(13, 138, 104, 0.8) 90%,
    rgba(115, 190, 158, 0.5) 95%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateBorder 5s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes rotateBorder {
  to { --angle: 360deg; }
}

/* ── Boot Scan ──────────────────────────────────────────────── */
.boot-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(13, 138, 104, 0.7),
    rgba(115, 190, 158, 0.95),
    rgba(13, 138, 104, 0.7),
    transparent
  );
  box-shadow: 0 0 14px rgba(13, 138, 104, 0.6);
  top: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
}

.boot-active .boot-scan {
  animation: cardBoot 0.9s ease-out forwards;
}

@keyframes cardBoot {
  0%   { top: 0;    opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Corner Lock Brackets ───────────────────────────────────── */
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s var(--transition-smooth);
  z-index: 5;
}

.corner svg {
  width: 100%;
  height: 100%;
}

.corner-tl { top: 14px;    left: 14px;  transform: translate(-5px, -5px); }
.corner-tr { top: 14px;    right: 14px; transform: translate(5px, -5px);  transition-delay: 0.05s; }
.corner-bl { bottom: 14px; left: 14px;  transform: translate(-5px, 5px);  transition-delay: 0.08s; }
.corner-br { bottom: 14px; right: 14px; transform: translate(5px, 5px);   transition-delay: 0.12s; }

.card:hover .corner {
  opacity: 1;
  transform: translate(0, 0);
}

/* ── Shimmer Sweep ──────────────────────────────────────────── */
.shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 2;
}

.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(115, 190, 158, 0.05) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
}

.card:hover .shimmer::after {
  transform: translateX(200%);
  transition: transform 0.65s ease;
}

/* ── Scroll Reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--transition-smooth),
              transform 0.7s var(--transition-smooth);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Section Shared ─────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 2;
  padding: 96px 56px;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cta);
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
}

.section-title span {
  color: var(--green);
}

.section-desc {
  font-size: 16px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.8;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s;
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--cta);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 0 28px rgba(13, 138, 104, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
  border-color: rgba(115, 190, 158, 0.4);
  color: var(--green);
  transform: translateY(-1px);
}

/* ── Windows Terminal Card ──────────────────────────────────── */
.term-card {
  background: var(--navy);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(115, 190, 158, 0.1);
}

.term-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 38px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.term-tabs {
  display: flex;
  gap: 4px;
}

.term-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
}

.term-tab.active {
  background: rgba(115, 190, 158, 0.08);
  color: var(--green);
}

.term-controls {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--dim);
}

.term-body {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  position: relative;
}

.term-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
}

.term-prompt { color: var(--cta); }
.term-cmd    { color: var(--green); }
.term-key    { color: var(--muted); }
.term-val    { color: rgba(255, 255, 255, 0.7); }
.term-ok     { color: var(--cta); }
.term-online { color: var(--green); }

/* ── Count Strip ────────────────────────────────────────────── */
.count-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(115, 190, 158, 0.06);
  border: 1px solid rgba(115, 190, 158, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.count-item {
  padding: 40px 32px;
  background: var(--bg);
  text-align: center;
}

.count-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  margin-bottom: 8px;
}

.count-label {
  font-size: 13px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Filter Pills ───────────────────────────────────────────── */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.pill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(115, 190, 158, 0.08) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.pill:hover::after,
.pill.active::after {
  transform: translateX(200%);
}

.pill:hover,
.pill.active {
  border-color: rgba(115, 190, 158, 0.4);
  color: var(--green);
  background: rgba(115, 190, 158, 0.05);
}

.pill:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

/* ── Category Tag Colors ────────────────────────────────────── */
.tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500; padding: 3px 10px; border-radius: 20px; letter-spacing: 0.5px; }
.tag-networking    { background: rgba(26, 60, 107, 0.6);  color: #6fa3d8; border: 1px solid rgba(111, 163, 216, 0.2); }
.tag-security      { background: rgba(107, 26, 26, 0.6);  color: #d87070; border: 1px solid rgba(216, 112, 112, 0.2); }
.tag-hardware      { background: rgba(107, 80, 26, 0.6);  color: #d8ab70; border: 1px solid rgba(216, 171, 112, 0.2); }
.tag-tips          { background: rgba(26, 107, 75, 0.6);  color: #70d8a8; border: 1px solid rgba(112, 216, 168, 0.2); }
.tag-webdev        { background: rgba(75, 26, 107, 0.6);  color: #a870d8; border: 1px solid rgba(168, 112, 216, 0.2); }
.tag-infrastructure{ background: rgba(26, 60, 107, 0.6);  color: #6fa3d8; border: 1px solid rgba(111, 163, 216, 0.2); }
.tag-desktop       { background: rgba(13, 27, 42, 0.8);   color: var(--green); border: 1px solid rgba(115, 190, 158, 0.2); }

/* ── Glitch Headline ────────────────────────────────────────── */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font: inherit;
  color: inherit;
}

.glitch::before {
  color: rgba(255, 80, 80, 0.7);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  transform: translateX(0);
}

.glitch::after {
  color: rgba(13, 138, 104, 0.7);
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
  transform: translateX(0);
}

.glitch.glitching::before { animation: glitchBefore 0.4s steps(2) forwards; }
.glitch.glitching::after  { animation: glitchAfter  0.4s steps(2) forwards; }

@keyframes glitchBefore {
  0%   { transform: translateX(0);    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); }
  25%  { transform: translateX(-4px); clip-path: polygon(0 15%, 100% 15%, 100% 38%, 0 38%); }
  50%  { transform: translateX(3px);  clip-path: polygon(0 22%, 100% 22%, 100% 42%, 0 42%); }
  75%  { transform: translateX(-2px); clip-path: polygon(0 18%, 100% 18%, 100% 35%, 0 35%); }
  100% { transform: translateX(0);    clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
}

@keyframes glitchAfter {
  0%   { transform: translateX(0);   clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); }
  25%  { transform: translateX(4px); clip-path: polygon(0 62%, 100% 62%, 100% 78%, 0 78%); }
  50%  { transform: translateX(-3px);clip-path: polygon(0 58%, 100% 58%, 100% 72%, 0 72%); }
  75%  { transform: translateX(2px); clip-path: polygon(0 63%, 100% 63%, 100% 76%, 0 76%); }
  100% { transform: translateX(0);   clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
}

/* ── Accessibility: Reduced Motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .scan-beam { display: none; }
}

/* ── Focus Rings ────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    padding: 0 24px;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .section {
    padding: 64px 24px;
  }
  .footer {
    padding: 48px 24px 32px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .count-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
