/* ============================================================
   Cornerstone System Engineering — Stylesheet
   ============================================================ */

/* ── Fonts (self-hosted) ── */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../inter-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../inter-v20-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../inter-v20-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../inter-v20-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('../inter-v20-latin-800.woff2') format('woff2'); }

:root {
  --navy:        #0d1f3c;
  --navy-light:  #1a3461;
  --blue:        #2563eb;
  --blue-light:  #3b82f6;
  --blue-pale:   #dbeafe;
  --white:       #ffffff;
  --off-white:   #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-400:    #94a3b8;
  --gray-600:    #475569;
  --text:        #1e293b;
  --text-light:  #475569;
  --radius:      6px;
  --shadow:      0 4px 24px rgba(13,31,60,0.10);
  --shadow-md:   0 8px 40px rgba(13,31,60,0.15);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { line-height: 1.75; color: var(--text-light); }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

/* ---- Layout ---- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 5rem 0; }

.section-header {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-header.centered {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-light); border-color: var(--blue-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

.btn-outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-dark:hover { background: var(--navy); color: var(--white); }

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,31,60,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.3s;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); background: rgba(255,255,255,0.08); }

.nav-cta {
  background: var(--blue) !important;
  color: var(--white) !important;
  padding: 0.5rem 1rem !important;
}
.nav-cta:hover { background: var(--blue-light) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--white);
  font-size: 1.4rem;
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  background: linear-gradient(145deg, var(--navy) 0%, #0f2d5a 50%, #0d1f3c 100%);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 70px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(37,99,235,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(37,99,235,0.08) 0%, transparent 40%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 4rem 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 1.25rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.25rem;
}

.hero h1 span { color: var(--blue-light); }

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.75);
  max-width: 580px;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ---- Intro section ---- */
.intro { background: var(--white); }

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.intro-sectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.sector-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.875rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid var(--blue);
}

.intro-right h3 { font-size: 1.5rem; margin-top: 0.4rem; margin-bottom: 1rem; }

.intro-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.intro-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-light);
}

.intro-list li::before {
  content: '→';
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* ---- Three Streams ---- */
.streams-section { background: var(--off-white); }

.streams-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stream-card {
  background: var(--white);
  border-radius: 10px;
  padding: 2.5rem 2rem;
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--blue);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-top-color 0.25s ease;
}

.stream-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-top-color: var(--blue-light);
}

.stream-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-200);
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 0.25s ease;
}

.stream-card:hover .stream-num { color: rgba(37,99,235,0.2); }

.stream-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.stream-card p  { font-size: 0.875rem; }

/* ---- Services ---- */
.services-section { background: var(--white); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  cursor: pointer;
  background: var(--white);
  border-radius: 10px;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  transition: all 0.25s ease;
  position: relative;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-pale);
}

.service-icon {
  width: 48px;
  height: 48px;
  background: var(--blue-pale);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
}

.service-card h3 { margin-bottom: 0.75rem; font-size: 1.05rem; }
.service-card p  { font-size: 0.875rem; }

.service-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: 1rem;
}

/* ---- Industries ---- */
.industries { background: var(--navy); }
.industries .section-label { color: var(--blue-light); }
.industries h2 { color: var(--white); }

.industries-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.industry-item {
  text-align: center;
  padding: 1.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}

.industry-item:hover {
  background: rgba(37,99,235,0.15);
  border-color: rgba(37,99,235,0.4);
}

.industry-icon { font-size: 2rem; margin-bottom: 0.75rem; color: rgba(255,255,255,0.6); }
.industry-item:hover .industry-icon { color: var(--blue-light); }
.industry-item h4 { font-size: 0.82rem; font-weight: 600; color: var(--white); line-height: 1.3; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  padding: 5rem 0;
  text-align: center;
}

.cta-banner h2 { color: var(--white); margin-bottom: 1rem; }
.cta-banner p  { color: rgba(255,255,255,0.7); max-width: 520px; margin: 0 auto 2rem; }

/* ---- About page ---- */
.page-hero {
  padding: 8rem 0 5rem;
  background: linear-gradient(145deg, var(--navy), #0f2d5a);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.page-hero-content { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); margin-bottom: 1rem; }
.page-hero p  { color: rgba(255,255,255,0.7); font-size: 1.1rem; max-width: 560px; }

/* ---- About content ---- */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.exp-list li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

.exp-list li::before {
  content: '◆';
  color: var(--blue);
  font-size: 0.5rem;
  flex-shrink: 0;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.value-card {
  padding: 2rem;
  background: var(--off-white);
  border-radius: 10px;
  border-top: 3px solid var(--blue);
}

.value-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.value-card p  { font-size: 0.875rem; }

/* ---- Services page ---- */
.services-full { background: var(--white); }

.service-block {
  scroll-margin-top: 90px;
  padding: 3rem 0;
  border-bottom: 1px solid var(--gray-200);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.service-block:last-child { border-bottom: none; }

.service-block-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gray-200);
  line-height: 1;
}

.service-block-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-top: 0.5rem;
}

.service-block h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }

.service-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.service-tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  background: var(--gray-100);
  border-radius: 20px;
  color: var(--text-light);
  font-weight: 500;
}

/* ---- Contact ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 { margin-bottom: 0.5rem; }
.contact-info p  { margin-bottom: 1.5rem; }

.contact-detail {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.contact-detail-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-pale);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-detail-text { font-size: 0.875rem; }
.contact-detail-text strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); margin-bottom: 0.2rem; }

.contact-form {
  background: var(--off-white);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---- Footer ---- */
.footer {
  background: var(--navy);
  padding: 4rem 0 2rem;
  color: rgba(255,255,255,0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  margin-top: 1rem;
  max-width: 280px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-col ul a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .industries-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .streams-grid { grid-template-columns: 1fr; }

  section { padding: 3.5rem 0; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--navy);
    padding: 0.5rem 0 1rem;
    gap: 0;
    z-index: 999;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 0;
  }
  .nav-cta { padding: 1rem 1.5rem !important; text-align: left; }
  .nav-toggle { display: block; }

  .hero-content { padding: 2rem 0; }

  .intro-grid,
  .about-intro,
  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }

  .services-grid { grid-template-columns: 1fr; }
  .industries-grid { grid-template-columns: repeat(2, 1fr); }

  .service-block { grid-template-columns: 1fr; gap: 1rem; }
  .service-block-num { font-size: 2rem; }

  .values-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .form-row { grid-template-columns: 1fr; }
  .intro-sectors { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .industries-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Hero 2-column + animated graphic
   ============================================================ */
.hero .container { position: relative; }

.hero-content {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-visual {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0.28;
  pointer-events: none;
}

.hero-svg { width: 640px; max-width: 90vw; }

.svg-diamond {
  fill: none;
  stroke: rgba(37,99,235,0.35);
  stroke-width: 1.5;
  animation: rotateDiamond 40s linear infinite;
  transform-origin: 240px 240px;
}

.svg-diamond-inner {
  fill: rgba(37,99,235,0.07);
  stroke: rgba(37,99,235,0.2);
  stroke-width: 1;
  animation: rotateDiamond 25s linear infinite reverse;
  transform-origin: 240px 240px;
}

.svg-node { fill: rgba(59,130,246,0.85); }
.pulse-1  { animation: nodePulse 3.5s ease-in-out infinite; }
.pulse-2  { animation: nodePulse 3.5s ease-in-out 1.75s infinite; }
.pulse-3  { animation: nodePulse 3.5s ease-in-out 0.9s infinite; }

.svg-line       { stroke: rgba(37,99,235,0.3); stroke-width: 1; stroke-dasharray: 4 3; }
.svg-line-outer { stroke: rgba(255,255,255,0.05); stroke-width: 1; fill: none; }

@keyframes rotateDiamond {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes nodePulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* ============================================================
   Stats bar
   ============================================================ */
.stats-bar {
  background: #0a1a30;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.stat-item {
  padding: 1.75rem 1.5rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.stat-item:last-child { border-right: none; }

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}
.stat-value em { color: var(--blue-light); font-style: normal; }

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-top: 0.4rem;
}

/* ============================================================
   Service icon — hover colour swap
   ============================================================ */
.service-icon svg { display: block; }
.service-card:hover .service-icon { background: var(--blue); color: var(--white); }

/* ============================================================
   Scroll reveal
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
[data-reveal].visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }
[data-reveal-delay="6"] { transition-delay: 0.6s; }

/* ============================================================
   Responsive additions
   ============================================================ */
@media (max-width: 960px) {
  .hero-visual { opacity: 0.15; width: 80vw; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(1),
  .stat-item:nth-child(2) { border-bottom: 1px solid rgba(255,255,255,0.05); }
}
