/* =============================================
   MACDONALD TECH — STYLESHEET
   ============================================= */

/* --- CUSTOM PROPERTIES ----------------------------------------------- */
:root {
  /* Brand colours */
  --navy:        #1A2A4A;
  --navy-deep:   #121e36;
  --blue:        #2D6FD4;
  --blue-dark:   #2562bc;
  --blue-light:  #e8f0fb;
  --graphite:    #111111;
  --cloud:       #F4F6FB;
  --cloud-dark:  #eaecf3;
  --white:       #FFFFFF;
  --muted:       #64748b;
  --border:      #e2e6ef;
  --border-dark: #cdd2df;

  /* Fonts */
  --font-display: 'Rajdhani', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;

  /* Layout */
  --nav-h:        80px;
  --max-w:        1200px;
  --pad:          clamp(20px, 4vw, 48px);

  /* Shadows */
  --sh-card:      0 1px 2px rgba(26,42,74,0.05), 0 4px 16px rgba(26,42,74,0.07);
  --sh-card-up:   0 4px 8px rgba(26,42,74,0.08), 0 16px 40px rgba(26,42,74,0.13);
  --sh-btn:       0 2px 8px rgba(45,111,212,0.30), 0 1px 2px rgba(45,111,212,0.15);
  --sh-btn-up:    0 6px 20px rgba(45,111,212,0.40), 0 2px 6px rgba(45,111,212,0.20);
}

/* --- RESET ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); font-weight: 400; color: var(--graphite); background: var(--white); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; }
input, textarea, button, select { font-family: var(--font-body); }

/* --- CONTAINER --------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* --- SECTION SHARED ---------------------------------------------------- */
.section { padding-top: var(--sp-24); padding-bottom: var(--sp-24); }

.section__header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto var(--sp-16);
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: var(--sp-4);
}

.section__heading {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin-bottom: var(--sp-4);
}

.section__sub {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  font-weight: 300;
}

/* --- BUTTONS ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 34px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition:
    transform   0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow  0.18s ease,
    background  0.18s ease,
    color       0.18s ease,
    border-color 0.18s ease;
}
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn:active { transform: scale(0.97) !important; }

.btn--primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--sh-btn);
}
.btn--primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--sh-btn-up);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid rgba(26, 42, 74, 0.35);
}
.btn--outline:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,42,74,0.18);
}


/* =============================================
   NAVIGATION
   ============================================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background 0.28s ease, box-shadow 0.28s ease;
}

.nav--scrolled {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border), 0 2px 20px rgba(26,42,74,0.08);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo — white on dark hero, full-colour when scrolled */
.nav__logo img {
  width: auto;
  max-height: 110px;
  filter: brightness(0) invert(1);
  transition: filter 0.28s ease;
}
.nav--scrolled .nav__logo img { filter: none; }

/* Desktop links */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav__link {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.80);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.15s ease;
}
.nav--scrolled .nav__link { color: var(--navy); }

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--blue);
  transition: width 0.22s ease;
}
.nav__link:hover { color: var(--white); }
.nav--scrolled .nav__link:hover { color: var(--blue); }
.nav__link:hover::after { width: 100%; }

/* CTA link in nav */
.nav__link--cta {
  background: var(--blue);
  color: var(--white) !important;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-btn);
  letter-spacing: 1px;
}
.nav__link--cta::after { display: none; }
.nav__link--cta:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--sh-btn-up);
}

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: background 0.15s ease;
}
.nav__toggle:hover { background: rgba(255,255,255,0.1); }
.nav--scrolled .nav__toggle:hover { background: var(--cloud); }

.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease, background 0.28s ease;
}
.nav--scrolled .nav__toggle span { background: var(--navy); }

.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =============================================
   HERO
   ============================================= */

.hero {
  min-height: 100vh;
  background: var(--navy);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

/* Subtle grid texture */
.hero__bg-grid {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg,   rgba(255,255,255,0.022) 0px, rgba(255,255,255,0.022) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg,  rgba(255,255,255,0.022) 0px, rgba(255,255,255,0.022) 1px, transparent 1px, transparent 64px);
  pointer-events: none;
}

/* Atmospheric glow */
.hero__bg-glow {
  position: absolute;
  bottom: -10%;
  left: 40%;
  transform: translateX(-50%);
  width: 100%;
  height: 80%;
  background: radial-gradient(ellipse at 50% 100%, rgba(45,111,212,0.20) 0%, transparent 65%);
  pointer-events: none;
}
.hero__bg-glow--2 {
  top: -20%;
  bottom: auto;
  left: 70%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at 50% 30%, rgba(45,111,212,0.10) 0%, transparent 60%);
}

/* Layout */
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: var(--sp-32);
  padding-bottom: var(--sp-32);
  position: relative;
  z-index: 1;
}

.hero__content {
  max-width: 780px;
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.50);
  display: block;
  margin-bottom: var(--sp-4);
}

.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(52px, 7.5vw, 88px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: var(--sp-6);
}

.hero__accent { color: var(--blue); }

.hero__sub {
  font-size: clamp(16px, 1.8vw, 18px);
  font-weight: 300;
  line-height: 1.80;
  color: rgba(255,255,255,0.68);
  max-width: 900px;
  white-space: nowrap;
  margin: 0 auto var(--sp-8);
}


/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
}
.hero__scroll-line {
  display: block;
  width: 1px; height: 52px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
  animation: scroll-pulse 1.9s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%   { transform: scaleY(0); transform-origin: top;    opacity: 0; }
  45%  { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  55%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}


/* =============================================
   SERVICES
   ============================================= */

.services { background: var(--cloud); }

.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}

.service-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--border);
  box-shadow: var(--sh-card);
  position: relative;
  overflow: hidden;
  transition:
    transform    0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow   0.24s ease,
    border-color 0.24s ease;
}

/* Sliding top-border accent on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #5a9cf0);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--sh-card-up); border-color: rgba(45,111,212,0.18); }
.service-card:hover::before { transform: scaleX(1); }

.service-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--blue-light);
  color: var(--blue);
  margin-bottom: var(--sp-5);
  transition: background 0.22s ease, color 0.22s ease;
}
.service-card__icon svg { width: 22px; height: 22px; flex-shrink: 0; }
.service-card:hover .service-card__icon {
  background: var(--blue);
  color: var(--white);
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.service-card__desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 300;
}


/* =============================================
   ABOUT
   ============================================= */

.about {
  background: var(--white);
  position: relative;
  overflow: hidden;
}

/* Soft ambient circle */
.about::after {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,111,212,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.about__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 128px);
  align-items: start;
}

.about__content .section__eyebrow { display: block; text-align: left; }

.about__heading { text-align: left; }

.about__body {
  font-size: 16px;
  line-height: 1.85;
  color: #4a5568;
  font-weight: 300;
  margin-bottom: var(--sp-5);
}

.about__content .btn { margin-top: var(--sp-3); }

/* Pillars */
.about__pillars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: 56px; /* visually aligns with heading */
}

.pillar {
  padding: var(--sp-6);
  background: var(--cloud);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pillar::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pillar:hover { transform: translateX(4px); box-shadow: var(--sh-card); border-color: var(--border-dark); }
.pillar:hover::before { opacity: 1; }

.pillar__num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--blue);
  margin-bottom: var(--sp-2);
}

.pillar__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--sp-1);
  letter-spacing: 0.2px;
}

.pillar__desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 300;
}


/* =============================================
   CONTACT
   ============================================= */

.contact { background: var(--cloud); }

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}

.contact__info .section__eyebrow { display: block; text-align: left; }
.contact__heading { text-align: left; }

.contact__intro {
  font-size: 16px;
  line-height: 1.80;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: var(--sp-8);
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 15px;
  color: var(--graphite);
  font-weight: 400;
}

.contact__detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--blue);
}
.contact__detail-icon svg { width: 16px; height: 16px; }

/* Form card */
.contact__form-wrap {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-10) clamp(24px, 4vw, 40px);
  box-shadow: var(--sh-card-up);
  border: 1px solid var(--border);
}

.form__row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form__group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.form__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form__req  { color: var(--blue); margin-left: 1px; }
.form__optional { color: var(--muted); font-weight: 400; }

.form__input {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--graphite);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form__input::placeholder { color: #b8c2d4; }
.form__input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45,111,212,0.12);
}
.form__input--error {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229,62,62,0.10) !important;
}

.form__textarea {
  resize: vertical;
  min-height: 128px;
  line-height: 1.6;
}

.form__error {
  font-size: 12px;
  color: #c53030;
  margin-top: 5px;
  min-height: 16px;
  line-height: 1.4;
}

.form__submit {
  width: 100%;
  position: relative;
  margin-bottom: 0;
}

.form__submit-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
}
.form__submit.is-loading .form__submit-label { opacity: 0; }
.form__submit.is-loading .form__submit-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.form__feedback {
  margin-top: var(--sp-4);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  display: none;
  line-height: 1.5;
}
.form__feedback.is-success {
  display: block;
  background: rgba(34,197,94,0.09);
  border: 1px solid rgba(34,197,94,0.28);
  color: #166534;
}
.form__feedback.is-error {
  display: block;
  background: rgba(229,62,62,0.07);
  border: 1px solid rgba(229,62,62,0.22);
  color: #9b1c1c;
}


/* =============================================
   FOOTER
   ============================================= */

.footer { background: var(--navy-deep); }

.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-12);
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-12);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-6);
}

.footer__logo {
  height: 150px;
  width: auto;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.footer__tagline {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.38);
  max-width: 260px;
  line-height: 1.65;
}

.footer__nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.footer__nav a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  transition: color 0.15s ease;
}
.footer__nav a:hover { color: var(--white); }

.footer__bottom {
  padding: var(--sp-5) 0;
}
.footer__bottom p {
  font-size: 13px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}


/* =============================================
   SCROLL REVEAL — transform-only (opacity always 1)
   Content is always readable. JS enhances with a slide
   when elements enter the viewport.
   ============================================= */

.will-slide {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Hero entrance animations */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.hero__eyebrow { animation: hero-fade-up 0.7s ease 0.1s both; }
.hero__heading { animation: hero-fade-up 0.7s ease 0.22s both; }
.hero__sub     { animation: hero-fade-up 0.7s ease 0.36s both; }
.hero .btn     { animation: hero-fade-up 0.7s ease 0.48s both; }


/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 1024px) {
  .section { padding-top: var(--sp-20); padding-bottom: var(--sp-20); }

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

  .about__inner { grid-template-columns: 1fr; gap: var(--sp-12); }
  .about__pillars { padding-top: 0; flex-direction: row; flex-wrap: wrap; }
  .pillar { flex: 1; min-width: 240px; }

  .contact__inner { grid-template-columns: 1fr; gap: var(--sp-12); }

  .hero__inner { padding-top: var(--sp-20); padding-bottom: var(--sp-20); }
}

/* Mobile */
@media (max-width: 768px) {
  :root { --sp-32: 80px; --sp-24: 64px; }

  .nav__links { display: none; }
  .nav__toggle { display: flex; }

  /* Mobile nav drawer */
  .nav__links--open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--navy-deep);
    padding: var(--sp-6) var(--pad) var(--sp-10);
    gap: var(--sp-1);
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.40);
    animation: drawer-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav--scrolled .nav__links--open {
    background: var(--white);
    border-top: 1px solid var(--border);
  }
  .nav__links--open .nav__link {
    font-size: 18px;
    color: rgba(255,255,255,0.80);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .nav--scrolled .nav__links--open .nav__link { color: var(--navy); border-bottom-color: var(--border); }
  .nav__links--open .nav__link:last-child { border-bottom: none; }
  .nav__links--open .nav__link--cta {
    margin-top: var(--sp-4);
    text-align: center;
    border: none;
    font-size: 14px;
    padding: 7px 16px;
    align-self: flex-start;
  }
  .nav__links--open .nav__link--cta:hover { transform: none; }

  @keyframes drawer-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }

  .form__row--2 { grid-template-columns: 1fr; }

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

  .about__pillars { flex-direction: column; }

  .footer__top { flex-direction: column; gap: var(--sp-8); }
  .footer__nav ul { flex-direction: row; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6); }
}

/* Small phones */
@media (max-width: 480px) {
  .hero__sub { white-space: normal; }
  .hero__heading { font-size: clamp(40px, 13vw, 60px); }
  .hero__inner { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
  .contact__form-wrap { padding: var(--sp-6) var(--sp-5); }
  .btn { padding: 13px 26px; font-size: 14px; }
}
