/* ============================================================
   Home — "Five rules behind every number" (moved from About,
   Nov 17 2026). Navy ledger; each rule's orange line pulls tight
   like a mason's line, then its number is set on it. Start states
   only apply under main.js's .js-reveal (never set with reduced
   motion, and removed by its watchdog), so nothing can stay hidden.
   ============================================================ */

/* ---------- Rules: navy ledger ---------- */

.rl-section {
  position: relative;
  background:
    radial-gradient(ellipse 45% 50% at 0% 0%, rgba(254, 93, 1, 0.14), transparent 70%),
    radial-gradient(ellipse 45% 50% at 100% 100%, rgba(254, 93, 1, 0.07), transparent 70%),
    #0b1120;
}

.rl-section .eyebrow {
  border-color: rgba(254, 93, 1, 0.35);
  background-color: rgba(254, 93, 1, 0.08);
  color: #FE8A39;
}

.rl-ledger {
  display: grid;
  column-gap: 2.5rem;
  row-gap: 3rem;
}

@media (min-width: 768px) {
  .rl-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .rl-ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.rl-rule {
  position: relative;
  padding-top: 1.75rem;
}

/* top rule that draws across in orange on hover */
.rl-rule::before,
.rl-rule::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
}

.rl-rule::before {
  right: 0;
  background: rgba(148, 163, 184, 0.25);
}

.rl-rule::after {
  width: 100%;
  height: 2px;
  top: -0.5px;
  background: #FE5D01;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rl-rule-num {
  display: block;
  font-family: "Barlow Condensed", Inter, sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1.5px #FE8A39;
  transition: color 0.35s ease;
}

.rl-rule-title {
  margin-top: 1rem;
  font-family: "Barlow Condensed", Inter, sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.05;
  color: #ffffff;
}

.rl-rule-text {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #cbd5e1;
}

.rl-rule:hover::after { transform: scaleX(1); }
.rl-rule:hover .rl-rule-num { color: #FE5D01; }

/* ---------- Rules: line pulled tight, number set on it ---------- */

/* the line itself is orange, like a mason's nylon line */
.rl-rule::before { background: rgba(254, 138, 57, 0.5); }

.js-reveal .rl-rule::before {
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.js-reveal .rl-rule.is-visible::before {
  animation:
    rl-line-pull 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--rl-d, 0s) both,
    rl-line-twang 0.45s ease-out calc(var(--rl-d, 0s) + 0.7s);
}

@keyframes rl-line-pull {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* a pulled line shivers once when it goes tight */
@keyframes rl-line-twang {
  0% { translate: 0 0; }
  20% { translate: 0 2px; }
  45% { translate: 0 -1.25px; }
  70% { translate: 0 0.5px; }
  100% { translate: 0 0; }
}

.js-reveal .rl-rule .rl-rule-num {
  opacity: 0;
  translate: 0 -14px;
}

.js-reveal .rl-rule.is-visible .rl-rule-num {
  animation: rl-num-set 0.5s cubic-bezier(0.34, 1.45, 0.64, 1) calc(var(--rl-d, 0s) + 0.55s) both;
}

@keyframes rl-num-set {
  from { opacity: 0; translate: 0 -14px; }
  to { opacity: 1; translate: 0 0; }
}

.rl-ledger > .rl-rule:nth-child(2) { --rl-d: 0.08s; }
.rl-ledger > .rl-rule:nth-child(3) { --rl-d: 0.16s; }
.rl-ledger > .rl-rule:nth-child(4) { --rl-d: 0.24s; }
.rl-ledger > .rl-rule:nth-child(5) { --rl-d: 0.32s; }

/* the CTA below is navy too, so a thin line separates them */
.rl-section { border-bottom: 1px solid rgba(148, 163, 184, 0.14); }

@media (prefers-reduced-motion: reduce) {
  .rl-rule::after { transition: none; }
}
