/* ==========================================================
   NIVORA EXTRAS — Monochrome Price Intelligence & Motion
   Refitted with Nivora / fsociety clean aesthetics
   Monochrome charts • High-contrast telemetry • Precision dials
========================================================== */

/* Hero technical dial motif (monochrome) */
.hero > * {
  position: relative;
  z-index: 1;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -2%;
  top: 50%;
  width: min(42vw, 540px);
  aspect-ratio: 1;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cg stroke='%23000000' stroke-opacity='.12' stroke-linecap='round'%3E%3Cline x1='250.0' y1='10.0' x2='250.0' y2='34.0' stroke-width='2.6'/%3E%3Cline x1='275.1' y1='11.3' x2='273.8' y2='23.2' stroke-width='1.5'/%3E%3Cline x1='299.9' y1='15.2' x2='297.4' y2='27.0' stroke-width='1.5'/%3E%3Cline x1='324.2' y1='21.7' x2='320.5' y2='33.2' stroke-width='1.5'/%3E%3Cline x1='347.6' y1='30.7' x2='342.7' y2='41.7' stroke-width='1.5'/%3E%3Cline x1='370.0' y1='42.2' x2='358.0' y2='62.9' stroke-width='2.6'/%3E%3Cline x1='391.1' y1='55.8' x2='384.0' y2='65.5' stroke-width='1.5'/%3E%3Cline x1='410.6' y1='71.6' x2='402.6' y2='80.6' stroke-width='1.5'/%3E%3Cline x1='428.4' y1='89.4' x2='419.4' y2='97.4' stroke-width='1.5'/%3E%3Cline x1='444.2' y1='108.9' x2='434.5' y2='116.0' stroke-width='1.5'/%3E%3Cline x1='457.8' y1='130.0' x2='437.1' y2='142.0' stroke-width='2.6'/%3E%3Cline x1='469.3' y1='152.4' x2='458.3' y2='157.3' stroke-width='1.5'/%3E%3Cline x1='478.3' y1='175.8' x2='466.8' y2='179.5' stroke-width='1.5'/%3E%3Cline x1='484.8' y1='200.1' x2='473.0' y2='202.6' stroke-width='1.5'/%3E%3Cline x1='488.7' y1='224.9' x2='476.8' y2='226.2' stroke-width='1.5'/%3E%3Cline x1='490.0' y1='250.0' x2='466.0' y2='250.0' stroke-width='2.6'/%3E%3Cline x1='488.7' y1='275.1' x2='476.8' y2='273.8' stroke-width='1.5'/%3E%3Cline x1='484.8' y1='299.9' x2='473.0' y2='297.4' stroke-width='1.5'/%3E%3Cline x1='478.3' y1='324.2' x2='466.8' y2='320.5' stroke-width='1.5'/%3E%3Cline x1='469.3' y1='347.6' x2='458.3' y2='342.7' stroke-width='1.5'/%3E%3Cline x1='457.8' y1='370.0' x2='437.1' y2='358.0' stroke-width='2.6'/%3E%3Cline x1='444.2' y1='391.1' x2='434.5' y2='384.0' stroke-width='1.5'/%3E%3Cline x1='428.4' y1='410.6' x2='419.4' y2='402.6' stroke-width='1.5'/%3E%3Cline x1='410.6' y1='428.4' x2='402.6' y2='419.4' stroke-width='1.5'/%3E%3Cline x1='391.1' y1='444.2' x2='384.0' y2='434.5' stroke-width='1.5'/%3E%3Cline x1='370.0' y1='457.8' x2='358.0' y2='437.1' stroke-width='2.6'/%3E%3Cline x1='347.6' y1='469.3' x2='342.7' y2='458.3' stroke-width='1.5'/%3E%3Cline x1='324.2' y1='478.3' x2='320.5' y2='466.8' stroke-width='1.5'/%3E%3Cline x1='299.9' y1='484.8' x2='297.4' y2='473.0' stroke-width='1.5'/%3E%3Cline x1='275.1' y1='488.7' x2='273.8' y2='476.8' stroke-width='1.5'/%3E%3Cline x1='250.0' y1='490.0' x2='250.0' y2='466.0' stroke-width='2.6'/%3E%3Cline x1='224.9' y1='488.7' x2='226.2' y2='476.8' stroke-width='1.5'/%3E%3Cline x1='200.1' y1='484.8' x2='202.6' y2='473.0' stroke-width='1.5'/%3E%3Cline x1='175.8' y1='478.3' x2='179.5' y2='466.8' stroke-width='1.5'/%3E%3Cline x1='152.4' y1='469.3' x2='157.3' y2='458.3' stroke-width='1.5'/%3E%3Cline x1='130.0' y1='457.8' x2='142.0' y2='437.1' stroke-width='2.6'/%3E%3Cline x1='108.9' y1='444.2' x2='116.0' y2='434.5' stroke-width='1.5'/%3E%3Cline x1='89.4' y1='428.4' x2='97.4' y2='419.4' stroke-width='1.5'/%3E%3Cline x1='71.6' y1='410.6' x2='80.6' y2='402.6' stroke-width='1.5'/%3E%3Cline x1='55.8' y1='391.1' x2='65.5' y2='384.0' stroke-width='1.5'/%3E%3Cline x1='42.2' y1='370.0' x2='62.9' y2='358.0' stroke-width='2.6'/%3E%3Cline x1='30.7' y1='347.6' x2='41.7' y2='342.7' stroke-width='1.5'/%3E%3Cline x1='21.7' y1='324.2' x2='33.2' y2='320.5' stroke-width='1.5'/%3E%3Cline x1='15.2' y1='299.9' x2='27.0' y2='297.4' stroke-width='1.5'/%3E%3Cline x1='11.3' y1='275.1' x2='23.2' y2='273.8' stroke-width='1.5'/%3E%3Cline x1='10.0' y1='250.0' x2='34.0' y2='250.0' stroke-width='2.6'/%3E%3Cline x1='11.3' y1='224.9' x2='23.2' y2='226.2' stroke-width='1.5'/%3E%3Cline x1='15.2' y1='200.1' x2='27.0' y2='202.6' stroke-width='1.5'/%3E%3Cline x1='21.7' y1='175.8' x2='33.2' y2='179.5' stroke-width='1.5'/%3E%3Cline x1='30.7' y1='152.4' x2='41.7' y2='157.3' stroke-width='1.5'/%3E%3Cline x1='42.2' y1='130.0' x2='62.9' y2='142.0' stroke-width='2.6'/%3E%3Cline x1='55.8' y1='108.9' x2='65.5' y2='116.0' stroke-width='1.5'/%3E%3Cline x1='71.6' y1='89.4' x2='80.6' y2='97.4' stroke-width='1.5'/%3E%3Cline x1='89.4' y1='71.6' x2='97.4' y2='80.6' stroke-width='1.5'/%3E%3Cline x1='108.9' y1='55.8' x2='116.0' y2='65.5' stroke-width='1.5'/%3E%3Cline x1='130.0' y1='42.2' x2='142.0' y2='62.9' stroke-width='2.6'/%3E%3Cline x1='152.4' y1='30.7' x2='157.3' y2='41.7' stroke-width='1.5'/%3E%3Cline x1='175.8' y1='21.7' x2='179.5' y2='33.2' stroke-width='1.5'/%3E%3Cline x1='200.1' y1='15.2' x2='202.6' y2='27.0' stroke-width='1.5'/%3E%3Cline x1='224.9' y1='11.3' x2='226.2' y2='23.2' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E") center/100% 100% no-repeat;
  transform: translateY(-50%) rotate(0);
  animation: nx-dial 120s linear infinite;
}
@keyframes nx-dial {
  to { transform: translateY(-50%) rotate(360deg); }
}
@media (max-width: 900px) {
  .hero::after { display: none; }
}

/* Scroll progress */
.nx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10002;
  height: 2px;
  background: #000000;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Reveal motion */
.nx-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--nx-d, 0s);
}
.nx-reveal.nx-in {
  opacity: 1;
  transform: none;
}

/* Grid & Cards */
.nx-intel {
  padding-top: clamp(40px, 6vw, 70px);
}
.nx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.nx-card {
  min-width: 0;
  padding: clamp(24px, 3.2vw, 36px);
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
}
.nx-chart-card {
  grid-column: span 8;
}
.nx-ring-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.nx-bars-card {
  grid-column: span 12;
}

.nx-label {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.nx-big {
  margin: 0;
  color: var(--text);
  font: 900 clamp(42px, 5.5vw, 64px)/1 var(--display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.nx-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.nx-ranges {
  display: flex;
  gap: 6px;
}
.nx-range {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition: all 0.25s var(--ease);
}
.nx-range:hover {
  border-color: #000000;
  background: #FAFAFA;
}
.nx-range[aria-pressed=true] {
  background: #000000;
  border-color: #000000;
  color: #FFFFFF;
}

/* Line chart */
.nx-chart-wrap {
  position: relative;
}
#nx-chart {
  display: block;
  width: 100%;
  height: clamp(180px, 26vw, 260px);
  overflow: visible;
}
.nx-grid-line {
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 1;
}
#nx-area {
  fill: url(#nx-fill);
}
#nx-line {
  fill: none;
  stroke: #000000;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#nx-line.nx-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: nx-line 1.6s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}
#nx-area.nx-draw {
  animation: nx-fade 1.4s ease 0.5s both;
}
#nx-dot {
  fill: #FFFFFF;
  stroke: #000000;
  stroke-width: 2.5;
}
#nx-dot.nx-draw {
  transform-box: fill-box;
  transform-origin: center;
  animation: nx-pop 0.7s cubic-bezier(0.34, 1.7, 0.5, 1) 1.3s both;
}
#nx-hover {
  stroke: #000000;
  stroke-opacity: 0.4;
  stroke-dasharray: 3 4;
}
@keyframes nx-line {
  to { stroke-dashoffset: 0; }
}
@keyframes nx-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes nx-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.nx-tip {
  position: absolute;
  top: 0;
  left: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -130%);
}
.nx-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Score ring */
.nx-ring {
  position: relative;
  width: min(180px, 60%);
  aspect-ratio: 1;
  margin: 10px 0 20px;
}
.nx-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.nx-ring-track {
  fill: none;
  stroke: var(--bg-soft);
  stroke-width: 9;
}
.nx-ring-val {
  fill: none;
  stroke: var(--success);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;
}
.nx-in .nx-ring-val {
  stroke-dashoffset: calc(326.7 * (1 - var(--p, 0.86)));
}
.nx-ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 50px var(--display);
  letter-spacing: -0.04em;
  color: var(--text);
}
.nx-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--success);
  border-radius: var(--radius-pill);
  color: var(--success);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nx-ring-card p:last-child {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* Bars card */
.nx-bar {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
}
.nx-bar-name {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nx-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #000000;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nx-track {
  height: 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.nx-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #000000;
  border-radius: var(--radius-pill);
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i, 0) * 0.15s);
}
.nx-in .nx-bar .nx-fill {
  width: var(--w, 100%);
}
.nx-bar-val {
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .nx-chart-card { grid-column: span 12; }
  .nx-ring-card { grid-column: span 12; }
}
@media (max-width: 600px) {
  .nx-bar {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 18px 0;
  }
  .nx-bar-val { text-align: left; }
}
