:root {
  --navy:      #0E2148;
  --navy-deep: #081330;
  --red:       #D81E2C;
  --red-soft:  #ff3d4d;
  --ink:       #0c1a36;
  --paper:     #f4f6fb;
  --line:      rgba(120, 170, 255, 0.55);
  --line-dim:  rgba(120, 170, 255, 0.22);
  --glass:     rgba(255, 255, 255, 0.06);
  --shadow:    0 30px 80px -20px rgba(0, 0, 0, 0.65);
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--navy-deep);
  color: #eef2fb;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  min-height: 100vh;
}

/* ===================== Background ===================== */
.bg-photo {
  position: fixed; inset: 0;
  background: url("assets/engineering-bg.jpg") center/cover no-repeat;
  filter: grayscale(0.35) contrast(1.05) brightness(0.55);
  transform: scale(1.08);
  animation: slowPan 38s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes slowPan {
  0%   { transform: scale(1.08) translate(0, 0); }
  100% { transform: scale(1.16) translate(-2.5%, -2%); }
}

.bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(14, 33, 72, 0.55), transparent 60%),
    radial-gradient(120% 120% at 80% 90%, rgba(216, 30, 44, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(8, 19, 48, 0.86), rgba(8, 19, 48, 0.92));
}

/* Blueprint moving grid */
.blueprint-grid {
  position: fixed; inset: -2px; z-index: 2;
  background-image:
    linear-gradient(var(--line-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dim) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(110% 110% at 50% 40%, #000 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(110% 110% at 50% 40%, #000 35%, transparent 85%);
  animation: gridMove 24s linear infinite;
  opacity: 0.7;
}
@keyframes gridMove {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 44px 44px, 44px 44px; }
}

/* Technical drawing that "draws itself" */
.blueprint-draw {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2;
  opacity: 0.45;
}
.blueprint-draw .ln {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawLine 6s ease-in-out forwards;
  filter: drop-shadow(0 0 4px rgba(120, 170, 255, 0.35));
}
.draw-group .ln:nth-child(1) { animation-delay: .2s; }
.draw-group .ln:nth-child(2) { animation-delay: .8s; }
.draw-group .ln:nth-child(3) { animation-delay: 1.1s; }
.draw-group .ln:nth-child(4) { animation-delay: 1.5s; }
.draw-group .ln:nth-child(5) { animation-delay: 1.9s; }
.draw-group .ln:nth-child(6) { animation-delay: 2.3s; }
.draw-group .ln:nth-child(7) { animation-delay: 2.7s; }
.g2 .ln { animation-delay: 2.6s; }
.g2 .ln:nth-child(2) { animation-delay: 3.0s; }
.g2 .ln:nth-child(3) { animation-delay: 3.3s; }
.g2 .ln:nth-child(4) { animation-delay: 3.7s; }
.g2 .ln:nth-child(5) { animation-delay: 4.1s; }
.dim .ln { animation-delay: 4.4s; }

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Floating particles (rivets / dust) */
.particles { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.p {
  position: absolute; display: block;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 10px rgba(120, 170, 255, 0.6);
  animation: floatUp linear infinite;
}
.p1 { left: 12%; bottom: -10px; animation-duration: 16s; }
.p2 { left: 28%; bottom: -10px; width: 4px; height: 4px; animation-duration: 22s; animation-delay: 3s; background: rgba(216,30,44,.55); }
.p3 { left: 47%; bottom: -10px; animation-duration: 19s; animation-delay: 6s; }
.p4 { left: 66%; bottom: -10px; width: 5px; height: 5px; animation-duration: 25s; animation-delay: 2s; }
.p5 { left: 81%; bottom: -10px; animation-duration: 18s; animation-delay: 8s; background: rgba(216,30,44,.5); }
.p6 { left: 92%; bottom: -10px; width: 3px; height: 3px; animation-duration: 28s; animation-delay: 5s; }
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-110vh) translateX(30px); opacity: 0; }
}

/* ===================== Content card ===================== */
.stage {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px 16px 32px;
}

.card {
  width: min(600px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(244,246,251,0.95));
  border: 1px solid rgba(14, 33, 72, 0.10);
  border-radius: 24px;
  padding: 40px 48px 30px;
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: cardIn 1s cubic-bezier(.2,.8,.2,1) both;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(120deg, transparent, rgba(216,30,44,.7), transparent 40%, rgba(14,33,72,.7), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: borderSweep 7s linear infinite;
  pointer-events: none;
}
@keyframes borderSweep { to { filter: hue-rotate(360deg); } }

/* Watermark: engineering photo bem suave dentro do card */
.card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 24px;
  background: url("assets/engineering-bg.jpg") left center/cover no-repeat;
  opacity: 0.13;
  filter: grayscale(0.2) contrast(1.05);
  -webkit-mask-image: radial-gradient(140% 130% at 30% 50%, #000 55%, transparent 95%);
  mask-image: radial-gradient(140% 130% at 30% 50%, #000 55%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}
/* Conteúdo acima da watermark */
.card > * { position: relative; z-index: 1; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Logo */
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
  animation: logoFloat 5s ease-in-out infinite;
}
.logo {
  display: block;
  width: 380px; max-width: 82%;
  height: auto;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red);
  background: rgba(216, 30, 44, 0.10);
  border: 1px solid rgba(216, 30, 44, 0.30);
  padding: 7px 16px; border-radius: 999px;
  margin-bottom: 14px;
}
.badge-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red-soft);
  box-shadow: 0 0 0 0 rgba(255, 61, 77, .7);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 61, 77, .65); }
  70%  { box-shadow: 0 0 0 12px rgba(255, 61, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 77, 0); }
}

/* Title */
.title {
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 800; line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 12px;
}
.title .hl {
  color: var(--red);
  position: relative;
}
.title .hl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 8px;
  background: rgba(216, 30, 44, .22);
  transform: scaleX(0); transform-origin: left;
  animation: underline 1s ease 1s forwards;
  z-index: -1; border-radius: 4px;
}
@keyframes underline { to { transform: scaleX(1); } }

.subtitle {
  font-size: clamp(14px, 2.3vw, 16.5px);
  font-weight: 400; line-height: 1.6;
  color: rgba(14, 33, 72, 0.66);
  max-width: 460px; margin: 0 auto 24px;
}

/* Progress */
.progress-block { text-align: left; margin-bottom: 18px; }
.progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.progress-label {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(14, 33, 72, 0.55); font-weight: 700;
}
.progress-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px; font-weight: 500; color: var(--navy);
}
.progress-bar {
  height: 12px; border-radius: 999px;
  background: rgba(14, 33, 72, 0.08);
  border: 1px solid rgba(14, 33, 72, 0.10);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--red-soft));
  position: relative; overflow: hidden;
  transition: width 2.2s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 16px rgba(216, 30, 44, .5);
}
.progress-stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,.22) 0, rgba(255,255,255,.22) 10px,
    transparent 10px, transparent 20px);
  animation: stripeMove 1s linear infinite;
}
@keyframes stripeMove { to { background-position: 28px 0; } }

/* Phases */
.phases {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 20px;
}
.phase {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  color: rgba(14, 33, 72, 0.45);
  background: rgba(14, 33, 72, 0.04);
  border: 1px solid rgba(14, 33, 72, 0.10);
  padding: 7px 14px; border-radius: 999px;
}
.phase .ico { font-size: 13px; }
.phase.done { color: #1d8a47; border-color: rgba(34, 160, 80, .35); background: rgba(34, 160, 80, .07); }
.phase.done .ico { color: #22a050; }
.phase.active {
  color: var(--red);
  border-color: rgba(216, 30, 44, .45);
  background: rgba(216, 30, 44, .08);
}
.phase.active .ico { color: var(--red); }
.spin { display: inline-block; animation: spin 2.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Contact + footer */
.contact {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 14px; color: rgba(14, 33, 72, 0.62);
  padding-top: 18px; border-top: 1px solid rgba(14, 33, 72, 0.10);
}
.contact-link {
  color: var(--navy); font-weight: 700; text-decoration: none;
  position: relative; display: inline-block; width: fit-content; margin: 0 auto;
}
.contact-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--red); transition: width .3s ease;
}
.contact-link:hover::after { width: 100%; }

.foot {
  margin-top: 16px;
  font-size: 11.5px; letter-spacing: .06em;
  color: rgba(14, 33, 72, 0.40);
}

/* Responsive */
@media (max-width: 520px) {
  .card {
    max-height: calc(100vh - 20px);
    padding: 28px 18px 20px;
    border-radius: 20px;
  }
  .logo-wrap { padding: 14px 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .progress-fill { width: 68% !important; }
  .blueprint-draw .ln { stroke-dashoffset: 0; }
}
