/* ============================================
   CARVALHO TP — Design System
   ============================================ */

:root {
  --bg: #FAFAF7;
  --bg-elev: #FFFFFF;
  --surface: #F4F2ED;
  --surface-2: #131F30;       /* deep navy — used for dark inversion (footer, menu) */
  --text: #131F30;
  --text-dim: #4A5566;
  --text-mute: #8B95A3;
  --accent: #E97D15;          /* original brand orange */
  --accent-hot: #E94F15;
  --accent-2: #68CCD1;        /* original brand cyan */
  --line: rgba(19, 31, 48, 0.10);
  --line-strong: rgba(19, 31, 48, 0.20);
  --on-dark: #FAFAF7;         /* text color when sitting on --surface-2 */
  --on-dark-dim: rgba(250, 250, 247, 0.65);

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 24px;

  --container: 1440px;
  --gutter: clamp(20px, 4vw, 56px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--bg); }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================
   TYPOGRAPHY
   ============================================ */

.eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-size: clamp(56px, 11vw, 200px);
}
.display-md {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-size: clamp(40px, 6vw, 96px);
}
.display-sm {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 3.4vw, 52px);
}

.lead {
  font-size: clamp(18px, 1.3vw, 22px);
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 60ch;
}

.italic-serif {
  font-family: "Bricolage Grotesque", serif;
  font-style: italic;
  font-weight: 400;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { position: relative; }

.section-pad { padding: clamp(80px, 12vh, 160px) 0; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

/* ============================================
   CURSOR
   ============================================ */

/* Custom cursor: a small orange dot follows the mouse 1:1, an outer
   ring lags behind with elastic easing — feels Awwwards-class. */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transition: opacity 0.2s var(--ease-out);
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  opacity: 0.55;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.25s var(--ease-out), background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  background: rgba(233, 125, 21, 0.10);
  border-color: var(--accent);
  opacity: 1;
}
.cursor-ring.is-text {
  width: 4px;
  height: 26px;
  border-radius: 2px;
  background: var(--accent);
  border: none;
  opacity: 1;
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }
@media (max-width: 768px) { .cursor-dot, .cursor-ring { display: none; } }

/* ============================================
   NAV
   ============================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--on-dark);              /* default on hero (dark image) */
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out), backdrop-filter 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
/* When the nav has scrolled off the hero, switch to a light-mode bar */
.nav.is-scrolled {
  color: var(--text);
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
/* Pages without a dark hero start in light-mode */
.nav.is-light { color: var(--text); }

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 14px;
  line-height: 1;
  flex-shrink: 0;
  /* Carve out room for the logo above the nav bar so it can be much
     bigger than the bar itself — true brand presence. */
  padding: 4px 0;
}
.nav-brand .logo {
  width: 96px;
  height: 78px;
  background: url("../assets/images/logo.png") center/contain no-repeat;
  display: inline-block;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  transition: transform 0.5s var(--ease-out);
  margin: -22px 0;   /* lets the bigger logo overflow the nav bar vertically */
}
.nav-brand:hover .logo { transform: rotate(-4deg) scale(1.06); }
.nav-brand .brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}
.nav-brand .brand-text small {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.75;
  font-family: var(--font-body);
}

/* Tighter spacing on the nav links + hide the trailing tagline on narrow widths */
@media (max-width: 1180px) {
  .nav-brand .brand-text small { display: none; }
  .nav-brand .logo { width: 80px; height: 65px; margin: -16px 0; }
}
@media (max-width: 900px) {
  .nav-links { gap: 24px; }
  .nav-links a { font-size: 13px; }
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  letter-spacing: -0.01em;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  /* dashed ruler tick — BTP cue, like a builder's chalk line */
  background-image: repeating-linear-gradient(90deg,
    var(--accent) 0 6px,
    transparent 6px 10px);
  transform-origin: right;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.nav-cta:hover { background: var(--text); color: var(--bg); }

.menu-btn {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.menu-btn span {
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.menu-btn span:nth-child(1) { transform: translate(-50%, calc(-50% - 4px)); }
.menu-btn span:nth-child(2) { transform: translate(-50%, calc(-50% + 4px)); }

.menu-overlay {
  position: fixed;
  inset: 0;
  background:
    /* blueprint grid — references plans BTP */
    repeating-linear-gradient(0deg, rgba(250,250,247,0.04) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(90deg, rgba(250,250,247,0.04) 0 1px, transparent 1px 60px),
    var(--surface-2);
  color: var(--on-dark);
  z-index: 99;
  clip-path: circle(0% at 100% 0);
  transition: clip-path 0.8s var(--ease-in-out);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
/* Single thin orange accent line at the top of the open menu — subtle BTP cue */
.menu-overlay::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.7;
}
.menu-overlay.is-open {
  clip-path: circle(150% at 100% 0);
  pointer-events: auto;
}
.menu-overlay ul {
  list-style: none;
  text-align: center;
}
.menu-overlay li {
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 96px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow: hidden;
}
.menu-overlay li a {
  display: inline-block;
  padding: 4px 0;
  transition: color 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.menu-overlay li a:hover { color: var(--accent); transform: translateX(12px); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: var(--surface-2);
  color: var(--on-dark);
  border-radius: 100px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease-out), color 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Subtle "construction tape" stripe at the top of every button — BTP cue */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    135deg,
    var(--accent) 0 8px,
    transparent 8px 16px
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  z-index: 1;
}
.btn:hover::after { opacity: 1; }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: inherit;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-in-out);
  z-index: -1;
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--on-dark); }
.btn .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost::before { background: var(--surface-2); }
.btn-ghost:hover { color: var(--on-dark); }

/* When a button sits on the dark hero we need it light-on-dark */
.hero .btn { background: var(--on-dark); color: var(--surface-2); }
.hero .btn:hover { color: var(--on-dark); }
.hero .btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(250,250,247,0.4); }

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

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 60px;
  position: relative;
  overflow: hidden;
  color: var(--on-dark);
  background: var(--surface-2);  /* fallback while image loads */
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.55) contrast(1.05) saturate(0.85);
  will-change: transform;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(19,31,48,0.75) 0%, rgba(19,31,48,0.55) 40%, var(--bg) 100%),
    /* faint blueprint grid overlay — references BTP plans */
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 80px);
}
.hero > *:not(.hero-bg) { position: relative; z-index: 1; }
/* Force hero text to be light over the dark image — overrides the global .hero-title */
.hero, .hero .hero-title { color: var(--on-dark) !important; }
.hero .hero-title .accent { color: var(--accent) !important; }
.hero .eyebrow { color: var(--on-dark); opacity: 0.85; }
.hero .eyebrow::before { background: var(--accent); }
.hero .hero-meta .meta-block p { color: var(--on-dark); opacity: 0.9; }
.hero .hero-tag, .hero .scroll-hint { color: var(--on-dark); opacity: 0.85; }
.hero .scroll-hint .line-anim { background: rgba(250,250,247,0.5); }
.hero .hero-tag::before { background: rgba(250,250,247,0.5); }

.hero-inner {
  padding: 0 var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  gap: clamp(40px, 6vh, 80px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}
.hero-meta .meta-block {
  max-width: 360px;
}
.hero-meta .meta-block p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

.hero-title { color: var(--text); }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line span {
  display: inline-block;
  will-change: transform;
}
.hero-title .accent { color: var(--accent); font-style: italic; font-weight: 500; }

.hero-tag {
  position: absolute;
  bottom: 60px;
  right: var(--gutter);
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero-tag::before {
  content: "";
  display: block;
  width: 1px; height: 60px;
  background: var(--line-strong);
  margin: 0 0 14px auto;
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: var(--gutter);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-hint .line-anim {
  display: inline-block;
  width: 60px; height: 1px;
  background: var(--text-dim);
  position: relative;
  overflow: hidden;
}
.scroll-hint .line-anim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: slide 2s var(--ease-in-out) infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ============================================
   MARQUEE
   ============================================ */

.marquee {
  display: flex;
  overflow: hidden;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.marquee-track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
  padding-right: 60px;
}
.marquee-item {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.marquee-item::after {
  content: "";
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

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

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

.services-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 80px;
  flex-wrap: wrap;
}

.service-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.4fr auto;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: padding 0.5s var(--ease-out);
}
.service-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(233, 125, 21, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}
.service-row:hover::before { opacity: 1; }
.service-row:hover { padding: 52px 24px; }
.service-row:hover .service-title { color: var(--accent); transform: translateX(8px); }

.service-num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
}
.service-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.service-desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}
.service-arrow {
  width: 52px; height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.service-row:hover .service-arrow {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: rotate(-45deg);
}

.service-preview {
  position: fixed;
  pointer-events: none;
  top: 0; left: 0;
  width: 360px; height: 460px;
  opacity: 0;
  z-index: 80;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.4s var(--ease-out);
  will-change: transform;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.service-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ============================================
   FIGURES / STATS
   ============================================ */

.stats {
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat {
  padding: 60px 32px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 104px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.stat-num .suffix {
  font-size: 0.4em;
  margin-top: 0.2em;
  color: var(--accent);
}
.stat-label {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.about-img {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-l);
  overflow: hidden;
}
.about-img img {
  width: 100%; height: 100%; object-fit: cover;
  will-change: transform;
}
.about-img .badge {
  position: absolute;
  top: 24px; left: 24px;
  background: var(--accent);
  color: var(--surface-2);
  padding: 10px 18px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.about-text h2 { margin-bottom: 32px; }
.about-text p { color: var(--text-dim); margin-bottom: 20px; font-size: 17px; line-height: 1.65; }
.about-text p strong { color: var(--text); font-weight: 500; }

.signature {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.signature .sig-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
}

/* ============================================
   PROJECTS
   ============================================ */

.projects {
  background: var(--bg);
}
.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 80px;
  flex-wrap: wrap;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
}
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-m);
  aspect-ratio: 4/5;
  cursor: pointer;
  display: block;
}
.project-card:nth-child(1) { grid-column: span 7; aspect-ratio: 16/11; }
.project-card:nth-child(2) { grid-column: span 5; aspect-ratio: 4/5; }
.project-card:nth-child(3) { grid-column: span 4; }
.project-card:nth-child(4) { grid-column: span 8; aspect-ratio: 16/11; }
.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
  will-change: transform;
}
.project-card:hover img { transform: scale(1.05); }
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(14,14,12,0.85) 100%);
}
.project-meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  color: var(--on-dark);
}
.project-meta h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--on-dark);
}
.project-meta .tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-dim);
  margin-bottom: 6px;
  display: block;
}
.project-card .pill {
  position: absolute;
  top: 24px; left: 24px;
  background: rgba(19, 31, 48, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--on-dark);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  z-index: 1;
  border: 1px solid rgba(250, 250, 247, 0.18);
}
.project-card::after {
  /* override the default dark gradient ending to keep it on top of image */
  background: linear-gradient(180deg, transparent 40%, rgba(19, 31, 48, 0.85) 100%);
}

/* ============================================
   CTA BLOCK
   ============================================ */

.cta-block {
  position: relative;
  background: var(--surface-2);
  color: var(--on-dark);
  border-radius: var(--radius-l);
  padding: clamp(60px, 10vw, 120px) clamp(40px, 6vw, 80px);
  overflow: hidden;
  text-align: center;
}
.cta-block .eyebrow { color: var(--on-dark-dim); }
.cta-block .eyebrow::before { background: var(--accent); }
.cta-block h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 100px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 32px;
  color: var(--on-dark);
}
.cta-block h2 .italic-serif { color: var(--accent); }
.cta-block .lead { color: var(--on-dark-dim); margin: 0 auto 40px; }
.cta-block .btn { background: var(--accent); color: var(--surface-2); }
.cta-block .btn::before { background: var(--on-dark); }
.cta-block .btn:hover { color: var(--surface-2); }

.cta-block::before, .cta-block::after {
  content: "";
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 125, 21, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.cta-block::before { top: -300px; left: -200px; }
.cta-block::after { bottom: -300px; right: -200px; }

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

.footer {
  padding: 80px var(--gutter) 40px;
  background: var(--surface-2);
  color: var(--on-dark);
  border-top: 1px solid var(--line);
}
.footer .footer-col h4 { color: var(--on-dark-dim); }
.footer .footer-col p, .footer .footer-col a { color: var(--on-dark-dim); }
.footer .footer-col a:hover { color: var(--accent); }
.footer .footer-bottom { color: var(--on-dark-dim); border-top-color: rgba(250,250,247,0.10); }
.footer .footer-mega {
  background: linear-gradient(180deg, var(--on-dark) 0%, rgba(250,250,247,0.25) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 80px;
  max-width: var(--container);
  margin-left: auto; margin-right: auto;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.footer-brand .accent { color: var(--accent); font-style: italic; font-weight: 500; }
.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--text-dim); font-size: 15px; transition: color 0.3s var(--ease-out); }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.footer-mega {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(80px, 18vw, 280px);
  letter-spacing: -0.05em;
  line-height: 0.85;
  text-align: center;
  margin: 40px 0;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-mute) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

/* ============================================
   INNER PAGE HERO (service / contact)
   ============================================ */

.page-hero {
  padding: 200px var(--gutter) 100px;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: flex-end;
}
.page-hero h1 { color: var(--text); }
.page-hero .crumbs {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 32px;
  display: flex; align-items: center; gap: 12px;
}
.page-hero .crumbs span { color: var(--accent); }

.page-cover {
  margin: 0 var(--gutter);
  max-width: var(--container);
  width: calc(100% - var(--gutter)*2);
  height: clamp(320px, 60vh, 600px);
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-left: auto; margin-right: auto;
  position: relative;
}
.page-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* ============================================
   SERVICE FEATURES
   ============================================ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  padding: 40px 32px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  transition: border-color 0.3s var(--ease-out), background 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.feature:hover {
  border-color: var(--accent);
  background: rgba(233, 125, 21, 0.05);
  transform: translateY(-4px);
}
.feature .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--surface);
  display: grid; place-items: center;
  margin-bottom: 24px;
  color: var(--accent);
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.feature:hover .icon { background: var(--accent); color: var(--on-dark); }
.feature h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.feature p { color: var(--text-dim); font-size: 15px; line-height: 1.55; }

/* ============================================
   PROCESS STEPS
   ============================================ */

.process {
  background: var(--bg);
}
.process-list { display: flex; flex-direction: column; }
.process-step {
  display: grid;
  grid-template-columns: 140px 1fr 2fr;
  gap: 40px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.process-step:last-child { border-bottom: 1px solid var(--line); }
.process-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 80px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.process-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.process-desc { color: var(--text-dim); font-size: 16px; line-height: 1.6; }

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

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: flex-start;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.info-block {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  transition: border-color 0.3s var(--ease-out);
}
.info-block:hover { border-color: var(--accent); }
.info-block .label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 16px;
}
.info-block .value {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.info-block .value a:hover { color: var(--accent); }
.info-block .secondary { color: var(--text-dim); font-size: 15px; margin-top: 8px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--bg-elev);
  box-shadow: 0 10px 40px rgba(19, 31, 48, 0.05);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.field input,
.field select,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 14px 0;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s var(--ease-out);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; cursor: pointer; }

.map-wrap {
  margin-top: 80px;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
}
.map-wrap iframe { width: 100%; height: 480px; border: none; display: block; }

/* ============================================
   PAGE LOADER / TRANSITION
   ============================================ */

/* Page transition: 6 horizontal "steel beams" that slide in from
   ALTERNATING sides (L/R) to build a cover, then slide out alternating
   sides to deconstruct. Pure CSS transitions with staggered delays —
   no GSAP timeline that can stall. */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.page-transition .pt-beam {
  flex: 1;
  background: var(--surface-2);
  will-change: transform;
  position: relative;
  /* Rest = off-screen LEFT (entry side). The whole curtain travels in ONE
     direction across the navigation: enters from the left, exits to the right.
     No alternation, no reversal — reads as a single continuous wipe. */
  transform: translateX(-101%);
  transition: transform 0.42s cubic-bezier(0.65, 0, 0.35, 1);
}
.page-transition .pt-beam:nth-child(1) { background: #131F30; transition-delay: 0s; }
.page-transition .pt-beam:nth-child(2) { background: #16243A; transition-delay: 0.03s; }
.page-transition .pt-beam:nth-child(3) { background: #182A48; transition-delay: 0.06s; }
.page-transition .pt-beam:nth-child(4) { background: #182A48; transition-delay: 0.09s; }
.page-transition .pt-beam:nth-child(5) { background: #16243A; transition-delay: 0.12s; }
.page-transition .pt-beam:nth-child(6) { background: #131F30; transition-delay: 0.15s; }
/* Thin orange rebar line at the top edge of each beam — discreet BTP cue */
.page-transition .pt-beam::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(233, 125, 21, 0.35);
}
.page-transition .pt-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.page-transition .pt-logo {
  width: 130px;
  height: 105px;
  background: url("../assets/images/logo.png") center/contain no-repeat;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.55));
}
.page-transition .pt-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark);
  opacity: 0.9;
}

/* COVER STATE — beams in place, logo visible. Triggered by:
   - .nav-in (pre-paint on arrival from a transition)
   - .is-showing (when leaving via link click) */
html.nav-in .page-transition .pt-beam,
.page-transition.is-showing .pt-beam {
  transform: translateX(0);                      /* covering the viewport */
}
/* LEAVING STATE — continue the sweep to the RIGHT to uncover the new page. */
.page-transition.is-leaving .pt-beam {
  transform: translateX(101%);
}
html.nav-in .page-transition,
.page-transition.is-showing,
.page-transition.is-leaving {
  pointer-events: auto;
}
html.nav-in .page-transition .pt-content,
.page-transition.is-showing .pt-content {
  opacity: 1;
}
/* Navy backing while the screen is covered so the page-swap blank never
   flashes the cream body background through. */
html.nav-in { background: var(--surface-2); }
html.nav-in .loader { display: none !important; }

.loader {
  position: fixed;
  inset: 0;
  background: transparent;     /* navy lives on .loader-backdrop so we can clip just the panel */
  color: var(--on-dark);
  z-index: 10000;
  overflow: hidden;
  pointer-events: auto;
}
/* The "panel" — navy backdrop + intro typography. Gets clip-pathed from the
   right edge as the tractopelle plows across, revealing the hero behind. */
.loader-backdrop {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  z-index: 1;
  will-change: clip-path;
}
.loader-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
}
/* Orange ground streak — inside the backdrop so it clears with the panel */
.loader-ground {
  position: absolute;
  left: 0; right: 0;
  bottom: 8vh;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 10%, var(--accent) 90%, transparent);
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}
.loader-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;        /* above backdrop, below tractor */
}
.dust-particle {
  position: absolute;
  bottom: 7.5vh;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233,125,21,0.55), rgba(139,149,163,0.0));
  pointer-events: none;
  will-change: transform, opacity;
}
/* The HUGE rolling tractopelle SVG (recoloured Noto, CC-BY 4.0). Anchored
   bottom of its viewBox sitting just above the orange ground line. */
.loader-tractor {
  position: absolute;
  bottom: 6vh;
  left: 100vw;                 /* off-screen right at start */
  height: 110vh;               /* bigger than viewport — "qu'on voit à moitié" */
  width: auto;
  aspect-ratio: 1 / 1;
  z-index: 4;                  /* above backdrop and dust — paints over the panel as it advances */
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.45));
}
.tractor-wheel-front,
.tractor-wheel-back {
  will-change: transform;
  /* No transform-box — GSAP writes svgOrigin to the SVG transform attribute
     directly; CSS transform-box would shift the pivot to the bounding box
     and make the wheels swing around an off-centre point. */
}
.loader-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  border-radius: 100px;
  background: rgba(250,250,247,0.08);
  border: 1px solid rgba(250,250,247,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 8px;
}
.loader-mark .loader-logo-img {
  width: 60px;
  height: 48px;
  background: url("../assets/images/logo.png") center/contain no-repeat;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}
.loader-mark .loader-baseline {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-dim);
}
.loader .pct { color: var(--on-dark-dim); }
.loader .bar { background: rgba(250,250,247,0.18); width: 320px; }

/* The ground line — orange streak the rig rolls on */
.loader-ground {
  position: absolute;
  left: 0; right: 0;
  bottom: 7vh;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 12%, var(--accent) 88%, transparent);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 2;
  pointer-events: none;
}

/* HUGE tractopelle — wider than the viewport on purpose so we only see
   part of it at any moment as it rolls across. */
.loader-tractor {
  position: absolute;
  bottom: 4vh;                         /* wheel base lands just above the ground line */
  left: 100vw;                         /* off-screen right at start */
  height: 78vh;
  width: auto;
  aspect-ratio: 1400 / 600;            /* matches the SVG viewBox */
  z-index: 3;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.5));
}
.tractor-wheel { will-change: transform; transform-box: fill-box; }

/* Dust particle container — pinned to the bottom-middle of the screen */
.loader-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.dust-particle {
  position: absolute;
  bottom: 7vh;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233,125,21,0.6), rgba(139,149,163,0.0));
  pointer-events: none;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  .loader-tractor { height: 56vh; bottom: 6vh; }
  .loader-ground { bottom: 9vh; }
  .dust-particle { bottom: 9vh; }
}
.loader .logo-big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(60px, 10vw, 140px);
  letter-spacing: -0.04em;
  overflow: hidden;
}
.loader .logo-big span {
  display: inline-block;
  will-change: transform;
}
.loader .bar {
  width: 280px;
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.loader .bar-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.loader .pct {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

/* ============================================
   REVEAL
   Content is visible by default. JS adds the `js-ready` flag
   on <html> once it's about to animate — that's the only state
   in which we hide things to reveal them. No JS → no flash, no
   invisible content.
   ============================================ */

html.js-ready [data-reveal] { opacity: 0; will-change: transform, opacity; }
.split-line { overflow: hidden; display: block; }

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

@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 60px 40px; }
  .contact-grid { grid-template-columns: 1fr; }
  .page-hero-inner { grid-template-columns: 1fr; }
  .projects-grid > .project-card { grid-column: span 6 !important; aspect-ratio: 4/5 !important; }
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .menu-btn { display: block; }
  .nav { padding: 18px var(--gutter); }
  .hero { padding-bottom: 120px; }
  .hero-tag { display: none; }
  .service-row {
    grid-template-columns: 40px 1fr auto;
    gap: 20px;
    padding: 28px 0;
  }
  .service-row:hover { padding: 28px 8px; }
  .service-desc { display: none; }
  .service-num { font-size: 12px; }
  .feature-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-bottom: 1px solid var(--line); }
  .projects-grid { gap: 20px; }
  .projects-grid > .project-card { grid-column: span 12 !important; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-form { padding: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .process-step { grid-template-columns: 80px 1fr; }
  .process-step .process-desc { grid-column: 2; }
  .process-num { font-size: 56px; }
  .cursor { display: none; }
  .signature { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .marquee-track { animation: none; }
}
