/* =========================================================
   NewTechLab — base stylesheet
   Industrial / technical dark theme. Mobile-first.
   No external fonts. No JS dependencies.
   ========================================================= */

:root {
  --bg: #0a0f1a;
  --bg-elev: #121826;
  --bg-elev-2: #1a2235;
  --border: #233049;
  --text: #e6ebf2;
  --text-dim: #9aa6bc;
  --text-mute: #6b7790;
  --brand-blue: #2563eb;
  --brand-blue-hi: #3b82f6;
  --brand-red: #e11d2e;
  --brand-red-hi: #ef4444;
  --accent: var(--brand-blue);

  --maxw: 1180px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 4px;
  --radius-lg: 8px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow: 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand-blue-hi); text-decoration: none; }
a:hover, a:focus-visible { color: #fff; text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.25rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-red);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* =================== HEADER ===================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 1rem;
  position: relative;
}

.brand img { height: 64px; width: auto; }
@media (max-width: 600px) { .brand img { height: 52px; } }

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--brand-blue-hi); border-bottom-color: var(--brand-blue-hi); }
.site-nav a[aria-current="page"] { color: var(--brand-red-hi); border-bottom-color: var(--brand-red-hi); }

/* mobile menu (CSS-only) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
}
.nav-toggle-label span {
  display: block;
  height: 2px;
  background: var(--text);
  margin: 6px 0;
  transition: transform 0.2s;
}

@media (max-width: 760px) {
  .nav-toggle-label { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .site-nav li { border-top: 1px solid var(--border); }
  .site-nav li:first-child { border-top: none; }
  .site-nav a {
    display: block;
    padding: 0.85rem var(--gutter);
    border-bottom: none;
  }
  .nav-toggle:checked ~ .site-nav { max-height: 80vh; }
}

/* =================== HERO ===================== */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0;
  background:
    radial-gradient(80% 60% at 80% 20%, rgba(37,99,235,0.18), transparent 60%),
    radial-gradient(60% 50% at 10% 80%, rgba(225,29,46,0.12), transparent 60%),
    linear-gradient(180deg, #0a0f1a 0%, #0d1322 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { display: grid; gap: 1.5rem; max-width: 760px; }
.hero h1 { margin: 0; }
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-red-hi);
  margin-bottom: 0.5rem;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 60ch;
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* =================== BUTTONS ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.05s, background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-red); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--brand-red-hi); color: #fff; text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover, .btn-secondary:focus-visible { border-color: var(--brand-blue-hi); color: #fff; text-decoration: none; }

/* =================== SECTIONS ===================== */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }

.section-head {
  margin-bottom: 2rem;
  max-width: 65ch;
}
.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-blue-hi);
  margin-bottom: 0.5rem;
}

/* =================== FEATURE STRIP ===================== */

.feature-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.feature-strip .feature {
  padding: 0.5rem 1rem;
  text-align: center;
}
.feature-strip .feature h3 {
  font-size: 0.95rem;
  color: var(--brand-blue-hi);
  margin: 0 0 0.25rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.feature-strip .feature p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }

/* =================== PROJECT GRID ===================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.project-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--brand-blue-hi);
}
.project-card a.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.project-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-elev-2);
}
.project-card .thumb img,
.project-card .thumb picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.project-card:hover .thumb img { transform: scale(1.04); }
.project-card .body { padding: 1rem; }
.project-card .cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-red-hi);
  margin-bottom: 0.35rem;
}
.project-card h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--text);
}

/* =================== FILTER BAR ===================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-bar a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-decoration: none;
}
.filter-bar a:hover,
.filter-bar a:focus-visible {
  border-color: var(--brand-blue-hi);
  color: #fff;
}
.filter-bar a[aria-current="true"] {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

/* =================== PROJECT PAGE ===================== */

.project-hero {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  border-bottom: 1px solid var(--border);
}
.project-hero .cat {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-red-hi);
  margin-bottom: 0.4rem;
}
.project-hero h1 { margin: 0; }

.project-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
}
@media (min-width: 900px) {
  .project-body { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.project-content p { color: var(--text); }
.project-content h2 {
  margin-top: 2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.project-content ul li { margin-bottom: 0.25rem; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-table th {
  font-weight: 600;
  color: var(--text-dim);
  width: 40%;
  background: var(--bg-elev-2);
}

/* ===== Gallery: single-image carousel with prev/next arrows ===== */

.gallery-section { width: 100%; }

.gallery-carousel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--brand-blue-hi); outline-offset: -2px; }

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  display: block;
  background: var(--bg-elev-2);
  cursor: zoom-in;
  text-decoration: none;
}
.carousel-slide picture,
.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.carousel-slide .thumb-zoom {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: rgba(10,15,26,0.75);
  color: #fff;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
  pointer-events: none;
}
.carousel-slide:hover .thumb-zoom,
.carousel-slide:focus-visible .thumb-zoom { opacity: 1; background: var(--brand-blue); }

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid var(--border);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  font-family: var(--font-sans);
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.carousel-prev { left: 0.6rem; }
.carousel-next { right: 0.6rem; }
.carousel-prev:hover, .carousel-next:hover,
.carousel-prev:focus-visible, .carousel-next:focus-visible {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.carousel-prev:active, .carousel-next:active { transform: translateY(-50%) scale(0.94); }

.carousel-counter {
  position: absolute;
  bottom: 0.6rem;
  left: 0.75rem;
  z-index: 5;
  background: rgba(10,15,26,0.85);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* ===== Lightbox: full-screen view with prev/next arrows ===== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.96);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lightbox:target { display: flex; }

.lightbox img {
  position: relative;
  z-index: 2;
  max-width: 92%;
  max-height: 86%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  pointer-events: none;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: zoom-out;
}

.lb-prev, .lb-next, .lb-close {
  position: absolute;
  z-index: 3;
  color: #fff;
  text-decoration: none;
  background: rgba(20, 28, 48, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.lb-prev:hover, .lb-next:hover, .lb-close:hover,
.lb-prev:focus-visible, .lb-next:focus-visible, .lb-close:focus-visible {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  text-decoration: none;
}
.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  padding-bottom: 4px;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}
@media (max-width: 600px) {
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 1.7rem; }
  .lb-prev { left: 0.4rem; }
  .lb-next { right: 0.4rem; }
}

/* About-page hero with large logo */
.about-hero {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(37,99,235,0.15), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.about-hero .about-logo {
  max-width: min(86%, 420px);
  height: auto;
  margin: 0 auto 1rem;
}
.about-hero .about-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-red-hi);
  margin: 0;
}
.about-hero .about-meta {
  margin-top: 0.4rem;
  color: var(--text-mute);
  font-size: 0.85rem;
}

.share-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* =================== FOOTER ===================== */

.site-footer {
  margin-top: 4rem;
  background: #060912;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-logo { margin-bottom: 1rem; height: 44px; width: auto; }
.footer-about { max-width: 50ch; }
.footer-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 0.75rem;
}
.footer-links, .footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}
.footer-links a, .footer-contact a { color: var(--text-dim); }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 0.82rem;
}
.footer-bottom a { color: var(--text-mute); }

/* =================== ACCESSIBILITY ===================== */

:focus-visible {
  outline: 2px solid var(--brand-blue-hi);
  outline-offset: 2px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
