/*
Theme Name: Nexus MEP & Consulting
Theme URI: https://nexusmepgroup.co.uk/
Author: Nexus MEP & Consulting
Description: A responsive, brand-led WordPress theme for Nexus MEP & Consulting. Includes editable starter pages, project case studies, navigation, and contact details.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: nexus-mep-consulting
*/

:root {
  --nexus-cream: #fefaf2;
  --nexus-blue: #33517d;
  --nexus-orange: #ff7723;
  --nexus-gold: #fec973;
  --nexus-dark: #1f2c3b;
  --nexus-ink: #14202d;
  --nexus-muted: #647184;
  --nexus-white: #ffffff;
  --nexus-border: rgba(51, 81, 125, 0.16);
  --nexus-shadow: 0 24px 70px rgba(31, 44, 59, 0.12);
  --nexus-radius: 22px;
  --nexus-wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--nexus-ink);
  background: var(--nexus-cream);
  font-family: Montserrat, "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .nexus-site-header { top: 32px; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--nexus-blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--nexus-orange); }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--nexus-gold); outline-offset: 4px; }
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.65em;
  color: var(--nexus-dark);
  font-family: Montserrat, "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
h1 { font-size: clamp(2.85rem, 6vw, 5.65rem); }
h2 { font-size: clamp(2.1rem, 4vw, 3.75rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 2rem); }
p { margin: 0 0 1.25rem; }
ul, ol { margin: 0 0 1.5rem; padding-left: 1.25rem; }
li + li { margin-top: 0.55rem; }
::selection { background: var(--nexus-gold); color: var(--nexus-dark); }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  display: block;
  height: auto;
  left: 12px;
  top: 12px;
  width: auto;
  padding: 12px 18px;
  z-index: 100000;
  color: var(--nexus-dark);
  background: var(--nexus-gold);
  border-radius: 6px;
}

.nexus-wrap,
.entry-content > *:not(.alignfull):not(.alignwide),
.entry-header,
.entry-footer {
  width: min(calc(100% - 40px), var(--nexus-wrap));
  margin-left: auto;
  margin-right: auto;
}
.entry-content > .alignwide { width: min(calc(100% - 40px), 1360px); margin-left: auto; margin-right: auto; }
.entry-content > .alignfull { width: 100%; }

.nexus-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--nexus-border);
  backdrop-filter: blur(16px);
}
.nexus-header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.nexus-brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.nexus-brand a { display: inline-flex; align-items: center; }
.nexus-brand img { width: clamp(230px, 23vw, 330px); }
.nexus-menu-toggle {
  display: none;
  border: 0;
  background: var(--nexus-dark);
  color: var(--nexus-white);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.nexus-primary-nav ul {
  display: flex;
  align-items: center;
  gap: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nexus-primary-nav a {
  color: var(--nexus-dark);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}
.nexus-primary-nav a:hover,
.nexus-primary-nav .current-menu-item > a { color: var(--nexus-orange); }

.nexus-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--nexus-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nexus-eyebrow::before { content: ""; width: 38px; height: 3px; background: linear-gradient(90deg, var(--nexus-orange), var(--nexus-gold)); }
.nexus-hero .nexus-eyebrow,
.nexus-dark-section .nexus-eyebrow { color: var(--nexus-gold); }
.nexus-section { padding: clamp(78px, 10vw, 140px) 0; }
.nexus-section--tight { padding: clamp(60px, 8vw, 100px) 0; }
.nexus-section-heading { max-width: 780px; margin-bottom: 50px; }
.nexus-section-heading p { max-width: 680px; color: var(--nexus-muted); font-size: 1.08rem; }

.nexus-hero {
  position: relative;
  isolation: isolate;
  min-height: min(870px, calc(100vh - 84px));
  display: grid;
  align-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  background: var(--nexus-dark);
}
.nexus-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("assets/images/ucl-biomedical.jpg");
  background-position: center;
  background-size: cover;
  filter: saturate(0.75);
}
.nexus-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(31, 44, 59, 0.98) 0%, rgba(31, 44, 59, 0.92) 48%, rgba(31, 44, 59, 0.3) 100%),
    linear-gradient(0deg, rgba(31, 44, 59, 0.72), transparent 50%);
}
.nexus-hero-grid { padding-top: clamp(95px, 12vw, 155px); padding-bottom: clamp(100px, 12vw, 150px); }
.nexus-hero-copy { max-width: 780px; }
.nexus-hero h1 { max-width: 780px; color: var(--nexus-white); }
.nexus-hero h1 strong { color: var(--nexus-gold); }
.nexus-hero .nexus-lead { max-width: 720px; margin-bottom: 34px; color: rgba(255, 255, 255, 0.84); font-size: clamp(1.08rem, 1.8vw, 1.34rem); }
.nexus-hero-proof { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 45px; }
.nexus-proof-pill { padding: 9px 14px; border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; color: var(--nexus-white); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }

.wp-block-buttons { gap: 14px; }
.wp-block-button__link,
.nexus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 24px;
  border: 2px solid var(--nexus-orange);
  border-radius: 8px;
  color: var(--nexus-dark) !important;
  background: linear-gradient(110deg, var(--nexus-orange), var(--nexus-gold));
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.wp-block-button__link:hover,
.nexus-button:hover { color: var(--nexus-dark) !important; transform: translateY(-2px); box-shadow: 0 14px 35px rgba(255, 119, 35, 0.25); }
.is-style-outline > .wp-block-button__link,
.nexus-button--outline { color: var(--nexus-white) !important; background: transparent; border-color: rgba(255,255,255,0.52); }
.is-style-outline > .wp-block-button__link:hover,
.nexus-button--outline:hover { color: var(--nexus-white) !important; border-color: var(--nexus-gold); }

.nexus-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.nexus-service-card,
.nexus-value-card {
  position: relative;
  min-height: 265px;
  padding: 34px;
  overflow: hidden;
  background: var(--nexus-white);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius);
  box-shadow: 0 15px 50px rgba(31, 44, 59, 0.06);
}
.nexus-service-card::after { content: ""; position: absolute; top: -45px; right: -45px; width: 130px; height: 130px; border: 1px solid rgba(255,119,35,0.26); border-radius: 50%; }
.nexus-service-card .nexus-value-index { margin-bottom: 50px; }
.nexus-service-card h3 { margin-bottom: 12px; font-size: 1.45rem; }
.nexus-service-card p,
.nexus-value-card p { margin: 0; color: var(--nexus-muted); font-size: 0.96rem; }

.nexus-feature {
  color: rgba(255,255,255,0.82);
  background: var(--nexus-dark);
}
.nexus-feature h2,
.nexus-feature h3 { color: var(--nexus-white); }
.nexus-feature-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(35px, 7vw, 90px); align-items: center; }
.nexus-feature-media { position: relative; }
.nexus-feature-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--nexus-radius); }
.nexus-feature-media::after { content: ""; position: absolute; inset: 24px -24px -24px 24px; z-index: -1; border: 1px solid rgba(254,201,115,0.45); border-radius: var(--nexus-radius); }
.nexus-feature ul { color: rgba(255,255,255,0.78); }
.nexus-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 30px; padding: 0; list-style: none; }
.nexus-tags li { margin: 0; padding: 7px 12px; color: var(--nexus-gold); background: rgba(254,201,115,0.08); border: 1px solid rgba(254,201,115,0.25); border-radius: 999px; font-size: 0.74rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }

.nexus-about-grid { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: clamp(35px, 8vw, 110px); align-items: start; }
.nexus-about-intro { position: sticky; top: 130px; }
.nexus-big-quote { color: var(--nexus-blue); font-size: clamp(1.55rem, 3vw, 2.5rem); font-weight: 750; line-height: 1.25; letter-spacing: -0.025em; }
.nexus-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.nexus-value-card { min-height: 210px; }
.nexus-value-index { display: block; margin-bottom: 34px; color: var(--nexus-orange); font-size: 0.78rem; font-weight: 850; }

.nexus-project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.nexus-project-card { position: relative; overflow: hidden; background: var(--nexus-white); border: 1px solid var(--nexus-border); border-radius: var(--nexus-radius); box-shadow: 0 18px 55px rgba(31,44,59,0.08); }
.nexus-project-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform 450ms ease; }
.nexus-project-card:hover img { transform: scale(1.035); }
.nexus-project-card-content { padding: 30px; }
.nexus-project-card h3 { margin-bottom: 10px; }
.nexus-project-card p { color: var(--nexus-muted); }
.nexus-project-meta { display: block; margin-bottom: 14px; color: var(--nexus-orange); font-size: 0.73rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.nexus-text-link { display: inline-flex; gap: 8px; align-items: center; color: var(--nexus-blue); font-size: 0.8rem; font-weight: 850; letter-spacing: 0.06em; text-decoration: none; text-transform: uppercase; }
.nexus-text-link::after { content: "→"; color: var(--nexus-orange); transition: transform 160ms ease; }
.nexus-text-link:hover::after { transform: translateX(4px); }

.nexus-cta { color: var(--nexus-white); background: linear-gradient(120deg, var(--nexus-blue), var(--nexus-dark)); }
.nexus-cta-inner { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.nexus-cta h2 { max-width: 800px; color: var(--nexus-white); }
.nexus-cta p { max-width: 720px; color: rgba(255,255,255,0.78); }

.nexus-page-hero { padding: clamp(100px, 13vw, 170px) 0 clamp(70px, 9vw, 115px); color: rgba(255,255,255,0.82); background: var(--nexus-dark); }
.nexus-page-hero h1 { max-width: 1000px; color: var(--nexus-white); }
.nexus-page-hero .nexus-lead { max-width: 820px; font-size: 1.18rem; }
.nexus-page-hero--image { position: relative; isolation: isolate; overflow: hidden; }
.nexus-page-hero--image::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--nexus-page-image) center/cover; opacity: 0.32; }
.nexus-page-hero--image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(31,44,59,0.98), rgba(31,44,59,0.65)); }
.nexus-project-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(40px, 8vw, 100px); align-items: start; }
.nexus-project-body h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.nexus-project-aside { position: sticky; top: 120px; padding: 28px; background: var(--nexus-white); border: 1px solid var(--nexus-border); border-radius: var(--nexus-radius); }
.nexus-project-aside h3 { font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.nexus-project-aside .nexus-tags { margin-bottom: 0; }
.nexus-project-aside .nexus-tags li { color: var(--nexus-blue); background: rgba(51,81,125,0.05); border-color: rgba(51,81,125,0.16); }
.nexus-project-body strong { color: var(--nexus-blue); }

.nexus-contact-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(35px, 8vw, 100px); }
.nexus-contact-panel { padding: clamp(30px, 5vw, 55px); background: var(--nexus-white); border: 1px solid var(--nexus-border); border-radius: var(--nexus-radius); box-shadow: var(--nexus-shadow); }
.nexus-contact-list { list-style: none; margin: 0; padding: 0; }
.nexus-contact-list li { padding: 22px 0; border-bottom: 1px solid var(--nexus-border); }
.nexus-contact-list li:last-child { border-bottom: 0; }
.nexus-contact-list span { display: block; color: var(--nexus-muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.nexus-contact-list a { font-weight: 750; text-decoration: none; }

.entry-header { padding: 80px 0 30px; }
.entry-content { min-height: 45vh; }
.entry-content > p:last-child { margin-bottom: 80px; }
.nexus-notice { margin-top: 30px; padding: 20px 22px; background: rgba(254,201,115,0.22); border-left: 4px solid var(--nexus-orange); border-radius: 6px; font-size: 0.94rem; }

.nexus-site-footer { color: rgba(255,255,255,0.72); background: #15202d; }
.nexus-footer-grid { display: grid; grid-template-columns: 1.25fr 0.75fr 0.9fr; gap: 50px; padding-top: 80px; padding-bottom: 55px; }
.nexus-footer-brand img { width: 300px; margin-bottom: 24px; filter: brightness(0) invert(1); }
.nexus-footer-brand p { max-width: 450px; }
.nexus-site-footer h2 { color: var(--nexus-gold); font-size: 0.82rem; letter-spacing: 0.11em; text-transform: uppercase; }
.nexus-site-footer ul { list-style: none; padding: 0; }
.nexus-site-footer a { color: var(--nexus-white); text-decoration: none; }
.nexus-site-footer a:hover { color: var(--nexus-gold); }
.nexus-footer-bottom { padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.78rem; }
.nexus-footer-bottom-inner { display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 980px) {
  .nexus-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nexus-primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 18px 20px 28px; background: var(--nexus-white); border-bottom: 1px solid var(--nexus-border); }
  .nexus-primary-nav.is-open { display: block; }
  .nexus-primary-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .nexus-primary-nav a { display: block; padding: 13px 4px; }
  .nexus-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nexus-feature-grid,
  .nexus-about-grid,
  .nexus-project-body,
  .nexus-contact-grid { grid-template-columns: 1fr; }
  .nexus-about-intro,
  .nexus-project-aside { position: static; }
  .nexus-feature-media::after { inset: 16px -12px -16px 12px; }
  .nexus-footer-grid { grid-template-columns: 1fr 1fr; }
  .nexus-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  body.admin-bar .nexus-site-header { top: 46px; }
  .nexus-wrap,
  .entry-content > *:not(.alignfull):not(.alignwide),
  .entry-header,
  .entry-footer { width: min(calc(100% - 28px), var(--nexus-wrap)); }
  .nexus-header-inner { min-height: 72px; }
  .nexus-brand img { width: 225px; }
  .nexus-hero { min-height: auto; }
  .nexus-hero::after { background: linear-gradient(90deg, rgba(31,44,59,0.98), rgba(31,44,59,0.76)); }
  .nexus-card-grid,
  .nexus-project-grid,
  .nexus-values,
  .nexus-footer-grid { grid-template-columns: 1fr; }
  .nexus-service-card { min-height: 225px; }
  .nexus-service-card .nexus-value-index { margin-bottom: 35px; }
  .nexus-cta-inner { grid-template-columns: 1fr; align-items: start; }
  .nexus-footer-brand { grid-column: auto; }
  .nexus-footer-bottom-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
