/* Motion layer and square-edge finish. Loaded last; every rule that hides or moves
   content is scoped to html.motion-ready, which js/motion.js only sets when the
   visitor has not asked for reduced motion. */

/* Square edges ---------------------------------------------------------------- */
.btn,
.btn-primary {
  position: relative;
  letter-spacing: 0.01em;
}

/* Metallic gold: the light band of the gradient glides slowly back and forth, like
   light moving over brushed metal. The button itself stays put. */
.btn-primary {
  background: var(--metal-gold);
  background-size: 260% 100%;
  background-position: 0% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 214, 0.55),
    inset 0 -1px 0 rgba(110, 78, 20, 0.45),
    0 10px 28px rgba(217, 170, 72, 0.18);
  animation: gold-sheen 5.5s ease-in-out infinite alternate;
  transition: box-shadow var(--duration-base) var(--ease-standard);
}

.btn-primary:hover {
  background: var(--metal-gold);
  background-size: 260% 100%;
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 214, 0.7),
    inset 0 -1px 0 rgba(110, 78, 20, 0.45),
    0 14px 34px rgba(217, 170, 72, 0.32);
}

@keyframes gold-sheen {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary { animation: none; }
}

.btn-secondary {
  box-shadow: inset 0 0 0 0 var(--accent-primary);
  transition:
    color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-standard);
}

.btn-secondary:hover {
  box-shadow: inset 0 -2px 0 0 var(--accent-primary);
}

/* Cards read as cut sheets: hairline frame, gold rule on hover, corner tick. */
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-standard);
}

.service-card:hover::before,
.service-card:focus-within::before {
  transform: scaleX(1);
}

.character-project-cta {
  font-weight: 750;
}

.process-tab.is-active {
  box-shadow: inset 0 -2px 0 rgba(11, 28, 58, 0.35);
}

/* The decorative orbit becomes a framing square, in line with the rest. */
.character-mid-stage::before,
.character-orbit {
  border-style: solid;
}

.character-orbit {
  width: 70%;
}

/* Film grain on the dark stages: a fixed texture, no animation cost. */
.hero::before,
.final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.final-cta > .container {
  position: relative;
  z-index: 3;
}

/* Hero blueprint ---------------------------------------------------------------- */
.hero-guides {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-guides-cols {
  position: absolute;
  inset: 0 auto 0 50%;
  width: var(--container);
  transform: translateX(-50%);
  border-inline: 1px solid rgba(246, 214, 136, 0.08);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(100% / 12 - 1px),
    rgba(243, 246, 251, 0.035) calc(100% / 12 - 1px) calc(100% / 12)
  );
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 70%, transparent);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--space-6);
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 2.6rem;
  overflow: hidden;
  background: rgba(243, 246, 251, 0.14);
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-primary);
  transform: translateY(-100%);
  animation: cue-drop 2.2s var(--ease-standard) infinite;
}

.scroll-cue:hover {
  color: var(--text-primary);
}

@keyframes cue-drop {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Hero intro ---------------------------------------------------------------------- */
html.motion-ready .hero h1 .word {
  display: inline-block;
  overflow: clip;
  overflow-clip-margin: 0.12em;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
  vertical-align: top;
}

html.motion-ready .hero h1 .word-in {
  display: inline-block;
  transform: translate3d(0, 108%, 0) rotate(4deg);
  transform-origin: left bottom;
}

html.motion-ready .hero.is-intro h1 .word-in {
  transform: none;
  transition: transform 1s var(--ease-standard);
  transition-delay: calc(120ms + var(--i) * 55ms);
}

/* The gold bar under the headline draws after the last word lands. */
html.motion-ready .hero-copy h1 .headline-accent::after {
  transform: scaleX(0);
  transform-origin: left;
}

html.motion-ready .hero.is-intro .hero-copy h1 .headline-accent::after {
  transform: scaleX(1);
  transition: transform 0.9s var(--ease-standard) calc(420ms + var(--words, 10) * 55ms);
}
html.motion-ready .hero .hero-actions,
html.motion-ready .scroll-cue {
  opacity: 0;
  translate: 0 14px;
}
html.motion-ready .hero.is-intro .hero-actions,
html.motion-ready .hero.is-intro .scroll-cue {
  opacity: 1;
  translate: none;
  transition:
    opacity 0.8s var(--ease-standard),
    translate 0.8s var(--ease-standard);
}

html.motion-ready .hero.is-intro .hero-actions { transition-delay: 820ms; }
html.motion-ready .hero.is-intro .scroll-cue { transition-delay: 1.2s; }

/* Column guides grow down the page like a drawing being set up. */
html.motion-ready .hero-guides-cols {
  clip-path: inset(0 0 100% 0);
}

html.motion-ready .hero.is-intro .hero-guides-cols {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.8s var(--ease-standard) 0.1s;
}

html.motion-ready .hero-copy,
html.motion-ready .hero-visual {
  will-change: transform;
}

/* Section seams ----------------------------------------------------------------- */
html.motion-ready main > section[id] {
  z-index: var(--layer, 1);
}

.seam,
.scene-shade {
  display: none;
}

html.motion-ready .seam {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: block;
  pointer-events: none;
}

.seam-rule {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-primary), rgba(246, 214, 136, 0.2));
  transform: scaleX(0);
  transform-origin: left;
}

.seam-shutter {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(1.5rem, 9vw, 9rem);
  background: var(--shutter, var(--bg-primary));
  transform-origin: left;
  will-change: transform;
}

.seam-shutter-l {
  left: 0;
  border-right: 1px solid rgba(246, 214, 136, 0.18);
}

.seam-shutter-r {
  right: 0;
  transform-origin: right;
  border-left: 1px solid rgba(246, 214, 136, 0.18);
}

.seam-label {
  position: absolute;
  right: max(var(--space-6), calc((100vw - var(--container)) / 2));
  top: var(--space-6);
  display: inline-flex;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.seam-label b {
  color: var(--accent-primary);
  font-weight: 800;
}

.theme-light .seam-label,
.theme-light-soft .seam-label,
.quality-section .seam-label {
  color: var(--text-dark-secondary);
}

html.motion-ready .scene-shade {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: block;
  pointer-events: none;
  opacity: 0;
  background: #02060d;
}

html.motion-ready main > section[id] > .container {
  will-change: transform;
}

/* Each shutter takes the colour of the section that is being left behind. */
#projetos { --shutter: var(--bg-secondary); }
#solucoes { --shutter: var(--bg-light); }
#processo { --shutter: var(--bg-light-soft); }
#diferenciais { --shutter: var(--bg-secondary); }
#duvidas { --shutter: var(--bg-light); }
#contato { --shutter: var(--bg-light-soft); }

/* Progress rail ----------------------------------------------------------------- */
.scroll-rail {
  position: fixed;
  right: clamp(0.75rem, 1.6vw, 1.75rem);
  top: 50%;
  z-index: 40;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.14em;
  pointer-events: none;
  opacity: 0;
  transform: translate(0.75rem, -50%);
  transition:
    opacity var(--duration-slow) var(--ease-standard),
    transform var(--duration-slow) var(--ease-standard),
    color var(--duration-base) ease;
}

.scroll-rail.is-visible {
  opacity: 1;
  transform: translate(0, -50%);
}

.scroll-rail.is-light {
  color: var(--text-dark-secondary);
}

.scroll-rail-index {
  color: var(--accent-primary);
}

.scroll-rail-track {
  position: relative;
  width: 1px;
  height: 7.5rem;
  background: currentColor;
  opacity: 0.35;
}

.scroll-rail-track i {
  position: absolute;
  inset: 0;
  background: var(--accent-primary);
  transform: scaleY(0);
  transform-origin: top;
}

.scroll-rail-label {
  writing-mode: vertical-rl;
  margin-top: var(--space-2);
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .scroll-rail {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero-guides,
  .scroll-cue {
    display: none;
  }

  .seam-label {
    top: var(--space-4);
    right: var(--space-4);
  }

  .seam-shutter {
    width: 1.25rem;
  }
}

@media (min-width: 861px) and (max-height: 820px) {
  .scroll-cue {
    display: none;
  }
}
