/* Home page components: live registry box, steps, grade scale, core standards, explore links, CTAs.
   Colours, type, radii and spacing come from tokens.css. */

/* Live registry box */
.hm-live {
  padding: 18px 20px;
  border: var(--border);
  border-top: 3px solid var(--signal);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.hm-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hm-live-head span {
  color: var(--signal);
  font-size: var(--fs-meta);
  font-weight: var(--fw-meta);
  line-height: 1;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.hm-live-head small { color: var(--muted); font-size: var(--fs-meta); }

.hm-live-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  align-items: center;
}

.hm-live-g { display: flex; flex-direction: column; align-items: center; }
.hm-live-g > small { align-self: flex-start; color: var(--muted); font-size: var(--fs-small); }

.hm-gauge-slot { width: 100%; max-width: 210px; min-height: 90px; }
.hm-gauge-slot svg { display: block; width: 100%; height: auto; }

.hm-gnum { display: flex; align-items: center; gap: 6px; direction: ltr; }
.hm-gnum b { font: 600 var(--fs-stat)/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.hm-gnum small { color: var(--muted); font-weight: 600; }

.hm-live-f {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-inline-start: 16px;
  border-inline-start: var(--border);
}

.hm-live-f div { display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; align-items: center; }
.hm-live-f b { font: 600 var(--fs-stat)/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.hm-live-f small { grid-column: 2; color: var(--muted); font-size: var(--fs-small); }

.hm-fic {
  display: grid;
  place-items: center;
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--signal-tint);
  color: var(--signal);
}

.hm-fic.t { background: #d5f3ee; color: #0e7c6f; }

.hm-fic svg,
.hm-ex-ic svg,
.hm-dim-ic svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Grade chip — approved scale A+ … D */
.hm-grade {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: var(--fs-small);
  font-weight: var(--fw-meta);
  direction: ltr;
  unicode-bidi: isolate;
}

.hm-grade[data-g="A+"] { background: var(--grade-ap); color: #fff; }
.hm-grade[data-g="A"] { background: #d3f0dd; color: #0b4f2c; }
.hm-grade[data-g="B+"] { background: #e6f2cc; color: #3d5a0a; }
.hm-grade[data-g="B"] { background: #fbefc2; color: #5c4a00; }
.hm-grade[data-g="C+"] { background: #fde0c6; color: #7a3a06; }
.hm-grade[data-g="C"] { background: #f8d3d3; color: #7d1515; }
.hm-grade[data-g="D"] { background: #f1c9c9; color: #6b1010; }

/* Section heads */
.hm-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.hm-sec-head h2 { margin: 0; }
.hm-alt { background: rgba(255, 255, 255, 0.45); }

/* How it works */
.hm-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-bottom: 18px;
}

.hm-steps > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
}

.hm-steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--signal);
  color: #fff;
}

.hm-steps strong { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3); }
.hm-steps small { color: var(--text-soft); font-size: var(--fs-body); line-height: var(--lh-body); }

/* Grade scale */
.hm-scale { display: flex; border-radius: var(--radius-control); overflow: hidden; direction: ltr; }

.hm-scale span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  color: #fff;
  font-weight: var(--fw-meta);
}

.hm-scale small { font-weight: 500; font-size: var(--fs-meta); opacity: 0.9; }
.hm-scale .g-ap { background: var(--grade-ap); }
.hm-scale .g-a { background: var(--grade-a); }
.hm-scale .g-bp { background: var(--grade-bp); }
.hm-scale .g-b { background: var(--grade-b); }
.hm-scale .g-cp { background: var(--grade-cp); }
.hm-scale .g-c { background: var(--grade-c); }
.hm-scale .g-d { background: var(--grade-d); }

/* Core standards */
.hm-dims { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

.hm-dim {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line-soft));
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 10%, #fff), #fff 60%);
}

.hm-dim::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }

.hm-dim-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--c);
  color: #fff;
}

.hm-dim strong { font-size: var(--fs-body); line-height: 1.35; font-weight: var(--fw-h3); }
.hm-dim small { color: var(--text-soft); font-size: var(--fs-small); line-height: var(--lh-small); }
.hm-dim em { margin-top: auto; color: var(--muted); font: 600 var(--fs-meta) var(--font-mono); font-style: normal; }

/* Explore links */
.hm-exs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.hm-ex {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.hm-ex:hover { border-color: var(--signal); box-shadow: var(--shadow-card); }
.hm-ex > span:nth-child(2) { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.hm-ex strong { font-size: var(--fs-body); font-weight: var(--fw-h3); }
.hm-ex small { color: var(--text-soft); font-size: var(--fs-small); line-height: var(--lh-small); }
.hm-ex i { font-style: normal; color: var(--signal); }
[dir="rtl"] .hm-ex i { transform: scaleX(-1); }

.hm-ex-ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--signal-tint);
  color: var(--signal);
}

/* Calls to action */
.hm-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--grid-gap); }

.hm-cta-box {
  padding: 24px;
  border-radius: var(--radius-card);
  background: #10204a;
  color: #fff;
}

.hm-cta-box h2 { margin: 4px 0 8px; color: #fff; }
.hm-cta-box p { color: #c9d2f0; font-size: var(--fs-body); line-height: var(--lh-body); }
.hm-cta-box .eyebrow { color: #9fb0ff; }
.hm-cta-box.light { border: var(--border); background: var(--panel); color: var(--text); }
.hm-cta-box.light h2 { color: var(--text); }
.hm-cta-box.light p { color: var(--text-soft); }
.hm-cta-box.light .eyebrow { color: var(--signal); }

/* Live values fade in once loaded; their space is reserved, so nothing moves. */
.hm-gauge-slot svg { animation: hm-in 0.2s ease-out both; }
@keyframes hm-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 980px) {
  .hm-dims { grid-template-columns: repeat(2, 1fr); }
  .hm-exs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .hm-two,
  .hm-steps { grid-template-columns: 1fr; }
  .hm-live-body { grid-template-columns: 1fr; }

  .hm-live-f {
    flex-direction: row;
    justify-content: space-around;
    padding-inline-start: 0;
    padding-top: 12px;
    border-inline-start: 0;
    border-top: var(--border);
  }

  .hm-sec-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hm-dims,
  .hm-exs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-gauge-slot svg { animation: none; }
}
