/* ============================================================================
   CENTRALIZED DESIGN & BRANDING CUSTOMIZATION VARIABLES
   Adjust these tokens to adapt colours, typography, and corner geometry.
   ============================================================================ */
:root {
  /* Core Brand Palette */
  --color-primary: #0f1b2e;
  --color-secondary: #94a3b8;
  --color-accent: #f59e0b;
  --color-bg: #08101e;
  --color-text: #f8fafc;

  /* Typography */
  --font-heading: 'Space Grotesk', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Corner Geometry */
  --border-radius: 4px;
  --border-radius-lg: 8px;

  /* Derived Architectural Surfaces & Blueprint Tokens */
  --color-bg-elevated: #0c1729;
  --color-bg-panel: rgba(15, 27, 46, 0.72);
  --color-text-muted: #cbd5e1;
  --color-text-dim: #64748b;
  --color-accent-bright: #fbbf24;
  --color-accent-deep: #d97706;
  --color-accent-soft: rgba(245, 158, 11, 0.14);
  --color-accent-border: rgba(245, 158, 11, 0.42);
  --color-border: rgba(148, 163, 184, 0.16);
  --color-border-strong: rgba(148, 163, 184, 0.32);
  --color-grid-minor: rgba(148, 163, 184, 0.045);
  --color-grid-major: rgba(148, 163, 184, 0.095);

  /* Layout & Motion */
  --container-max: 1320px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ease-architectural: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================================
   BASE RESET & ACCESSIBILITY
   ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* ============================================================================
   ANIMATED ARCHITECTURAL BLUEPRINT BACKDROP
   ============================================================================ */
.blueprint-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blueprint-grid {
  position: absolute;
  inset: -96px;
  background-image:
    linear-gradient(to right, var(--color-grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-grid-major) 1px, transparent 1px),
    linear-gradient(to right, var(--color-grid-minor) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-grid-minor) 1px, transparent 1px),
    url("../assets/images/blueprint-tile.svg");
  background-size:
    96px 96px,
    96px 96px,
    24px 24px,
    24px 24px,
    96px 96px;
  animation: blueprintGridDrift 48s linear infinite;
  will-change: transform;
}

.blueprint-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(148, 163, 184, 0.16) 20%,
    rgba(245, 158, 11, 0.28) 50%,
    rgba(148, 163, 184, 0.16) 80%,
    transparent 100%
  );
  opacity: 0;
  animation: blueprintScanSweep 18s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.blueprint-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 36%, rgba(15, 27, 46, 0.55) 0%, transparent 52%),
    radial-gradient(circle at 14% 78%, rgba(245, 158, 11, 0.045) 0%, transparent 45%),
    linear-gradient(180deg, rgba(8, 16, 30, 0.25) 0%, rgba(8, 16, 30, 0.72) 100%);
}

/* ============================================================================
   PAGE SHELL & CONTAINER
   ============================================================================ */
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
}

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

/* ============================================================================
   MAIN HERO ASYMMETRICAL LAYOUT
   ============================================================================ */
.site-main {
  display: flex;
  align-items: center;
  padding-block: clamp(2.5rem, 5.5vh, 4.75rem);
}

.hero {
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 5.25rem);
}

/* Left Hero Content */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

/* Animated Status Indicator */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.48rem 0.95rem 0.48rem 0.78rem;
  margin-bottom: clamp(1.35rem, 2.6vw, 2rem);
  background-color: var(--color-bg-panel);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--border-radius);
  box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.04);
}

.status-beacon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.beacon-core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.75);
}

.beacon-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent);
  animation: statusBeaconPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.status-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--color-accent-bright);
  text-transform: uppercase;
  line-height: 1;
}

/* Main Heading & Masked Text Reveal */
.hero-title {
  margin: 0 0 clamp(1.25rem, 2.4vw, 1.85rem);
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 4.35vw, 4.2rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.03em;
  color: var(--color-text);
  max-width: 15ch;
}

.title-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.title-line-inner {
  display: block;
  animation: textRevealUp 0.9s var(--ease-architectural) var(--line-delay, 0.12s) both;
}

.title-accent {
  position: relative;
  display: inline-block;
  color: var(--color-text);
}

.title-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 3px;
  background-color: var(--color-accent);
  transform-origin: left center;
  animation: accentRuleExpand 0.8s var(--ease-architectural) 0.55s both;
}

/* Supporting & Secondary Paragraphs */
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lead-text {
  margin: 0;
  font-size: clamp(1.03rem, 1.32vw, 1.2rem);
  font-weight: 500;
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 50ch;
}

.secondary-text {
  margin: 0;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-secondary);
  max-width: 48ch;
}

/* ============================================================================
   OPTIONAL CONSTRUCTION PROGRESS TRACKER (Hidden unless configured in JS)
   ============================================================================ */
.progress-tracker {
  width: 100%;
  max-width: 26rem;
  margin-top: clamp(1.65rem, 2.8vw, 2.25rem);
  padding: 0.95rem 1.1rem;
  background-color: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.progress-label {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.progress-value {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent-bright);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  background-color: rgba(148, 163, 184, 0.14);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background-color: var(--color-accent);
  transform-origin: left center;
  transform: scaleX(var(--progress-scale, 0));
  transition: transform 1.1s var(--ease-architectural);
}

/* ============================================================================
   RIGHT COLUMN: ARCHITECTURAL BLUEPRINT STAGE & SVG ILLUSTRATION
   ============================================================================ */
.hero-visual {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.blueprint-stage {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 580px;
  padding: clamp(0.85rem, 1.8vw, 1.25rem);
  background-color: rgba(11, 21, 38, 0.68);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow:
    0 24px 54px -26px rgba(2, 6, 23, 0.85),
    inset 0 1px 0 rgba(248, 250, 252, 0.05);
}

/* Subtle Architectural Corner Registration Brackets on Stage */
.blueprint-stage::before,
.blueprint-stage::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--color-accent);
  border-style: solid;
  pointer-events: none;
  opacity: 0.65;
}

.blueprint-stage::before {
  top: -1px;
  left: -1px;
  border-width: 1.5px 0 0 1.5px;
  border-top-left-radius: var(--border-radius-lg);
}

.blueprint-stage::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1.5px 1.5px 0;
  border-bottom-right-radius: var(--border-radius-lg);
}

.stage-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  padding-inline: 0.25rem;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--color-text-dim);
  text-transform: uppercase;
}

.stage-coords {
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
}

.construction-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Mouse Parallax Layers (rAF damped in js/script.js) */
[data-parallax-layer] {
  transform: translate3d(
    calc(var(--parallax-x, 0) * var(--depth, 8px)),
    calc(var(--parallax-y, 0) * var(--depth, 8px)),
    0
  );
  will-change: transform;
}

/* SVG Stroke Drawing Animation */
.svg-draw {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: svgStrokeDraw 1.35s var(--ease-architectural) 0.3s forwards;
}

.svg-delay-1 {
  animation-delay: 0.42s;
}

.svg-delay-2 {
  animation-delay: 0.65s;
}

.svg-delay-3 {
  animation-delay: 0.88s;
}

/* Sequential Building Block Assembly */
.build-block {
  opacity: 0;
  animation: blockAssemble 0.85s var(--ease-architectural) forwards;
}

.build-block-1 {
  animation-delay: 0.95s;
}

.build-block-2 {
  animation-delay: 1.18s;
}

.build-block-3 {
  animation-delay: 1.42s;
}

.build-block-4 {
  animation-delay: 1.66s;
}

/* Continuous Precision Crane & Keystone Calibration Sequence */
.crane-trolley-assembly {
  animation: craneTrolleyGlide 10s cubic-bezier(0.45, 0, 0.55, 1) 1.6s infinite;
}

.crane-cables {
  transform-box: view-box;
  transform-origin: 331px 86px;
  animation: craneCableExtend 10s cubic-bezier(0.45, 0, 0.55, 1) 1.6s infinite;
}

.crane-hoist-payload {
  animation: cranePayloadLower 10s cubic-bezier(0.45, 0, 0.55, 1) 1.6s infinite;
}

.keystone-target {
  animation: targetSlotPulse 10s ease-in-out 1.6s infinite;
}

/* Aviation Warning Beacon Pulse */
.crane-beacon-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: apexBeaconPulse 2.6s ease-in-out infinite;
}

/* Slow Floating Architectural Annotations */
.float-slow-a {
  animation: floatSlow 6.8s ease-in-out infinite;
}

.float-slow-b {
  animation: floatSlow 8.2s ease-in-out 1.4s infinite reverse;
}

/* Staggered Entrance Reveals (Works even with JS disabled) */
.reveal-stagger {
  animation: staggerFadeUp 0.8s var(--ease-architectural) calc(0.08s + var(--stagger, 0) * 0.1s) both;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  background-color: rgba(8, 16, 30, 0.65);
  animation: footerFadeIn 0.8s var(--ease-architectural) 0.55s both;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 4.5rem;
  padding-block: 1rem;
}

.footer-copyright {
  margin: 0;
  font-size: 0.84rem;
  color: var(--color-text-dim);
}

.footer-tagline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.tagline-dot {
  width: 5px;
  height: 5px;
  background-color: var(--color-accent);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ============================================================================
   KEYFRAME CHOREOGRAPHY
   ============================================================================ */
@keyframes blueprintGridDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(96px, 96px, 0);
  }
}

@keyframes blueprintScanSweep {
  0% {
    transform: translateY(-10vh);
    opacity: 0;
  }
  12% {
    opacity: 0.75;
  }
  88% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(105vh);
    opacity: 0;
  }
}

@keyframes footerFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes staggerFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes textRevealUp {
  from {
    opacity: 0;
    transform: translate3d(0, 108%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes accentRuleExpand {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes statusBeaconPulse {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.15);
    opacity: 0;
  }
  100% {
    transform: scale(2.15);
    opacity: 0;
  }
}

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

@keyframes blockAssemble {
  0% {
    opacity: 0;
    transform: translate3d(0, -16px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes craneTrolleyGlide {
  0%, 100% {
    transform: translate3d(-16px, 0, 0);
  }
  22%, 74% {
    transform: translate3d(0, 0, 0);
  }
  88% {
    transform: translate3d(-16px, 0, 0);
  }
}

@keyframes craneCableExtend {
  0%, 24% {
    transform: scaleY(1);
  }
  44%, 68% {
    transform: scaleY(1.37);
  }
  86%, 100% {
    transform: scaleY(1);
  }
}

@keyframes cranePayloadLower {
  0%, 24% {
    transform: translate3d(0, 0, 0);
  }
  44%, 68% {
    transform: translate3d(0, 34px, 0);
  }
  86%, 100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes targetSlotPulse {
  0%, 38%, 74%, 100% {
    opacity: 0.72;
  }
  48%, 64% {
    opacity: 1;
  }
}

@keyframes apexBeaconPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.65);
    opacity: 0.55;
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -6px, 0);
  }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1180px) {
  .hero-grid {
    gap: clamp(2rem, 4vw, 3.5rem);
  }

  .blueprint-stage {
    max-width: 520px;
  }
}

@media (max-width: 960px) {
  .site-main {
    align-items: flex-start;
    padding-block: clamp(2.25rem, 6vw, 3.5rem);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .hero-content {
    max-width: 38rem;
  }

  .hero-visual {
    justify-content: center;
  }

  .blueprint-stage {
    max-width: 560px;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    padding-block: 1.35rem;
  }
}

@media (max-width: 640px) {
  .hero-title {
    max-width: none;
  }

  .blueprint-stage {
    padding: 0.75rem;
  }

  .stage-meta-top {
    font-size: 0.62rem;
  }
}

/* ============================================================================
   PREFERS-REDUCED-MOTION SUPPORT
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  .blueprint-grid,
  .blueprint-scanline,
  .beacon-ring,
  .crane-beacon-halo,
  .float-slow-a,
  .float-slow-b {
    animation: none !important;
  }

  .blueprint-scanline {
    display: none;
  }

  .reveal-stagger,
  .title-line-inner,
  .build-block {
    opacity: 1 !important;
    transform: none !important;
  }

  .title-accent::after {
    transform: scaleX(1) !important;
  }

  .svg-draw {
    stroke-dashoffset: 0 !important;
  }

  /* Leave crane & keystone neatly seated in target alignment */
  .crane-trolley-assembly {
    transform: translate3d(0, 0, 0) !important;
  }

  .crane-cables {
    transform: scaleY(1.37) !important;
  }

  .crane-hoist-payload {
    transform: translate3d(0, 34px, 0) !important;
  }

  [data-parallax-layer] {
    transform: none !important;
  }
}
