/* ===== Mobile-specific improvements & hamburger menu ===== */

/* Hamburger button (visible only on mobile) */
.nav-burger {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
  margin-right: 8px;
  transition: border-color .2s, color .2s;
}
.nav-burger:hover { color: var(--cherenkov); border-color: var(--line-hi); }
.nav-burger svg { width: 20px; height: 20px; }

@media (max-width: 880px) {
  .nav-burger { display: inline-flex; }
  .menu { display: none !important; }
  .geiger { display: none !important; }
  .audio-toggle { display: none !important; }
  .nav-cta { padding: 8px 14px !important; font-size: 12.5px !important; }
}

/* Mobile slide-in menu */
.mobile-menu-backdrop {
  position: fixed; inset: 0; z-index: 198;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--easing);
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  max-width: 80vw;
  z-index: 199;
  background: linear-gradient(180deg, rgba(10,15,28,0.98) 0%, rgba(5,9,18,0.98) 100%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--line);
  padding: 72px 28px 32px;
  transform: translateX(100%);
  transition: transform .4s var(--easing);
  display: flex;
  flex-direction: column;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a {
  display: block;
  padding: 16px 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  letter-spacing: .04em;
  transition: color .2s;
}
.mobile-menu a:hover, .mobile-menu a:active { color: var(--cherenkov); }
.mobile-menu .menu-foot {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .05em;
  border-top: 1px solid var(--line);
}
.mobile-menu .menu-foot a {
  display: inline;
  padding: 0;
  border: none;
  color: var(--cherenkov);
  font-size: 13px;
}
.mobile-menu-close {
  position: absolute; top: 16px; right: 14px;
  width: 36px; height: 36px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim);
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.mobile-menu-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* ===== Mobile size & padding tweaks ===== */
@media (max-width: 720px) {
  /* Tighten hero on small screens */
  .hero-content { padding: 100px 20px 70px; }
  .hero h1 {
    font-size: clamp(32px, 8vw, 48px) !important;
    line-height: 1.15;
  }
  .hero p.lead {
    font-size: 14px;
    line-height: 1.7;
  }
  .hero-cta { gap: 10px; flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .btn { padding: 12px 22px; font-size: 14px; }
  .scroll-cue { display: none; }

  /* Stats — 2 columns of bigger cards is better */
  .stats { padding: 60px 0; }
  .stats-grid { gap: 0; }
  .stat { padding: 28px 16px; }
  .stat-num { font-size: 38px !important; }
  .stat-label { font-size: 12px; margin-top: 10px; }

  /* Sections breathing room */
  section { padding: 80px 0; }
  .section-head { margin-bottom: 48px; }
  .section-head h2.h2 { font-size: clamp(26px, 6vw, 38px) !important; }

  /* Services — single column, less padding */
  .service { padding: 28px 22px 24px; }
  .service h3 { font-size: 17px; }
  .service p { font-size: 14px; }

  /* Pillars — smaller padding */
  .pillar { padding: 50px 0; gap: 32px; }
  .pillar h3.h3 { font-size: 22px !important; }
  .pillar-visual { aspect-ratio: 4/3; }

  /* About */
  .about-grid { gap: 36px; }
  .about-text p { font-size: 14.5px; }
  .about-facts { grid-template-columns: 1fr 1fr; }
  .about-photos { min-height: auto; }
  .about-photos .photo.big { aspect-ratio: 4/3; }
  .about-photos .photo:not(.big) { aspect-ratio: 1/1; }

  /* Cherenkov */
  .cherenkov { padding: 100px 20px; }
  .cherenkov-content h2.h2 { font-size: clamp(26px, 7vw, 38px) !important; }
  .cherenkov-content p { font-size: 14px; }

  /* Interactive Lab — height shrink (clamped via global.css clamp()) */
  .ilab-stage { height: 56vh; }
  .ilab-hint .h { font-size: 20px; }
  .ilab-legend { font-size: 10px; gap: 8px; bottom: 12px; right: 14px; }
  .ilab-readout { font-size: 10px; top: 12px; left: 14px; }

  /* Lab cards */
  .lab-grid { gap: 16px; }
  .lab-stage { aspect-ratio: 1/1; }
  .lab-card.wide .lab-stage { aspect-ratio: 4/3; }
  .lab-caption { padding: 20px 22px 22px; }
  .lab-caption h4 { font-size: 17px; }
  .lab-caption p { font-size: 13px; }
  .spec-stage { padding: 18px 18px 12px; }
  .spec-info { font-size: 10px; top: 10px; right: 12px; }
  .spec-info .iso { font-size: 11px; }
  .spec-info .energy { font-size: 12px; }
  .spec-info .desc { max-width: 130px; font-size: 10px; }

  /* Coverage */
  .map-card, .types-card { padding: 18px; }
  .map-feed { width: 220px; padding: 12px 14px; font-size: 10px; }
  .ctype-title { font-size: 13.5px; }
  .ctype-meta { font-size: 12px; }

  /* Certs */
  .cert { padding: 18px 16px; }
  .cert-name { font-size: 15px; }
  .cert-meta { font-size: 11.5px; }
  .cert-no { font-size: 10.5px; }

  /* News / Careers */
  .news-item, .job-item { padding: 18px 0; }
  .news-title, .job-title { font-size: 15px; }
  .news-meta { font-size: 11px; }

  /* CTA */
  .cta-band { padding: 90px 20px; }
  .cta-band h2.h2 { font-size: clamp(26px, 7vw, 38px) !important; }

  /* Footer */
  footer { padding: 60px 0 30px; font-size: 13px; }
  .foot-grid { gap: 28px; }
  .foot h4 { font-size: 12px; margin-bottom: 14px; }
  .copy { font-size: 11px; }

  /* General */
  .wrap { padding: 0 20px; }
  .lead { font-size: 14.5px; line-height: 1.75; }
  body { -webkit-text-size-adjust: 100%; }

  /* Disable some heavy effects on mobile */
  #ambient-canvas { opacity: 0.35; }
  .contour-bg { display: none; }

  /* Bigger touch targets for filter / category tabs */
  .nf-tab { min-height: 40px; padding: 9px 14px; font-size: 13px; }
  .news-search { min-height: 40px; }

  /* News detail / notice detail — guarantee side padding on phones */
  .news-detail, .notice-detail, .news-page, .notices-page { padding-inline: 16px; }

  /* Allow news-row inline grid to break to single column on phones (fallback for old inline-style row in case any leak through) */
  .news-row[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .hero-content { padding: 90px 16px 50px; }
  .wrap { padding: 0 16px; }
  .stat { padding: 22px 12px; }
  .stat-num { font-size: 32px !important; }
  .nav-inner { padding: 12px 16px; }
  .brand { font-size: 13.5px; }
  .brand-mark { width: 26px; height: 26px; }
  .nav-cta { padding: 7px 12px !important; font-size: 12px !important; }

  /* Footer 4-cols → single column on very narrow phones */
  .foot-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Allow horizontal scroll for the lab spectrum table to prevent collapse */
  .lab-stage .viz { max-width: 100%; }
}

/* Reduce motion preference - extra respect */
@media (prefers-reduced-motion: reduce) {
  .atom, .atom-shell, .scan-host .scanline, .scroll-cue,
  .live-dot, #cur-ring, #cur-dot { animation: none !important; }
}

/* ===== Cert thumbnail + body restyle ===== */
.cert {
  padding: 0 !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
}
.cert .cert-thumb {
  width: 100%;
  aspect-ratio: 5/3.8;
  background: #f4f6f8;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.cert .cert-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  transition: transform .5s var(--easing);
}
.cert:hover .cert-thumb img { transform: scale(1.06); }
.cert .cert-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.15));
  pointer-events: none;
}
.cert .cert-thumb .zoom-hint {
  position: absolute; bottom: 8px; right: 8px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 12px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .25s, transform .25s;
  backdrop-filter: blur(4px);
}
.cert:hover .cert-thumb .zoom-hint { opacity: 1; transform: translateY(0); }
.cert .cert-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cert .cert-no {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .12em;
  margin-bottom: 4px;
}
.cert .cert-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--text);
}
.cert .cert-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: auto;
  padding-top: 6px;
}
@media (max-width: 720px) {
  .cert .cert-thumb { aspect-ratio: 5/3.5; }
  .cert .cert-name { font-size: 14px; }
  .cert .cert-meta { font-size: 11px; }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0;
  z-index: 220;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(3,7,15,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 40px 24px 90px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; animation: lbFade .3s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  cursor: default;
}
.lightbox .lb-cap {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: .04em;
  text-align: center;
  max-width: 90vw;
  padding: 8px 16px;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  cursor: default;
}
.lightbox .lb-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  display: grid; place-items: center;
  transition: background .2s;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,0.2); }
