/* Nerdearla Style Guide — component-specific styles */

/* ============================================
   1. STICKY NAV + SCROLL SPY
   ============================================ */
.sg-nav-wrapper {
  z-index: 100;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow 0.3s;
}
.sg-nav-wrapper.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
/* Spacer injected by JS when nav becomes fixed */
.sg-nav-spacer {
  display: none;
}
.sg-nav-spacer.active {
  display: block;
}
.sg-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.5rem 0;
}
.sg-nav::-webkit-scrollbar { display: none; }
.sg-nav a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #849F9D;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}
.sg-nav a:hover {
  border-color: #FFBA00;
  color: #FFBA00;
  background: rgba(255,186,0,0.08);
}
.sg-nav a.active {
  border-color: #FFBA00;
  color: #FFBA00;
  background: rgba(255,186,0,0.12);
}

/* Mobile: collapsible TOC (9) */
@media (max-width: 768px) {
  .sg-nav {
    justify-content: flex-start;
    gap: 0.3rem;
    padding: 0.4rem 0;
  }
  .sg-nav a {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }
}

/* ============================================
   2. SCROLL ANIMATIONS (3)
   ============================================ */
.sg-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.sg-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   LOGO GRID
   ============================================ */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.logo-card {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
}
.logo-card:hover {
  border-color: #444;
  transform: translateY(-2px);
}
.logo-card .logo-card__preview {
  background: #000;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}
.logo-card img {
  max-width: 100%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
}
.logo-card.light .logo-card__preview { background: #f0f0f0; }
.logo-card .label {
  font-family: var(--font-alt);
  font-size: 11px;
  color: #849F9D;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 16px;
  font-weight: 600;
}
.logo-card__download {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 13px;
  z-index: 2;
}
.logo-card__download:hover {
  background: rgba(255,186,0,0.15);
  border-color: rgba(255,186,0,0.4);
  color: #FFBA00;
}

/* Regional logo grid — smaller cards */
.logo-grid--regional {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.logo-grid--regional .logo-card .logo-card__preview {
  min-height: 120px;
  padding: 24px;
}
.logo-grid--regional .logo-card img {
  max-height: 80px;
}

/* ============================================
   COLOR SWATCHES
   ============================================ */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.swatch {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #222;
  transition: transform 0.2s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch-color { height: 100px; }
.swatch-info { padding: 16px; background: #111; }
.swatch-name {
  font-family: var(--font-alt);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.swatch-meta {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  color: #666;
  line-height: 1.8;
}
.hex-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
}
.hex-copy:hover {
  background: rgba(255,186,0,0.12);
  color: #FFBA00;
}
.hex-copy__icon { opacity: 0.4; font-size: 12px; transition: opacity 0.2s; }
.hex-copy:hover .hex-copy__icon { opacity: 1; }
.hex-copy.copied { color: #00ACA8; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.type-specimen {
  margin: 32px 0;
  padding: 40px;
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
}
.type-specimen .sample {
  font-size: 48px;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.type-specimen .meta {
  font-family: var(--font-alt);
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.type-hierarchy { margin: 32px 0; }
.type-hierarchy .level {
  padding: 20px 0;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: baseline;
  gap: 24px;
}
.type-hierarchy .level-label {
  font-family: var(--font-alt);
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 120px;
  flex-shrink: 0;
}

/* ============================================
   VOICE / DO & DON'T CARDS
   ============================================ */
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}
.voice-card {
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #222;
}
.voice-card.do {
  background: rgba(0,172,168,0.05);
  border-color: rgba(0,172,168,0.2);
}
.voice-card.dont {
  background: rgba(255,50,60,0.05);
  border-color: rgba(255,50,60,0.2);
}
.voice-card .tag {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 600;
}
.voice-card.do .tag { color: var(--nerd-teal); }
.voice-card.dont .tag { color: var(--nerd-red); }
.voice-card p { color: #aaa; font-size: 14px; margin-bottom: 8px; }

/* Visual Do/Don't examples (5) */
.visual-example {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.visual-example__item {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid;
  transition: transform 0.2s;
}
.visual-example__item:hover { transform: translateY(-2px); }
.visual-example__item--do { border-color: rgba(0,172,168,0.4); }
.visual-example__item--dont { border-color: rgba(255,50,60,0.4); }
.visual-example__item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.visual-example__caption {
  padding: 10px 14px;
  font-size: 12px;
  font-family: var(--font-alt);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.visual-example__item--do .visual-example__caption {
  background: rgba(0,172,168,0.08);
  color: var(--nerd-teal);
}
.visual-example__item--dont .visual-example__caption {
  background: rgba(255,50,60,0.08);
  color: var(--nerd-red);
}

/* ============================================
   RULES LIST
   ============================================ */
.rules-list { margin-top: 24px; }
.rule {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #1e1e1e;
  align-items: flex-start;
}
.rule-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.rule-icon.yes { background: var(--nerd-teal); color: var(--nerd-black); }
.rule-icon.no { background: var(--nerd-red); color: white; }
.rule p { margin: 0; }

/* ============================================
   SOCIAL
   ============================================ */
.social-handles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.handle {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 12px 20px;
  font-family: var(--font-alt);
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  transition: all 0.2s;
}
a.handle { text-decoration: none; color: inherit; }
a.handle:hover {
  border-color: #FFBA00;
  color: #FFBA00;
  background: rgba(255,186,0,0.05);
}
.handle span { color: #555; font-size: 11px; display: block; margin-bottom: 4px; }

/* ============================================
   PHOTO EXAMPLES + LIGHTBOX (8)
   ============================================ */
.photo-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.photo-examples img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #222;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.photo-examples img:hover {
  transform: scale(1.02);
  border-color: #FFBA00;
}

/* Lightbox */
.sg-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.3s;
}
.sg-lightbox.open {
  display: flex;
  opacity: 1;
}
.sg-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.sg-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.sg-lightbox__close:hover {
  background: rgba(255,186,0,0.2);
  border-color: #FFBA00;
  color: #FFBA00;
}
.sg-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.sg-lightbox__nav:hover {
  background: rgba(255,186,0,0.15);
  border-color: #FFBA00;
  color: #FFBA00;
}
.sg-lightbox__nav--prev { left: 20px; }
.sg-lightbox__nav--next { right: 20px; }

/* ============================================
   APPLICATIONS SHOWCASE (6)
   ============================================ */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.app-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #222;
  background: #111;
  transition: transform 0.2s, border-color 0.2s;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: #333;
}
.app-card__preview {
  height: 200px;
  overflow: hidden;
}
.app-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.app-card__info {
  padding: 14px 16px;
}
.app-card__title {
  font-family: var(--font-alt);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ccc;
  margin-bottom: 4px;
}
.app-card__desc {
  font-size: 12px;
  color: #666;
}

/* ============================================
   REGIONAL BADGES
   ============================================ */
.region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-alt);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,186,0,0.08);
  color: #FFBA00;
  border: 1px solid rgba(255,186,0,0.2);
  margin-bottom: 16px;
}

/* ============================================
   SECTION SPACING
   ============================================ */
.press-section + .press-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 3rem;
  padding-top: 3rem;
}
.press-section h2 { margin-bottom: 1rem; }
.press-section h3 { margin-top: 2.5rem; margin-bottom: 1rem; }
.press-section p + h3 { margin-top: 2.5rem; }

/* ============================================
   BACK TO TOP
   ============================================ */
.sg-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(255,186,0,0.15);
  border: 1px solid rgba(255,186,0,0.3);
  color: #FFBA00;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  z-index: 90;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  text-decoration: none;
}
.sg-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.sg-back-to-top:hover {
  background: rgba(255,186,0,0.25);
  border-color: #FFBA00;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .voice-grid { grid-template-columns: 1fr; }
  .visual-example { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: 1fr 1fr; }
  .logo-grid--regional { grid-template-columns: 1fr 1fr; }
  .type-hierarchy .level { flex-direction: column; gap: 8px; }
  .type-hierarchy .level-label { width: auto; }
  .type-specimen .sample { font-size: 32px; }
}
@media (max-width: 768px) {
  .photo-examples { grid-template-columns: repeat(2, 1fr); }
  .applications-grid { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .photo-examples { grid-template-columns: 1fr; }
  .type-specimen { padding: 24px; }
  .type-specimen .sample { font-size: 24px; }
}
