/*
  NIGHTWIRE SHARED STYLESHEET
  ------------------------------------------------------------
  This file controls the visual design for every HTML page.
  The site is intentionally static: no React, no build tool, no VS Code needed
  just to open it. The browser reads index.html, this CSS file, script.js, and
  the image inside assets/.
*/

/* Design tokens: change these once and the whole site updates. */
:root {
  --bg: #020303;
  --panel: rgba(8, 10, 12, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f2f4f6;
  --muted: #9da3aa;
  --quiet: #626972;
  --violet: #a7a0ff;
  --cyan: #6db7ff;
  --green: #7ed9a4;
  --amber: #d7b66c;
  --max: 1180px;
}

/* Makes width/padding math easier across the whole page. */
* {
  box-sizing: border-box;
}

/* Smooths hash jumps if you add section links later. */
html {
  scroll-behavior: smooth;
}

/* Global page background and default text styling. */
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% 6%, rgba(109, 183, 255, 0.08), transparent 26rem),
    linear-gradient(180deg, #030404 0%, #000 100%);
  color: var(--text);
  /*
    This font stack leans closer to the original screenshot:
    narrow, technical, spaced-out, and less "default website."
    The browser uses the first font installed on the computer.
  */
  font-family: "OCR A Extended", "Bank Gothic Medium", "Consolas", "Lucida Console", monospace;
  letter-spacing: 0;
}

/* Removes default underline/color from links so we can design them ourselves. */
a {
  color: inherit;
  text-decoration: none;
}

/*
  PAGE SHELL
  This outer frame creates the thin bordered "screen" look from your reference.
*/
.page-shell {
  /*
    Wider shell so the page feels like the OG reference.
    The previous 1440px cap created huge side gutters on a wide browser.
  */
  width: min(100% - 48px, 1900px);
  margin: 24px auto;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.78);
  min-height: calc(100vh - 56px);
  overflow: hidden;
}

/*
  HEADER / NAVIGATION
  The header is shared by every page. The active tab is added by script.js
  based on the body data-page value.
*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 210px 1fr 160px;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: rgba(1, 2, 3, 0.84);
  backdrop-filter: blur(14px);
}

/*
  NIGHTWIRE LOGO WORDMARK
  ------------------------------------------------------------
  The logo uses a transparent PNG wordmark generated from the reference image.
  That keeps the custom letter shapes without the pasted black rectangle.
*/
.logo-word {
  display: inline-block;
  line-height: 0;
}

.logo-word img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    brightness(1.12)
    contrast(1.08)
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
}

/* Wordmark in the upper-left corner. */
.brand-mark {
  width: 210px;
}

/* Desktop nav layout. */
.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 3vw, 42px);
}

/* Shared small-uppercase button/link style. */
.site-nav a,
.header-action,
.primary-button,
.ghost-button {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Individual nav links. */
.site-nav a {
  position: relative;
  color: var(--muted);
  padding: 29px 0;
}

/* Active and hover state for the top tabs. */
.site-nav a.active,
.site-nav a:hover {
  color: var(--text);
}

/* Thin underline below the active/hovered tab. */
.site-nav a.active::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 2px;
  background: var(--text);
}

/* "Work With Us" button on desktop. */
.header-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

/* Mobile menu button. Hidden on desktop, shown in the mobile media query. */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
}

/* The two bars inside the mobile menu button. */
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

/*
  GENERAL SECTION STYLES
  .section constrains content so pages stay aligned.
*/
.section {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 96px 32px;
}

/*
  HOME HERO
  Important change requested:
  This restores the OG-style composition: the image fills the hero area,
  stays straight, and keeps the workbench detail weighted to the right.
*/
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 690px;
  padding: 132px 32px 100px;
  isolation: isolate;
}

/*
  The actual hero image.
  object-fit: cover fills the hero like the original mockup.
  object-position: right center keeps the desk/lamp/monitor on the right.
*/
.hero-image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  opacity: 1;
}

/*
  This layer creates the original left-to-right fade:
  darker in the text area, more visible on the workbench side.
*/
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.66) 38%, rgba(0, 0, 0, 0.12) 76%, rgba(0, 0, 0, 0.08) 100%),
    radial-gradient(circle at 48% 42%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.24) 48%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.82) 100%);
}

/* Centers the hero text block. */
.hero-content {
  /*
    Wider than the normal text block because the hero wordmark is an image.
    This keeps the logo centered in the hero instead of overflowing from a
    narrow text column.
  */
  width: min(1180px, 100%);
  text-align: center;
}

/* Small uppercase section labels. */
.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.46em;
  text-transform: uppercase;
}

/* Big NIGHTWIRE title. */
.hero h1 {
  margin: 0 auto;
  line-height: 0;
}

/* Larger spacing for the hero version of the logo. */
.logo-word-large {
  display: block;
  width: min(68vw, 900px);
  margin-inline: auto;
}

/* Decorative line under the logo. */
.signal-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  width: min(520px, 100%);
  margin: 36px auto 24px;
  color: var(--violet);
}

.signal-rule span {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.signal-rule b {
  font-size: 11px;
  letter-spacing: 0.24em;
}

/* Short mission sentence below the title. */
.hero-copy {
  width: min(470px, 100%);
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

/* Button row below the hero copy. */
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* Shared button shell. */
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
}

.primary-button:hover,
.ghost-button:hover,
.header-action:hover {
  border-color: rgba(167, 160, 255, 0.7);
  color: #fff;
}

/* Left-side numeric detail from the reference design. */
.section-count {
  position: absolute;
  left: 42px;
  top: 250px;
  display: grid;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.section-count i {
  display: block;
  width: 12px;
  height: 1px;
  background: var(--line-strong);
}

.section-count span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-count span::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

/*
  HOME SERVICE STRIP
  This is the row of four service cards under the home hero.
*/
.service-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 220px), 1540px);
  margin: -44px auto 0;
  border: 1px solid var(--line);
  background: rgba(2, 3, 4, 0.84);
  backdrop-filter: blur(8px);
}

.service-strip article {
  min-height: 210px;
  padding: 34px 40px;
  border-right: 1px solid var(--line);
}

.service-strip article:last-child {
  border-right: 0;
}

.service-icon {
  min-height: 34px;
  color: var(--violet);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}

.service-strip h2 {
  margin: 18px 0 10px;
  font-size: 16px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.service-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.service-strip a {
  display: inline-flex;
  margin-top: 20px;
  color: #d8d5ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/*
  PAGE HERO
  Used by Services, Projects, Labs, Operations, About, and Contact.
*/
.page-hero {
  padding-top: 110px;
  padding-bottom: 70px;
}

.page-hero h1,
.split-section h2,
.about-panel h2 {
  margin: 0;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 760;
}

.page-hero p,
.split-section p,
.about-panel p {
  width: min(760px, 100%);
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

/*
  SPLIT SECTION
  Used on the home page to preview the roadmap.
*/
.split-section {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 54px;
  align-items: end;
}

/*
  CARD GRID
  Reusable grid for service/detail pages.
*/
.card-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.four-up {
  grid-template-columns: repeat(4, 1fr);
}

.card-grid article {
  min-height: 260px;
  padding: 30px;
  background: rgba(4, 5, 6, 0.96);
}

.card-grid span,
.phase-grid span,
.project-grid span,
.operation-list span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card-grid h2,
.phase-grid h2 {
  margin: 44px 0 12px;
  font-size: 20px;
}

.card-grid p,
.phase-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/*
  ROADMAP PHASE GRID
  Used on labs.html.
*/
.phase-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
}

.phase-grid article {
  min-height: 255px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}

.phase-grid article:last-child {
  border-right: 0;
}

/*
  PROJECT GRID
  Used on projects.html.
*/
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.project-grid article {
  min-height: 142px;
  padding: 26px;
  background: rgba(4, 5, 6, 0.96);
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.project-grid span {
  display: block;
  margin-bottom: 28px;
  color: var(--green);
}

/*
  OPERATION LIST
  Used on operations.html.
*/
.operation-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}

.operation-list li {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 0 24px;
  background: #030506;
  color: var(--text);
}

.operation-list span {
  color: var(--amber);
}

.future-ops {
  margin: 22px 0 0;
  color: var(--quiet);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/*
  ABOUT AND CONTACT PANELS
*/
.about-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding: 44px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(167, 160, 255, 0.08), transparent 36%),
    rgba(4, 5, 6, 0.72);
}

.contact-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.contact-panel a {
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 780;
  overflow-wrap: anywhere;
}

.contact-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/*
  FOOTER
*/
.site-footer {
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 34px 24px 42px;
  color: var(--quiet);
  text-align: center;
  border-top: 1px solid var(--line);
}

.site-footer > span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.tool-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(28px, 8vw, 92px);
  font-size: 18px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.34);
}

/*
  TABLET BREAKPOINT
  The nav stays desktop-like, but the content grids reduce columns.
*/
@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-action {
    display: none;
  }

  /*
    Seven separate page tabs need more room than the old one-page nav.
    At tablet width, switch to the mobile-style dropdown menu.
  */
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 10px 38px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.96);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 15px 0;
  }

  .site-nav a.active::after,
  .site-nav a:hover::after {
    bottom: 6px;
  }

  .service-strip,
  .four-up,
  .phase-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-strip article:nth-child(2),
  .phase-grid article:nth-child(2),
  .phase-grid article:nth-child(4) {
    border-right: 0;
  }

  .phase-grid article {
    border-bottom: 1px solid var(--line);
  }

  .phase-grid article:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }
}

/*
  MOBILE BREAKPOINT
  The top tabs collapse into a menu button, and all grids become one column.
*/
@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 18px, 1440px);
    margin: 9px auto;
    min-height: calc(100vh - 18px);
  }

  .site-header {
    min-height: 66px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 150px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    top: 66px;
    padding: 10px 18px 18px;
  }

  .hero {
    min-height: 620px;
    padding: 118px 20px 92px;
  }

  /*
    On mobile, keep the same OG-style cover composition.
    The image is dimmer here so the large title stays readable.
  */
  .hero-image {
    object-fit: cover;
    object-position: 68% center;
    opacity: 0.9;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.42)),
      radial-gradient(circle at 50% 34%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.5) 68%, rgba(0, 0, 0, 0.72) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.84) 98%);
  }

  .hero h1 {
    line-height: 0;
  }

  .logo-word-large {
    width: min(84vw, 560px);
  }

  .eyebrow,
  .section-kicker {
    font-size: 12px;
    letter-spacing: 0.28em;
  }

  .section-count {
    display: none;
  }

  .service-strip {
    width: calc(100% - 34px);
    grid-template-columns: 1fr;
    margin-top: -28px;
  }

  .service-strip article,
  .service-strip article:nth-child(2) {
    min-height: auto;
    padding: 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-strip article:last-child {
    border-bottom: 0;
  }

  .section {
    padding: 72px 20px;
  }

  .page-hero {
    padding-top: 76px;
    padding-bottom: 44px;
  }

  .split-section,
  .about-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .four-up,
  .phase-grid,
  .project-grid,
  .operation-list {
    grid-template-columns: 1fr;
  }

  .phase-grid article,
  .phase-grid article:nth-child(2),
  .phase-grid article:nth-child(4) {
    min-height: auto;
    border-right: 0;
  }

  .project-grid article {
    min-height: 116px;
  }

  .about-panel,
  .contact-panel {
    padding: 28px;
  }

  .site-footer > span {
    letter-spacing: 0.18em;
  }
}
