/* ============================================================
   EUSTACE ENGINEERING SYSTEMS — style.css
   Fonts: Playfair Display (display) · Space Grotesk (UI/body)
   ============================================================ */

/* ── CUSTOM PROPERTIES ── */
:root {
  --dark1:     #161C2A;
  --dark2:     #1F2535;
  --warm-grey: #6E6A60;
  --champagne: #C8B99A;
  --cream:     #F5F2EC;
  --white:     #FFFFFF;
  --accent:    #1A4F8A;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Space Grotesk', system-ui, sans-serif;

  --container: 1100px;
  --pad-h:     24px;
  --nav-h:     68px;
  --ease:      0.25s ease;
}

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

html {
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--sans);
  background: var(--dark1);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul[role="list"] { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }

/* ── CONTAINER ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-h);
}

/* ── SHARED TYPE ── */
.eyebrow,
.section-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.section-eyebrow.light { color: var(--champagne); }

.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  color: var(--dark1);
}

.section-header { margin-bottom: 48px; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 14px 30px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background var(--ease), transform var(--ease);
}
.btn-primary:hover {
  background: #1e5ba0;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.48);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  padding-bottom: 2px;
  transition: color var(--ease), border-color var(--ease);
}
.btn-ghost:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.45);
}

/* ============================================================
   SCROLL SNAP — desktop only
   ============================================================ */
@media (min-width: 961px) {
  html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100%;
  }
  body { height: 100%; }

  .snap-section {
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
  }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background var(--ease), border-color var(--ease), backdrop-filter var(--ease);
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(22, 28, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255,255,255,0.06);
}

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

.nav-logo {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--white);
  transition: opacity var(--ease);
  white-space: nowrap;
}
.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  transition: color var(--ease);
  position: relative;
  padding-bottom: 3px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--champagne);
  transition: width var(--ease);
}
.nav-links a:hover              { color: rgba(255,255,255,0.88); }
.nav-links a:hover::after       { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: rgba(255,255,255,0.7);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 99;
  background: var(--dark1);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transform: translateY(-110%);
  opacity: 0;
  transition: transform 0.32s ease, opacity 0.32s ease;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu ul { padding: 16px 24px 28px; }
.mobile-menu a {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color var(--ease);
}
.mobile-menu a:hover              { color: var(--white); }
.mobile-menu li:last-child a      { border-bottom: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--dark1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 70% at 78% 48%, rgba(26,79,138,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 35% 45% at 8% 88%,  rgba(200,185,154,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 72px;
  padding-bottom: 80px;
}

.hero .eyebrow {
  color: var(--champagne);
  margin-bottom: 28px;
}

.hero-heading {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.10;
  color: var(--white);
  margin-bottom: 28px;
  max-width: 720px;
}
.hero-heading em {
  font-style: italic;
  color: rgba(255,255,255,0.68);
}

.hero-body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.78;
  color: rgba(255,255,255,0.50);
  max-width: 500px;
  margin-bottom: 44px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

/* Animated scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 48px;
  overflow: hidden;
}
.scroll-hint::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(200,185,154,0.6), transparent);
  animation: scrollDrop 2.2s ease-in-out infinite;
}
@keyframes scrollDrop {
  0%   { transform: translateY(-100%); opacity: 1; }
  100% { transform: translateY(100%);  opacity: 0; }
}

.hero-rule {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(200,185,154,0.15) 35%,
    rgba(200,185,154,0.15) 65%,
    transparent 100%);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  background: var(--white);
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 40px) 0 60px;
}

.services .section-title { color: var(--dark1); }
.services .section-eyebrow { color: var(--accent); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: rgba(0,0,0,0.07);
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.07);
}

.service-card {
  background: var(--cream);
  padding: 36px 28px;
  transition: background var(--ease);
}
.service-card:hover { background: #EDE9E0; }

.service-card-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.service-num {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  flex-shrink: 0;
}

.service-card h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  color: var(--dark1);
}

.service-card p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.75;
  color: var(--warm-grey);
}

/* ============================================================
   CHAPTERS (shared)
   ============================================================ */
.chapter {
  position: relative;
  overflow: hidden;
}

/* Full-bleed split — image fills its half edge to edge */
.chapter-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100vh;
  width: 100%;
}

/* Text column — centred vertically with its own padding */
.chapter-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 72px 64px;
}

.chapter-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 18px;
  display: block;
}

.chapter-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 48px);
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 28px;
}

.chapter-body p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.82;
  color: rgba(255,255,255,0.52);
  margin-bottom: 16px;
}
.chapter-body p:last-child { margin-bottom: 0; }

/* Emphasis line */
.chapter-em {
  font-family: var(--serif) !important;
  font-style: italic !important;
  font-weight: 400 !important;
  font-size: 18px !important;
  color: rgba(255,255,255,0.80) !important;
  margin-top: 8px !important;
}

/* Full-bleed image column */
.chapter-image {
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,0.22);
}

.chapter-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-image span {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(200,185,154,0.28);
  position: relative;
  z-index: 1;
}

/* Ch02 HTML already has image first — no CSS reversal needed */

/* Centred chapters — Ch 03 & 04 */
.chapter-centered {
  text-align: center;
}

.chapter-centered-inner {
  max-width: 640px;
  margin: 0 auto;
}

.chapter-centered .chapter-title {
  font-size: clamp(30px, 4vw, 52px);
}

/* ── TEASE (Ch 04) ── */
.tease::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%,
    rgba(200,185,154,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.tease .chapter-title {
  font-size: clamp(36px, 5.5vw, 68px);
  margin-bottom: 32px;
}

.chapter-tease {
  font-family: var(--sans) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: var(--champagne) !important;
  letter-spacing: 0.02em !important;
  margin-top: 8px !important;
}

.tease-badge {
  margin-top: 52px;
}
.tease-badge span {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 10px 20px;
  border-radius: 2px;
  display: inline-block;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

.contact > .container {
  flex: 1;
  display: flex;
  align-items: center;
}

.contact-inner { max-width: 580px; }

.contact .section-title {
  color: var(--dark1);
  margin-bottom: 20px;
}

.contact-body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.78;
  color: var(--warm-grey);
  margin-bottom: 40px;
}

.contact-email {
  display: inline-block;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid rgba(26,79,138,0.28);
  padding-bottom: 4px;
  margin-bottom: 44px;
  transition: color var(--ease), border-color var(--ease);
}
.contact-email:hover {
  color: #1e5ba0;
  border-color: rgba(26,79,138,0.6);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm-grey);
  transition: color var(--ease);
}
.social-link:hover { color: var(--dark1); }
.social-link svg {
  width: 16px; height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── FOOTER (inside contact section) ── */
.footer {
  background: var(--dark1);
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}

.footer-copy {
  font-family: var(--sans);
  font-size: 10px;
  color: rgba(255,255,255,0.20);
  letter-spacing: 0.06em;
}

/* ============================================================
   FADE-IN ANIMATION
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in:nth-child(2) { transition-delay: 0.12s; }
.fade-in:nth-child(3) { transition-delay: 0.22s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .services { padding-top: calc(var(--nav-h) + 32px); }

  .services-grid { grid-template-columns: 1fr; }
  .service-card  { padding: 28px 24px; }

  .chapter-inner {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .chapter-text {
    padding: calc(var(--nav-h) + 40px) 32px 48px;
  }

  .chapter-image {
    aspect-ratio: 16 / 9;
    min-height: 280px;
    width: 100%;
  }
}

@media (max-width: 640px) {
  :root { --pad-h: 20px; }

  .nav-links  { display: none; }
  .nav-toggle { display: flex; }
  .nav-logo   { font-size: 10px; letter-spacing: 0.06em; }

  .hero-inner { padding-top: 56px; padding-bottom: 72px; }
  .hero-ctas  { flex-direction: column; align-items: flex-start; gap: 20px; }
  .scroll-hint { display: none; }

  .chapter-centered-inner { max-width: 100%; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
