/* ==========================================================================
   NBTech Website - Main Stylesheet
   Design Tokens, Typography, and Base Styles
   ========================================================================== */

/* ==========================================================================
   @font-face Declarations - Self-hosted Roboto (SIL Open Font License)
   ========================================================================== */

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Color Palette */
  --color-primary: #1a73e8;
  --color-accent: #e91e63;
  --color-background: #ffffff;
  --color-surface: #fafafa;
  --color-text: #212121;
  --color-text-secondary: #757575;
  --color-hero-bg: #1a73e8;
  --color-hero-text: #ffffff;
  --color-footer-bg: #212121;
  --color-footer-text: #ffffff;

  /* Spacing (8px grid) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;

  /* Elevation Shadows */
  --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-raised: 0 3px 6px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-family: 'Roboto', sans-serif;
  --font-size-base: 16px;
  --font-size-h1: 48px;
  --font-size-h2: 32px;
  --font-size-tagline: 20px;
}

/* ==========================================================================
   Box Sizing Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Smooth Scroll Behavior
   ========================================================================== */

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* ==========================================================================
   Base Typography & Body Styles
   ========================================================================== */

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 64px;
  overflow-x: hidden;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  line-height: 1.3;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--color-background);
  box-shadow: var(--shadow-raised);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.brand:hover {
  opacity: 0.85;
}

.brand-logo {
  height: 30px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-3);
}

.nav-link {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}

/* Hamburger Menu Icon */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  width: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-hero-bg);
  background-image: url('../images/oakland_city_aerial.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--color-hero-text);
  text-align: center;
  padding: var(--space-4) var(--space-3);
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hero-brand {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 700;
  color: var(--color-hero-text);
  margin: 0 0 var(--space-2) 0;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 24px;
  color: var(--color-hero-text);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ==========================================================================
   Section Shared Styles
   ========================================================================== */

.section-subtitle {
  font-size: var(--font-size-tagline);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-5) 0;
}

/* ==========================================================================
   What We Do Section
   ========================================================================== */

.what-we-do-section {
  padding: 80px 0;
  background-color: var(--color-background);
  text-align: center;
}

.what-we-do-section h2 {
  margin: 0 0 var(--space-2) 0;
}

/* ==========================================================================
   Service Cards
   ========================================================================== */

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.service-card {
  background-color: var(--color-background);
  box-shadow: var(--shadow-card);
  border-radius: 4px;
  padding: var(--space-5);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.service-card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  color: var(--color-text);
}

.service-card-icon {
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: center;
}

.service-card-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.service-card-description {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Who We Are Section
   ========================================================================== */

.who-we-are-section {
  padding: 80px 0;
  background-color: var(--color-surface);
  text-align: center;
  border-top: 1px solid #e0e0e0;
}

.who-we-are-section h2 {
  margin: 0 0 var(--space-3) 0;
}

.who-we-are-description {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 800px;
  margin: 0 auto var(--space-3) auto;
  text-align: left;
}

.who-we-are-quote {
  font-size: 24px;
  font-style: italic;
  color: var(--color-primary);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-5) auto 0 auto;
  max-width: 800px;
  text-align: left;
}

.who-we-are-quote p {
  margin: 0;
  line-height: 1.4;
}

/* CTA Button */
.cta-btn {
  display: inline-block;
  margin-top: var(--space-5);
  padding: 14px var(--space-4);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: #ffffff;
  background-color: var(--color-primary);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-raised);
  letter-spacing: 0.5px;
}

.cta-btn:hover {
  background-color: #1557b0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.cta-btn:active {
  background-color: #0d47a1;
  transform: translateY(0);
}

/* ==========================================================================
   Desktop Layout (768px and above)
   ========================================================================== */

@media (min-width: 768px) {
  .cards-grid {
    flex-direction: row;
  }

  .service-card {
    flex: 1;
  }
}

/* ==========================================================================
   Mobile Navigation (below 768px)
   ========================================================================== */

@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-background);
    box-shadow: var(--shadow-base);
    padding: var(--space-2) 0;
    gap: 0;
  }

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

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-bottom: none;
    min-height: 44px;
    line-height: 44px;
  }

  .nav-link.active {
    background-color: var(--color-surface);
    border-bottom: none;
    border-left: 3px solid var(--color-primary);
  }
}

/* ==========================================================================
   Contact Form Section
   ========================================================================== */

.contact-section {
  padding: var(--space-6) 0;
  background-color: var(--color-hero-bg);
  background-image: url('../images/golden-gate-bridge.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  text-align: center;
  position: relative;
  color: var(--color-hero-text);
}

.contact-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.contact-section > .container {
  position: relative;
  z-index: 2;
}

.contact-section h2 {
  margin: 0 0 var(--space-2) 0;
  color: var(--color-hero-text);
}

.contact-section .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.contact-section .form-label {
  color: var(--color-hero-text);
}

.form-input {
  display: block;
  width: 100%;
  padding: 12px var(--space-2);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-background);
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-input.input-error {
  border-color: var(--color-accent);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  display: block;
  font-size: 14px;
  color: var(--color-accent);
  margin-top: 4px;
  min-height: 20px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-consent {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.5;
}

.contact-section .form-consent {
  color: rgba(255, 255, 255, 0.75);
}

.form-submit-btn {
  display: inline-block;
  padding: 14px var(--space-4);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: #ffffff;
  background-color: var(--color-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-raised);
  letter-spacing: 0.5px;
  min-height: 44px;
  min-width: 44px;
}

.form-submit-btn:hover {
  background-color: #1557b0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-submit-btn:active {
  background-color: #0d47a1;
}

.form-submit-btn:disabled {
  background-color: #bdbdbd;
  cursor: not-allowed;
  box-shadow: none;
}

.form-status {
  margin-top: var(--space-3);
  padding: var(--space-2);
  border-radius: 4px;
  font-size: var(--font-size-base);
  line-height: 1.5;
}

.form-status:empty {
  display: none;
}

.form-status.status-success {
  display: block;
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.form-status.status-error {
  display: block;
  background-color: #fce4ec;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.form-status.status-info {
  display: block;
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

/* ==========================================================================
   Page Banner
   ========================================================================== */

.page-banner {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
}

.page-banner-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
}

/* ==========================================================================
   Secondary Page Sections
   ========================================================================== */

.page-section {
  padding: var(--space-8) 0;
  background-color: var(--color-background);
}

.page-section h1 {
  margin: 0 0 var(--space-3) 0;
  color: var(--color-text);
}

.page-section p {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 800px;
  margin: 0 0 var(--space-3) 0;
}

.page-section .coming-soon {
  font-size: 18px;
  color: var(--color-text-secondary);
  font-style: italic;
}

.page-section.contact-section {
  background-color: var(--color-surface);
  background-image: none;
  color: var(--color-text);
}

.page-section.contact-section::before {
  display: none;
}

.page-section.contact-section h1 {
  color: var(--color-text);
}

.page-section.contact-section .section-subtitle {
  color: var(--color-text-secondary);
}

.page-section.contact-section .form-label {
  color: var(--color-text);
}

.page-section.contact-section .form-consent {
  color: var(--color-text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 80px 0 var(--space-4) 0;
  text-align: center;
}

.footer-nav {
  margin-bottom: var(--space-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-2) var(--space-3);
}

.footer-link {
  color: var(--color-footer-text);
  text-decoration: none;
  font-size: var(--font-size-base);
  padding: var(--space-1);
  border-radius: 2px;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-link:focus {
  outline: 2px solid var(--color-footer-text);
  outline-offset: 2px;
}

.footer-credit {
  font-size: 14px;
  color: var(--color-footer-text);
  opacity: 0.7;
  margin: var(--space-3) 0 0 0;
}

.footer-social {
  font-size: 14px;
  color: var(--color-footer-text);
  opacity: 0.85;
  margin: var(--space-2) 0 0 0;
}

.footer-copyright {
  font-size: 13px;
  color: var(--color-footer-text);
  opacity: 0.6;
  margin: var(--space-2) 0 0 0;
}

/* ==========================================================================
   Responsive Images
   ========================================================================== */

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

/* ==========================================================================
   Mobile Responsive (below 768px)
   ========================================================================== */

@media (max-width: 767px) {
  /* Single-column layout */
  .container {
    padding: 0 var(--space-2);
  }

  /* Footer responsive - ensure no horizontal scrolling */
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
  }

  .footer-link {
    display: block;
    padding: var(--space-1) var(--space-2);
    min-height: 44px;
    line-height: 44px;
  }

  /* Touch targets: minimum 44x44px for interactive elements */
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }

  .brand {
    min-height: 44px;
    line-height: 44px;
  }

  /* Ensure cards stack in single column */
  .cards-grid {
    flex-direction: column;
  }

  .service-card {
    width: 100%;
  }

  /* Ensure no element exceeds viewport width */
  .hero-section,
  .what-we-do-section,
  .who-we-are-section,
  .contact-section,
  .site-footer {
    max-width: 100vw;
  }

  .who-we-are-quote {
    padding: var(--space-2) var(--space-3);
  }
}
