/* ==========================================================================
   Homepage 3D animated banner (index.html only)
   ========================================================================== */
.rd-hero {
  --hero-bg: #f4f2ec;
  --hero-ink: #182540;
  --hero-accent: #3f5aa8;
  --hero-muted: #5a6275;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  position: relative;
  overflow: hidden;
  min-height: clamp(620px, calc(100vh - 140px), 860px);
  background:
    radial-gradient(ellipse 55% 60% at 68% 52%, rgba(63, 90, 168, .10), transparent 70%),
    radial-gradient(ellipse 40% 50% at 10% 100%, rgba(24, 37, 64, .06), transparent 70%),
    linear-gradient(180deg, #f7f5f0 0%, var(--hero-bg) 100%);
  color: var(--hero-ink);
  isolation: isolate;
}
.rd-hero::before { /* fine grid, very subtle */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(24,37,64,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,37,64,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 60% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 60% 50%, #000 30%, transparent 80%);
}
.rd-hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0;
  opacity: 0; transition: opacity .8s ease;
}
.rd-hero.is-ready .rd-hero-canvas { opacity: 1; }
.rd-hero-inner {
  position: relative; z-index: 2; pointer-events: none;
  min-height: inherit; display: grid; align-content: space-between;
  grid-template-columns: minmax(0, 1fr); gap: 36px;
  padding-block: 80px 56px;
}
.rd-hero-copy { max-width: 540px; pointer-events: auto; align-self: center; }
.rd-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--hero-muted); margin-bottom: 22px;
}
.rd-hero-eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.rd-hero h1 {
  font-family: var(--serif); font-weight: 400; color: var(--hero-ink);
  font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -.01em; margin: 0 0 .35em;
}
.rd-hero h1 em { font-style: italic; color: var(--hero-accent); }
.rd-hero-copy p { color: var(--hero-muted); font-size: 1.05rem; line-height: 1.6; max-width: 430px; margin: 0 0 1.8em; }
.rd-hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.rd-hero-cta {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px;
  background: var(--hero-ink); color: #fff; font-weight: 600; text-decoration: none;
  box-shadow: 0 12px 28px -12px rgba(24,37,64,.6); transition: transform .2s ease, background .2s ease;
}
.rd-hero-cta:hover { background: var(--hero-accent); transform: translateY(-2px); }
.rd-hero-link { color: var(--hero-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.rd-hero-link:hover { color: var(--hero-accent); }

/* service list (right column) */
.rd-hero-side { display: flex; align-items: center; gap: 28px; }
.rd-hero-services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; pointer-events: auto; flex: 1; }
.rd-hero-services a {
  position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--hero-ink);
  background: rgba(255,255,255,.62); border: 1px solid rgba(24,37,64,.08);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .3s ease, box-shadow .3s ease, transform .3s ease; overflow: hidden;
}
.rd-hero-services .ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #eef1f9; color: var(--hero-accent); transition: background .3s ease, color .3s ease;
}
.rd-hero-services .ico svg { width: 20px; height: 20px; }
.rd-hero-services strong { display: block; font-family: var(--display); font-size: .86rem; line-height: 1.25; }
.rd-hero-services span.sub { display: block; font-size: .75rem; color: var(--hero-muted); }
.rd-hero-services .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--hero-accent); }
.rd-hero-services li.is-active a { background: #fff; box-shadow: 0 16px 30px -18px rgba(24,37,64,.45); transform: translateY(-4px); }
.rd-hero-services li.is-active .ico { background: var(--hero-accent); color: #fff; }
.rd-hero-services li.is-active .bar { animation: rdHeroBar var(--rd-cycle, 3.2s) linear forwards; }
@keyframes rdHeroBar { to { width: 100%; } }
.rd-hero-stat {
  display: flex; gap: 22px; font-size: .78rem; color: var(--hero-muted); flex: none;
}
.rd-hero-stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1; color: var(--hero-ink); }

.rd-hero-scroll {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; color: var(--hero-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-transform: uppercase;
}
.rd-hero-scroll::after { content: ""; width: 1px; height: 30px; background: linear-gradient(var(--hero-muted), transparent); animation: rdScroll 1.8s ease-in-out infinite; }
@keyframes rdScroll { 0%,100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* entrance */
.rd-hero [data-rise] { opacity: 0; transform: translateY(22px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.rd-hero.is-in [data-rise] { opacity: 1; transform: none; }

/* tablet */
@media (max-width: 1080px) {
  .rd-hero-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-hero-stat, .rd-hero-scroll { display: none; }
}
/* phone: text on top, 3D in the middle, services below */
@media (max-width: 680px) {
  .rd-hero { min-height: 0; }
  .rd-hero-inner { padding-block: 40px 28px; gap: 0; align-content: start; }
  .rd-hero-copy { text-align: left; }
  .rd-hero h1 { font-size: 2.7rem; }
  .rd-hero-copy p { font-size: .98rem; margin-bottom: 1.4em; }
  .rd-hero-stage { height: 360px; }  /* spacer that the canvas shows through */
  .rd-hero-services { grid-template-columns: 1fr 1fr; gap: 8px; }
  .rd-hero-services a { grid-template-columns: 30px 1fr; padding: 10px; gap: 8px; }
  .rd-hero-services .ico { width: 30px; height: 30px; }
  .rd-hero-services span.sub { display: none; }
  .rd-hero-scroll { display: none; }
}
@media (min-width: 681px) { .rd-hero-stage { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .rd-hero [data-rise] { transition: none; opacity: 1; transform: none; }
  .rd-hero-services li.is-active .bar { animation: none; width: 100%; }
  .rd-hero-scroll::after { animation: none; }
}
