/* ============================================
   CCSTM Computing — Stylesheet
   ============================================ */

/* --- 1. Custom Properties --- */
:root {
  --color-primary-dark: #0d2b3e;
  --color-primary-bright: #00c2cb;
  --color-secondary: #8a7e69;
  --color-bg-light: #ffffff;
  --color-bg-offwhite: #f8f9fa;
  --color-bg-dark: #0a1628;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-white: #ffffff;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-max: 1140px;
  --section-padding: clamp(4rem, 8vw, 7rem);
  --transition: 0.3s ease;
  --radius: 12px;
  --radius-sm: 8px;
}

/* --- 2. Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* --- 3. Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.section {
  padding: var(--section-padding) 0;
}

.section--light {
  background: var(--color-bg-light);
}

.section--offwhite {
  background: var(--color-bg-offwhite);
}

.section--dark {
  background: var(--color-bg-dark);
}

/* --- 4. Typography --- */
.section__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary-bright);
  margin-bottom: 0.75rem;
}

.section__label--light {
  color: var(--color-primary-bright);
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-primary-dark);
  margin-bottom: 1.25rem;
  max-width: 700px;
}

.section__title--light {
  color: var(--color-white);
}

.section__intro {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--color-text-muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.section__intro--light {
  color: rgba(255, 255, 255, 0.7);
}

/* --- 5. Buttons --- */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 50px;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--color-primary-bright);
  color: var(--color-bg-dark);
  border-color: var(--color-primary-bright);
}

.btn--primary:hover {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-primary-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 194, 203, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost:hover {
  border-color: var(--color-white);
  transform: translateY(-2px);
}

/* --- 6. Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: rgba(13, 43, 62, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.nav__logo img {
  height: 44px;
  width: auto;
  transition: opacity var(--transition);
}

.nav__logo:hover img {
  opacity: 0.8;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  transition: all var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.nav__cta {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-bg-dark);
  background: var(--color-primary-bright);
  border-radius: 50px;
  transition: all var(--transition);
}

.nav__cta:hover {
  background: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 194, 203, 0.3);
}

/* Hamburger toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}

.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav__toggle.open .nav__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.open .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle.open .nav__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- 7. Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-primary-dark) 50%, #0e3a4f 100%);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Dot grid pattern */
.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 194, 203, 0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

/* Gradient glow */
.hero__bg::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 194, 203, 0.1) 0%, transparent 70%);
  animation: pulse-glow 8s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* Silicon chip circuit SVG */
.hero__circuit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.85;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 6rem 0 4rem;
}

.hero__title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- 8. About --- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.about__col p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.85;
}

/* --- 9. Services --- */
.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--color-primary-bright);
  transition: all var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  color: var(--color-primary-bright);
  margin-bottom: 1.25rem;
}

.service-card__icon svg {
  width: 100%;
  height: 100%;
}

.service-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.service-card__text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* --- 10. Clients --- */
.clients__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
  align-items: center;
  justify-items: center;
}

.client-logo {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.client-logo img {
  height: 48px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.5);
  transition: all var(--transition);
}

/* SVG logos have no built-in padding, so scale them to match PNGs visually */
.client-logo img[src$=".svg"] {
  height: 20px;
}

.client-logo:hover img {
  filter: grayscale(0%) opacity(1);
}

/* --- 11. Contact --- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 194, 203, 0.3);
  transform: translateY(-2px);
}

.contact-item__icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary-bright);
  margin-bottom: 1rem;
}

.contact-item__icon svg {
  width: 100%;
  height: 100%;
}

.contact-item__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.4rem;
}

.contact-item__value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-white);
  line-height: 1.5;
}

/* --- 12. Footer --- */
.footer {
  background: var(--color-bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer__logo {
  height: 36px;
  width: auto;
  opacity: 0.7;
}

.footer__copy {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
}

.footer__info {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.3);
}

/* --- 13. Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger service cards */
.services__grid .service-card:nth-child(1) { transition-delay: 0ms; }
.services__grid .service-card:nth-child(2) { transition-delay: 100ms; }
.services__grid .service-card:nth-child(3) { transition-delay: 200ms; }
.services__grid .service-card:nth-child(4) { transition-delay: 300ms; }

/* Stagger client logos */
.clients__grid .client-logo:nth-child(1) { transition-delay: 0ms; }
.clients__grid .client-logo:nth-child(2) { transition-delay: 60ms; }
.clients__grid .client-logo:nth-child(3) { transition-delay: 120ms; }
.clients__grid .client-logo:nth-child(4) { transition-delay: 180ms; }
.clients__grid .client-logo:nth-child(5) { transition-delay: 240ms; }
.clients__grid .client-logo:nth-child(6) { transition-delay: 300ms; }
.clients__grid .client-logo:nth-child(7) { transition-delay: 360ms; }
.clients__grid .client-logo:nth-child(8) { transition-delay: 420ms; }
.clients__grid .client-logo:nth-child(9) { transition-delay: 480ms; }

/* --- 14. Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- 15. Media Queries --- */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .services__grid {
    grid-template-columns: 1fr 1fr;
  }

  .clients__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .client-logo img {
    height: 52px;
    max-width: 140px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .services__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .service-card {
    padding: 2.5rem;
  }

  .clients__grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }

  .client-logo img {
    height: 56px;
    max-width: 150px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Large desktop (1200px+) */
@media (min-width: 1200px) {
  .clients__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Mobile nav (below 768px) */
@media (max-width: 767px) {
  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, rgba(10, 22, 40, 0.99) 0%, rgba(8, 40, 56, 0.99) 50%, rgba(10, 22, 40, 0.99) 100%);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 105;
  }

  .nav__menu.open {
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .nav__link {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.9rem 2.5rem;
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 194, 203, 0.15);
    border-radius: 50px;
    letter-spacing: 0.02em;
    width: 260px;
    text-align: center;
    box-sizing: border-box;
  }

  .nav__link:hover,
  .nav__link.active {
    background: rgba(0, 194, 203, 0.12);
    border-color: rgba(0, 194, 203, 0.35);
    color: var(--color-accent);
  }

  .nav__list {
    gap: 1rem;
  }

  .nav__cta {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.9rem 2.5rem;
    margin-top: 0.5rem;
    width: 260px;
    text-align: center;
    box-sizing: border-box;
  }

  .hero__content {
    padding: 7rem 0 3rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .hero__actions .btn {
    width: 260px;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}
