/* ============================================================
   Widmer Structural Consulting — styles
   Engineering-blueprint aesthetic: navy + structural blue,
   light-blue blueprint grid, paper-white body sections.
   ============================================================ */

:root {
  /* palette */
  --navy:        #0E2A47;
  --navy-deep:   #081B30;
  --blue:        #1B5FA8;
  --blue-bright: #2C77C9;
  --blue-light:  #6FA8DC;
  --paper:       #F6F9FC;
  --paper-2:     #ECF1F8;
  --ink:         #13233A;
  --ink-soft:    #4A5B72;
  --white:       #FFFFFF;
  --line:        rgba(27, 95, 168, 0.16);

  /* type */
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body:    "Hanken Grotesk", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* layout */
  --container: 1140px;
  --radius:    16px;
  --radius-sm: 10px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

/* ---------- shared typographic atoms ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 500;
}
.eyebrow--light { color: var(--blue-light); }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-top: 0.5rem;
}
.section-head--light .section-title { color: var(--white); }

.section-lead {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 1rem;
}
.section-lead--light { color: rgba(255,255,255,0.82); }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

/* ---------- blueprint grid overlay ---------- */
.blueprint-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(111,168,220,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111,168,220,0.16) 1px, transparent 1px),
    linear-gradient(rgba(111,168,220,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111,168,220,0.07) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 30%, #000 40%, transparent 100%);
  z-index: 1;
}
/* ---- blueprint blue panel (poster-style) for Services & Affiliations ---- */
.section--blueprint {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(86,150,214,0.35), transparent 60%),
    linear-gradient(165deg, #2A6CB0 0%, #1B5391 55%, #143F72 100%);
}
.section--blueprint > .container { position: relative; z-index: 2; }
.section--blueprint .blueprint-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 132px 132px, 132px 132px, 26px 26px, 26px 26px;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-header.scrolled {
  background: rgba(8, 21, 36, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 11px;
  color: var(--blue-light);
  flex-shrink: 0;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--blue-light);
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255,255,255,0.74);
  padding: 9px 14px;
  border-radius: 9px;
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a.active { color: var(--white); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--blue-light);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block; height: 2px; width: 24px;
  background: var(--white); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.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; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   01 · HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 90px;
  overflow: hidden;
  background: var(--navy-deep);
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("assets/hero-bg.jpg") center / cover no-repeat;
  z-index: 0;
  transform: scale(1.05);
  animation: heroZoom 18s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }

.hero-scrim {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(8,21,36,0.74) 0%, rgba(8,21,36,0.42) 35%, rgba(8,21,36,0.86) 100%),
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(14,42,71,0.20), rgba(8,21,36,0.78));
}

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

.hero-logo { margin: 6px 0 18px; }
.hero-logo img {
  width: clamp(180px, 30vw, 252px);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--white);
  text-wrap: balance;
}
.hero-tagline {
  margin-top: 1.1rem;
  font-size: clamp(1.02rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.85);
  max-width: 38ch;
}

.hero-cards {
  margin-top: clamp(2.4rem, 5vw, 3.4rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 860px;
  text-align: left;
}
.glass-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.glass-card p { color: rgba(255,255,255,0.88); font-size: 0.98rem; }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(111,168,220,0.4);
}

.scroll-cue {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.scroll-cue svg { animation: bob 1.8s var(--ease) infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section { position: relative; padding: clamp(4.5rem, 9vw, 7.5rem) 0; }

/* 02 · SERVICES */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px 28px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
  overflow: hidden;
}
.service-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -22px rgba(14,42,71,0.4);
  border-color: transparent;
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  margin: 0 0 18px;
  border-radius: 13px;
  background: var(--paper-2);
  color: var(--blue);
}
.service-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.22rem;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.service-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* 03 · AFFILIATIONS */
.logo-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  position: relative;
  z-index: 2;
}
.logo-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.logo-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 40px -24px rgba(14,42,71,0.45);
}
.logo-tile img {
  height: 64px;
  width: auto;
  object-fit: contain;
}
/* dark-on-black partner logo (e.g. Legacy Builders) — present as a neat chip */
.logo-tile--dark img {
  height: 72px;
  border-radius: 10px;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
}
.logo-tile figcaption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* 04 · CONTACT */
.section--contact {
  position: relative;
  background: var(--navy-deep);
  padding-bottom: 0;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg--contact {
  background: url("assets/hero-bg.jpg") center / cover no-repeat;
  filter: saturate(0.85);
  transform: scale(1.05);
  animation: none;
}
.contact-inner { position: relative; z-index: 2; text-align: center; padding-bottom: clamp(4rem, 8vw, 6rem); }
.contact-inner .section-head { margin-inline: auto; }
.contact-inner .section-lead { margin-inline: auto; }

.contact-engineer {
  font-family: var(--font-display);
  color: var(--white);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-engineer strong { font-size: 1.4rem; font-weight: 700; }
.contact-engineer .cred {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-deep);
  background: var(--blue-light);
  padding: 5px 11px;
  border-radius: 20px;
}

.contact-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2.1rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}
.contact-location svg { color: var(--blue-light); flex-shrink: 0; }

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}
.contact-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 16px 24px;
  min-width: 230px;
  color: var(--white);
  text-align: left;
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.contact-btn:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.12);
  border-color: rgba(111,168,220,0.6);
}
.contact-btn-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 11px;
  background: var(--blue);
  color: var(--white);
  flex-shrink: 0;
}
.contact-btn--wa .contact-btn-icon { background: #25D366; }
.contact-btn-text { display: flex; flex-direction: column; font-weight: 600; font-size: 1.02rem; }
.contact-btn-text small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 3px;
}

/* FOOTER */
.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(6,16,28,0.6);
}
.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-block: 26px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.6);
}
.footer-about { display: flex; flex-direction: column; gap: 5px; max-width: 42ch; }
.footer-about strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  letter-spacing: 0.01em;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}
.footer-credit a { color: var(--blue-light); }
.footer-credit a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .footer-meta { text-align: left; }
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px clamp(20px, 5vw, 40px) 28px;
    background: rgba(8,21,36,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 14px 12px; font-size: 1rem; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: rgba(255,255,255,0.07); }

  .hero-cards { grid-template-columns: 1fr; }
  .logo-row { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .contact-btn { min-width: 0; width: 100%; max-width: 340px; }
  .contact-actions { flex-direction: column; align-items: center; }
}

@media (max-width: 460px) {
  .services-grid { grid-template-columns: 1fr; }
  .brand-text { font-size: 1rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-bg, .hero-bg--contact { transform: none; }
}
