/* =================================================================
   REGISTRY.CSS — The Registry: SII Certification Registry
   Settlement Integrity Institute
   ================================================================= */

/* -----------------------------------------------------------------
   CSS CUSTOM PROPERTIES
   ----------------------------------------------------------------- */
:root {
  --navy-deep:        #0F1A30;
  --navy:             #1B2A4A;
  --bronze:           #8B7355;
  --bronze-light:     #A99579;
  --bronze-dim:       rgba(139, 115, 85, 0.18);
  --parchment:        #F8F6F3;
  --body-text:        #D8D4CE;
  --muted-text:       #8A8680;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------------------------------------
   PAGE ROOT
   ----------------------------------------------------------------- */
.registry-page {
  background: var(--navy-deep);
  color: var(--body-text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Nav override */
.registry-page .nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(15, 26, 48, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(139, 115, 85, 0.12);
}

.registry-page .nav__links a.nav__active {
  color: var(--bronze-light);
  border-bottom: 1px solid var(--bronze);
}

/* -----------------------------------------------------------------
   CROSSHATCH TEXTURE
   ----------------------------------------------------------------- */
.registry-crosshatch {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 115, 85, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 115, 85, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* -----------------------------------------------------------------
   HERO
   ----------------------------------------------------------------- */
.registry-hero {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: flex-end;
  background: var(--navy-deep);
  overflow: hidden;
  padding: 0 80px 72px;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.registry-hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 100% 100% at 50% 0%,
    rgba(27, 42, 74, 0.45) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

.registry-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
}

.registry-hero__eyebrow {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 20px;
  opacity: 0;
  animation: regFadeUp 0.9s var(--ease-out) 0.3s both;
}

.registry-hero__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--parchment);
  margin: 0 0 28px;
  opacity: 0;
  animation: regFadeUp 1s var(--ease-out) 0.5s both;
}

.registry-hero__rule {
  display: block;
  width: 72px;
  height: 1.5px;
  background: var(--bronze);
  border: none;
  margin: 0 0 28px;
  opacity: 0;
  animation: regRuleIn 0.9s var(--ease-out) 0.75s both;
}

.registry-hero__subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--body-text);
  max-width: 560px;
  margin: 0 0 48px;
  opacity: 0;
  animation: regFadeUp 0.9s var(--ease-out) 0.9s both;
}

/* Hero stats row */
.registry-hero__stats {
  display: flex;
  gap: 56px;
  align-items: flex-start;
  opacity: 0;
  animation: regFadeUp 0.9s var(--ease-out) 1.1s both;
}

.registry-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.registry-hero__stat-num {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--parchment);
  line-height: 1;
  letter-spacing: -0.02em;
}

.registry-hero__stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}

@keyframes regFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes regRuleIn {
  from { transform: scaleX(0); transform-origin: left; opacity: 0; }
  to   { transform: scaleX(1); transform-origin: left; opacity: 0.8; }
}

/* -----------------------------------------------------------------
   MAIN CONTENT AREA
   ----------------------------------------------------------------- */
.registry-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 80px 120px;
}

/* -----------------------------------------------------------------
   FILTER TABS
   ----------------------------------------------------------------- */
.registry-filters {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.15);
  margin-bottom: 0;
  opacity: 0;
  animation: regFadeUp 0.8s var(--ease-out) 1.3s both;
}

.registry-filter-tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-text);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 16px 28px;
  cursor: pointer;
  position: relative;
  bottom: -1px;
  transition:
    color 220ms var(--ease-out),
    border-color 220ms var(--ease-out);
}

.registry-filter-tab:hover {
  color: var(--bronze-light);
}

.registry-filter-tab.is-active {
  color: var(--parchment);
  border-bottom-color: var(--bronze);
}

/* -----------------------------------------------------------------
   REGISTRY TABLE
   ----------------------------------------------------------------- */
.registry-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.registry-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Column widths — 9 columns */
.registry-table colgroup col:nth-child(1) { width: 48px; }   /* Index */
.registry-table colgroup col:nth-child(2) { width: 22%; }    /* Entity / Issuer */
.registry-table colgroup col:nth-child(3) { width: 16%; }    /* Asset Class */
.registry-table colgroup col:nth-child(4) { width: 56px; }   /* Score */
.registry-table colgroup col:nth-child(5) { width: 15%; }    /* Tier */
.registry-table colgroup col:nth-child(6) { width: 10%; }    /* Cert Date */
.registry-table colgroup col:nth-child(7) { width: 10%; }    /* Valid Through */
.registry-table colgroup col:nth-child(8) { width: 16%; }    /* Ref */
.registry-table colgroup col:nth-child(9) { width: 14%; }    /* Status */

/* Table header */
.registry-table thead tr {
  border-top: 1px solid rgba(139, 115, 85, 0.15);
  border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}

.registry-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  padding: 18px 16px;
  text-align: left;
  white-space: nowrap;
  background: rgba(139, 115, 85, 0.04);
  border-bottom: 1px solid rgba(139, 115, 85, 0.12);
}

.registry-table th:first-child {
  padding-left: 0;
  color: transparent;
}

/* Table body rows */
.registry-table tbody tr {
  border-bottom: 1px solid rgba(139, 115, 85, 0.07);
  transition: background 200ms var(--ease-out);
  opacity: 0;
  transform: translateY(6px);
  animation: regRowIn 0.6s var(--ease-out) both;
}

.registry-table tbody tr:hover {
  background: rgba(139, 115, 85, 0.04);
}

/* Clickable certified rows */
.reg-row--clickable {
  cursor: pointer;
}

.reg-row--clickable:hover {
  background: rgba(139, 115, 85, 0.06) !important;
}

.reg-row--clickable:hover .reg-td-entity {
  color: var(--bronze-light);
}

.reg-td-entity--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: color 200ms var(--ease-out);
}

.reg-td-entity--link:hover {
  color: var(--bronze-light);
}

@keyframes regRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.registry-table td {
  padding: 22px 16px;
  vertical-align: middle;
}

.registry-table td:first-child {
  padding-left: 0;
}

/* Index number */
.reg-td-index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  color: rgba(139, 115, 85, 0.35);
  letter-spacing: 0.1em;
  white-space: nowrap;
  padding-right: 8px !important;
}

/* Entity name */
.reg-td-entity {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--parchment);
  letter-spacing: -0.01em;
}

.reg-td-entity__sub {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--muted-text);
  letter-spacing: 0.02em;
  margin-top: 3px;
}

/* Asset class */
.reg-td-assetclass {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--body-text);
  letter-spacing: 0.02em;
}

/* Date */
.reg-td-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 300;
  color: var(--muted-text);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Score */
.reg-td-score {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--parchment);
  letter-spacing: -0.01em;
  text-align: center;
}

/* Tier */
.reg-td-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--bronze-light);
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.reg-td-tier__sub {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  color: var(--muted-text);
  letter-spacing: 0.04em;
  margin-top: 2px;
  text-transform: none;
}

/* Ref number */
.reg-td-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 300;
  color: rgba(139, 115, 85, 0.55);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* -----------------------------------------------------------------
   STATUS BADGES
   ----------------------------------------------------------------- */
.reg-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 2px;
  white-space: nowrap;
}

.reg-badge::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Certified */
.reg-badge--certified {
  color: #A8C4A2;
  background: rgba(168, 196, 162, 0.08);
  border: 1px solid rgba(168, 196, 162, 0.2);
}
.reg-badge--certified::before {
  background: #A8C4A2;
  box-shadow: 0 0 6px rgba(168, 196, 162, 0.5);
}

/* Qualified */
.reg-badge--qualified {
  color: #9BB8A4;
  background: rgba(155, 184, 164, 0.07);
  border: 1px solid rgba(155, 184, 164, 0.18);
}
.reg-badge--qualified::before {
  background: #9BB8A4;
  box-shadow: 0 0 5px rgba(155, 184, 164, 0.35);
}

/* Under Review */
.reg-badge--review {
  color: var(--bronze-light);
  background: rgba(139, 115, 85, 0.08);
  border: 1px solid rgba(139, 115, 85, 0.2);
}
.reg-badge--review::before {
  background: var(--bronze);
  animation: badgePulse 2s ease-in-out infinite;
}

/* Conditional */
.reg-badge--conditional {
  color: #C4A96A;
  background: rgba(196, 169, 106, 0.07);
  border: 1px solid rgba(196, 169, 106, 0.22);
}
.reg-badge--conditional::before {
  background: #C4A96A;
  animation: badgePulse 3s ease-in-out infinite;
}

/* Forthcoming */
.reg-badge--forthcoming {
  color: var(--muted-text);
  background: rgba(138, 134, 128, 0.06);
  border: 1px solid rgba(138, 134, 128, 0.15);
}
.reg-badge--forthcoming::before {
  background: rgba(138, 134, 128, 0.4);
}

@keyframes badgePulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.25); }
}

/* -----------------------------------------------------------------
   SECTION DIVIDERS — between category groups in table
   ----------------------------------------------------------------- */
.registry-table tbody .reg-group-header td {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bronze);
  padding: 32px 16px 12px;
  border-bottom: 1px solid rgba(139, 115, 85, 0.15);
  opacity: 0.7;
  background: none;
}

.registry-table tbody .reg-group-header:hover {
  background: none;
}

.registry-table tbody .reg-group-header td:first-child {
  padding-left: 0;
}

/* -----------------------------------------------------------------
   PLACEHOLDER ROW — "Applications Open" CTA row
   ----------------------------------------------------------------- */
.reg-row-placeholder td {
  padding: 20px 16px;
  border-bottom: 1px dashed rgba(139, 115, 85, 0.12) !important;
}

.reg-row-placeholder:hover {
  background: none !important;
}

.reg-td-placeholder-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(138, 134, 128, 0.4);
  letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------
   APPLICATION CTA SECTION
   ----------------------------------------------------------------- */
.registry-apply {
  margin-top: 100px;
  padding-top: 64px;
  border-top: 1px solid rgba(139, 115, 85, 0.12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  opacity: 0;
  animation: regFadeUp 0.9s var(--ease-out) 2s both;
}

.registry-apply__left {}

.registry-apply__eyebrow {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 20px;
}

.registry-apply__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--parchment);
  margin-bottom: 24px;
}

.registry-apply__body {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--body-text);
  max-width: 480px;
}

.registry-apply__right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Process steps */
.registry-apply__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.registry-apply__step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.08);
}

.registry-apply__step:first-child {
  border-top: 1px solid rgba(139, 115, 85, 0.08);
}

.registry-apply__step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--bronze);
  padding-top: 3px;
  min-width: 24px;
  flex-shrink: 0;
}

.registry-apply__step-content {}

.registry-apply__step-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--parchment);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.registry-apply__step-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--body-text);
  line-height: 1.65;
  max-width: none;
}

/* CTA button */
.registry-apply__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-deep);
  background: var(--bronze);
  text-decoration: none;
  padding: 16px 32px;
  transition:
    background 200ms var(--ease-out),
    color 200ms var(--ease-out);
  align-self: flex-start;
}

.registry-apply__cta:hover {
  background: var(--bronze-light);
  color: var(--navy-deep);
}

.registry-apply__cta-sub {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--muted-text);
  margin-top: 10px;
  text-transform: uppercase;
}

/* -----------------------------------------------------------------
   FOOTER MONOLITH
   ----------------------------------------------------------------- */
.registry-footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(139, 115, 85, 0.1);
  padding: 100px 80px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.registry-footer__monolith {
  display: block;
  width: clamp(200px, 35vw, 320px);
  margin: 0 auto 40px;
  opacity: 0.85;
}

.registry-footer__tagline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--body-text);
  margin: 0 0 12px;
  opacity: 0.7;
}

.registry-footer__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: var(--muted-text);
  text-transform: uppercase;
  text-align: center;
  max-width: 100%;
  width: 100%;
  opacity: 0.5;
}

/* -----------------------------------------------------------------
   MOBILE
   ----------------------------------------------------------------- */
@media (max-width: 900px) {
  .registry-hero {
    padding: calc(var(--nav-height) + 2rem) 24px 56px;
    min-height: 50vh;
  }

  .registry-main {
    padding: 56px 24px 80px;
  }

  .registry-apply {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .registry-hero__stats {
    gap: 32px;
  }

  .registry-footer {
    padding: 72px 24px 56px;
  }

  .reg-badge {
    font-size: 0.58rem;
    padding: 4px 8px;
  }

  /* Hide less-critical columns on mobile — keep: #, Entity, Score, Status */
  .registry-table th:nth-child(3),
  .registry-table td:nth-child(3),
  .registry-table th:nth-child(5),
  .registry-table td:nth-child(5),
  .registry-table th:nth-child(6),
  .registry-table td:nth-child(6),
  .registry-table th:nth-child(7),
  .registry-table td:nth-child(7),
  .registry-table th:nth-child(8),
  .registry-table td:nth-child(8) {
    display: none;
  }
}

@media (max-width: 600px) {
  .registry-filter-tab {
    padding: 14px 16px;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }

  /* Tighten entity cell on small screens */
  .reg-td-entity {
    font-size: 0.9rem;
  }

  .reg-td-entity__sub {
    font-size: 0.68rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Reduce index number column */
  .reg-td-index {
    font-size: 0.6rem;
    width: 28px;
    padding-right: 4px;
  }

  /* Badge text smaller */
  .reg-badge {
    font-size: 0.56rem;
    padding: 3px 7px;
    letter-spacing: 0.08em;
  }
}

/* -----------------------------------------------------------------
   REDUCED MOTION
   ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .registry-hero__eyebrow,
  .registry-hero__title,
  .registry-hero__rule,
  .registry-hero__subtitle,
  .registry-hero__stats,
  .registry-filters,
  .registry-apply,
  .registry-table tbody tr {
    opacity: 1;
    animation: none;
    transform: none;
  }
  .reg-badge--review::before {
    animation: none;
    opacity: 1;
  }
}
