/* CipherKit — layout.css
   Header, footer, homepage, category pages */

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom:   1px solid var(--border);
  background:      rgba(7,9,13,.88);
  backdrop-filter: blur(16px);
  position:        sticky;
  top:             0;
  z-index:         200;
}

.header-inner {
  max-width:  1280px;
  margin:     0 auto;
  padding:    0 24px;
  height:     56px;
  display:    flex;
  align-items: center;
  gap:        24px;
}

/* Logo */
.logo {
  display:     flex;
  align-items: center;
  gap:         10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:focus-visible {
  outline:        2px solid var(--green);
  outline-offset: 3px;
  border-radius:  4px;
}
.logo-mark {
  width:          30px;
  height:         30px;
  border-radius:  6px;
  display:        grid;
  place-items:    center;
  flex-shrink:    0;
  overflow:       hidden;
}
.logo-mark svg { width: 30px; height: 30px; display: block; }

.logo-name {
  font-family:  var(--sans);
  font-weight:  800;
  font-size:    17px;
  color:        var(--text);
  letter-spacing: -.4px;
}
.logo-name em { color: var(--green); font-style: normal; }

/* Nav */
.header-nav {
  display:  flex;
  gap:      4px;
  flex:     1;
  align-items: center;
}
.nav-link {
  display:     inline-flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
  color:       var(--muted);
  padding:     6px 12px;
  border-radius: 6px;
  transition:  all .15s;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}
.nav-link:hover {
  color:      var(--text);
  background: var(--sf2);
  opacity:    1;
}
.nav-icon {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width:       14px;
  height:      14px;
}
.nav-icon svg { width: 14px; height: 14px; display: block; }

/* Active nav link */
.nav-link--active {
  color: var(--green) !important;
  opacity: 1 !important;
}
.nav-link--active::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--green);
  border-radius: 1px;
  margin-top: 2px;
}

/* Header badges */
.header-badges { display: flex; gap: 10px; margin-left: auto; }

.hdr-badge {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
  color:       var(--muted);
  border:      1px solid var(--border);
  border-radius: 20px;
  padding:     4px 11px;
  white-space: nowrap;
}
.live-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--green);
  flex-shrink:   0;
  animation:     blink 2.4s ease-in-out infinite;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top:  1px solid var(--border);
  margin-top:  80px;
  background:  var(--surface);
}

.footer-inner {
  max-width:      var(--max-w);
  margin:         0 auto;
  padding:        48px 24px;
  display:        grid;
  grid-template-columns: 260px 1fr;
  gap:            48px;
}

.footer-brand .logo { margin-bottom: 14px; }
.footer-tagline {
  font-size:     12px;
  color:         var(--muted);
  margin-bottom: 14px;
  line-height:   1.6;
}
.footer-github {
  font-size:  12px;
  color:      var(--muted);
  border:     1px solid var(--border);
  padding:    5px 12px;
  border-radius: 6px;
  display:    inline-block;
  transition: all .15s;
}
.footer-github:hover {
  color:         var(--green);
  border-color:  var(--gdim);
  opacity:       1;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.footer-col h3 {
  display:       flex;
  align-items:   center;
  gap:           6px;
  font-size:     12px;
  color:         var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 12px;
  line-height:   1;
}
.footer-icon {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width:       14px;
  height:      14px;
}
.footer-icon svg { width: 14px; height: 14px; display: block; }
.footer-col ul {
  list-style: none;
  display:    flex;
  flex-direction: column;
  gap:        8px;
}
.footer-col ul li a {
  font-size: 12px;
  color:     var(--muted);
  transition: color .15s;
}
.footer-col ul li a:hover { color: var(--green); opacity: 1; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding:    16px 24px;
  text-align: center;
}
.footer-bottom p {
  font-size: 12px;
  color:     var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--green); opacity: 1; }

/* ── HERO (HOMEPAGE) ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding:    64px 24px 48px;
}
.hero-inner { max-width: 680px; margin: 0 auto; }

.hero-pill {
  display:       inline-flex;
  align-items:   center;
  gap:           7px;
  font-size:     12px;
  color:         var(--green);
  letter-spacing: .1em;
  text-transform: uppercase;
  border:        1px solid var(--gdim);
  border-radius: 20px;
  padding:       5px 14px;
  margin-bottom: 20px;
  line-height:   1;
}
.hero-pill-icon {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width:       12px;
  height:      12px;
}
.hero-pill-icon svg { width: 12px; height: 12px; display: block; }
.hero-pill svg { flex-shrink: 0; }

.hero h1 {
  font-size:     clamp(32px, 5vw, 54px);
  margin-bottom: 18px;
  background:    linear-gradient(120deg, var(--text), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size:     14px;
  margin-bottom: 32px;
  color:         var(--muted);
  line-height:   1.8;
}

/* Search bar */
.hero-search {
  position:      relative;
  margin-bottom: 24px;
}
.hero-search input {
  width:           100%;
  max-width:       500px;
  background:      #0a0a0a;
  border:          1px solid #2a2a2a;
  border-radius:   8px;
  color:           var(--text);
  font-family:     var(--mono);
  font-size:       16px;
  padding:         12px 18px;
  outline:         none;
  transition:      border-color .2s, box-shadow .2s;
}
.hero-search input:focus {
  border-color: #00ff88;
  box-shadow:   0 0 0 3px rgba(0,255,136,0.12);
}
.hero-search input::placeholder { color: var(--muted); }

/* Hub quick links */
.hub-pills {
  display:     flex;
  gap:         10px;
  justify-content: center;
  flex-wrap:   wrap;
}
.hub-pill {
  display:     inline-flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
  color:       var(--muted);
  border:      1px solid var(--border);
  border-radius: 20px;
  padding:     6px 14px;
  transition:  all .15s;
  line-height: 1;
}
.hub-pill:hover {
  color:         var(--green);
  border-color:  var(--gdim);
  opacity:       1;
  background:    rgba(61,214,140,.04);
}
.hub-pill-icon {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width:       13px;
  height:      13px;
}
.hub-pill-icon svg { width: 13px; height: 13px; display: block; }

/* ── TOOLS GRID ──────────────────────────────────────────────────────────── */
.hubs-wrap {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 24px 80px;
}

.hub-section {
  margin-bottom: 64px;
}

.hub-header {
  margin-bottom: 24px;
}
.hub-header h2 {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-bottom: 6px;
}
.hub-icon {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width:       20px;
  height:      20px;
}
.hub-icon svg { width: 20px; height: 20px; display: block; }
.hub-header p {
  font-size: 13px;
}

/* Hub featured section */
.hub-featured {
  max-width: var(--max-w);
  margin: 0 auto 32px;
  padding: 0 24px;
}
.hub-featured h2 {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}
.hub-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.featured-card {
  display: block;
  background: var(--sf2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  text-decoration: none;
  transition: all .15s;
  position: relative;
}
.featured-card:hover {
  border-color: var(--gdim);
  background: var(--surface);
  opacity: 1;
}
.featured-card-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}
.featured-card-tag {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.featured-card-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--green);
  font-size: 16px;
  opacity: 0;
  transition: opacity .15s;
}
.featured-card:hover .featured-card-arrow { opacity: 1; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.tool-card {
  display:        block;
  background:     var(--surface);
  border:         1px solid var(--border);
  border-radius:  var(--r-lg);
  padding:        18px;
  text-decoration: none;
  transition:     all .2s;
  color:          inherit;
}
.tool-card:hover {
  border-color: var(--green);
  background:   rgba(61,214,140,.04);
  transform:    translateY(-2px);
  opacity:      1;
}
.tool-card-title {
  font-family:   var(--sans);
  font-weight:   700;
  font-size:     14px;
  color:         var(--text);
  margin-bottom: 6px;
}
.tool-card-tag {
  font-size:  12px;  /* was 11px — bumped for Lighthouse legibility */
  color:      var(--muted);
  line-height: 1.5;
}

/* Search results section */
.search-results {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 24px 40px;
}
.no-results {
  color:     var(--muted);
  font-size: 13px;
  grid-column: 1/-1;
  padding:   16px 0;
}

/* ── CATEGORY PAGE ───────────────────────────────────────────────────────── */
.cat-header {
  background:  var(--surface);
  border-bottom: 1px solid var(--border);
  padding:     48px 24px 32px;
  margin-bottom: 32px;
}
.cat-header-inner {
  max-width: var(--max-w);
  margin:    0 auto;
}
.cat-header-inner h1 {
  display:     flex;
  align-items: center;
  gap:         10px;
}
.cat-desc {
  font-size: 14px;
  margin-top: 8px;
}
.tools-grid-wrap {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 24px 80px;
}

/* ── BREADCRUMB ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-size:   12px;
  color:       var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green); opacity: 1; }
/* ── NAV SEARCH ──────────────────────────────────────────────────────────── */
.nav-search-wrapper {
  position: relative;
  flex: 0 1 260px;
  margin: 0 8px;
}
#nav-search {
  width: 100%;
  background: var(--gdim);
  border: 1px solid rgba(61,214,140,.2);
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .3s, background .2s;
  touch-action: manipulation;
}
#nav-search:focus {
  border-color: #00ff88;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,255,136,0.12);
}
#nav-search::placeholder { color: rgba(61,214,140,.4); }

.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.nav-search-result {
  display: block;
  padding: 9px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: max(14px, 0.85rem); /* Prevents mobile zoom */
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.nav-search-result:last-child { border-bottom: none; }
.nav-search-result:hover,
.nav-search-result.active { background: var(--sf2); color: var(--green); opacity: 1; }
.nav-search-result mark {
  background: rgba(61,214,140,.2); color: var(--green); border-radius: 2px;
}

/* ── GITHUB STAR BADGE ───────────────────────────────────────────────────── */
.gh-stars-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #aaa;
  font-size: 0.8rem;
  border: 1px solid #1e1e1e;
  border-radius: 4px;
  padding: 4px 10px;
  text-decoration: none;
  background: #111;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.gh-stars-badge:hover { border-color: var(--green); color: var(--green); opacity: 1; }
.gh-stars-badge::after {
  content: 'Like this tool? Star it on GitHub — it helps others find it';
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1a1a1a;
  border: 1px solid #1e1e1e;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #aaa;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 100;
}
.gh-stars-badge:hover::after { opacity: 1; }

/* ── HOMEPAGE SEARCH GLOW ────────────────────────────────────────────────── */
.search-glow-wrapper {
  position: relative;
  border-radius: 10px;
  display: inline-block;
  width: 100%;
  max-width: 500px;        /* ← ADD THIS — matches input max-width */
  padding: 2px;            /* ← ADD THIS — gives gradient 2px breathing room */
}

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

.search-glow-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: conic-gradient(
    from var(--ck-angle),
    transparent 0deg,
    #00ff88 60deg,
    #00d4ff 120deg,
    transparent 180deg
  );
  animation: ck-spin 3s linear infinite;
  z-index: 0;
  opacity: 0.4;
  transition: opacity .3s ease;
}

.search-glow-wrapper:focus-within::before {
  opacity: 0.9;
}

.search-glow-wrapper > * {
  position: relative;
  z-index: 1;
  border-radius: 8px;         /* match input's own border-radius */
  background: #0a0a0a;        /* solid background so gradient only shows as border */
}

@keyframes ck-spin {
  to { --ck-angle: 360deg; }
}

/* Fallback for browsers that don't support @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .search-glow-wrapper::before {
    background: linear-gradient(90deg, #00ff88, #00d4ff, #00ff88);
    animation: ck-slide 2s linear infinite;
  }
  @keyframes ck-slide {
    0%   { opacity: 0.4; }
    50%  { opacity: 0.9; }
    100% { opacity: 0.4; }
  }
}

.breadcrumb [aria-current="page"] { color: var(--text); }

/* ── HAMBURGER (hidden on desktop) ────────────────────────────────────── */
.hamburger-btn {
  display:    none;
  background: none;
  border:     none;
  color:      var(--green);
  font-size:  1.4rem;
  cursor:     pointer;
  padding:    4px;
  margin-left: auto;
  line-height: 1;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .header-badges { display: none; }
  .nav-search-wrapper { display: none; }

  .header-nav {
    display:        none;
    position:       absolute;
    top:            56px;
    left:           0;
    right:          0;
    background:     #111;
    flex-direction: column;
    gap:            0;
    z-index:        199;
    border-bottom:  1px solid #1e1e1e;
  }
  .header-nav.nav-open {
    display: flex;
  }
  .header-nav .nav-link {
    padding:       14px 24px;
    border-radius: 0;
    color:         #ccc;
    font-size:     13px;
    width:         100%;
  }
  .header-nav .nav-link:hover,
  .header-nav .nav-link:focus {
    color:      var(--green);
    background: rgba(61,214,140,.06);
  }
  .header-nav .nav-link--active {
    color: var(--green) !important;
  }

  .footer-inner  {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hub-featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}
