:root {
  --navy: var(--desdechile-navy, #11183a);
  --orange: var(--desdechile-orange, #fe4a23);
  --cream: var(--desdechile-cream, #f5f3ec);
  --ink: var(--desdechile-ink, #0a0e27);
  --muted: #4b5170;
  --line: rgba(17, 24, 58, 0.14);
  --surface: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: Urbanist, system-ui, sans-serif;
  font-weight: 400;
}

h1, h2, h3, p, dl, dt, dd, ol, li {
  margin: 0;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  background: var(--navy);
  color: var(--cream);
  padding: 12px 18px;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 16px;
}

/* Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  min-width: 0;
}

.brand img {
  height: 36px;
  width: auto;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  min-width: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 21px;
  background: var(--orange);
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  color: var(--ink);
  white-space: nowrap;
}

.button-small {
  padding: 10px 15px;
}

/* Hero */

.hero {
  max-width: 1120px;
  margin: auto;
  padding: clamp(80px, 12vw, 150px) 24px 110px;
  text-align: center;
}

.eyebrow,
.kicker {
  font-family: "Ubuntu Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--navy);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  background: var(--orange);
  border-radius: 2px;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

.hero h1 {
  margin: 25px 0;
  font-size: clamp(46px, 7vw, 92px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero h1 span {
  color: var(--orange);
}

.hero .lead {
  max-width: 620px;
  margin: 0 auto 38px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.search {
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: auto;
  padding: 8px 8px 8px 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(17, 24, 58, 0.09);
}

.search > span {
  color: var(--orange);
  font-family: "Ubuntu Mono", monospace;
  font-size: 28px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 16px;
  background: transparent;
  border: 0;
  color: var(--navy);
  font: 400 17px Urbanist, sans-serif;
  outline: 0;
}

.search button {
  flex: 0 0 52px;
  height: 48px;
  width: 52px;
  background: var(--navy);
  border: 0;
  border-radius: 11px;
  color: var(--cream);
  font-size: 22px;
  cursor: pointer;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 13px;
}

.quick-links span {
  color: var(--muted);
}

.quick-links a {
  border-bottom: 1px solid var(--orange);
}

/* Section shell */

.section-heading {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto 48px;
}

.section-heading > p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--navy);
}

.kicker-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  background: var(--orange);
  border-radius: 1px;
}

.directory h2,
.status-aside h2,
.how h2,
.claim h2 {
  font-size: clamp(34px, 4.5vw, 54px);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

/* Estado en vivo (terminal + stats) */

.status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 8vw;
  padding: 100px clamp(24px, 7vw, 110px);
  background: var(--ink);
  color: var(--cream);
  border-top: 1px solid var(--line);
}

.terminal-window {
  border: 1px solid rgba(245, 243, 236, 0.28);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: rgba(245, 243, 236, 0.07);
  font: 400 11px "Ubuntu Mono", monospace;
}

.terminal-title i {
  width: 7px;
  height: 7px;
  background: rgba(245, 243, 236, 0.35);
  border-radius: 50%;
}

.terminal-title i:nth-child(2) {
  background: var(--orange);
}

.terminal-title span {
  margin-left: 8px;
  opacity: 0.55;
}

.terminal-body {
  padding: 30px;
  font: 400 clamp(13px, 1.4vw, 17px)/2 "Ubuntu Mono", monospace;
  color: rgba(245, 243, 236, 0.72);
}

.terminal-body p {
  margin: 0;
}

.terminal-body .prompt {
  color: var(--orange);
  font-weight: 400;
}

.terminal-body a {
  color: var(--cream);
  border-bottom: 1px solid var(--orange);
}

.cursor-line .cursor {
  display: inline-block;
  width: 6px;
  height: 16px;
  vertical-align: middle;
  background: var(--orange);
  animation: blink 1.05s steps(1, end) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.status-aside .kicker {
  color: var(--cream);
}

.status-aside .lead-secondary {
  max-width: 480px;
  margin-top: 14px;
  color: rgba(245, 243, 236, 0.72);
  font-size: 17px;
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 32px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(245, 243, 236, 0.16);
}

.stat-grid dt {
  font-family: "Ubuntu Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 243, 236, 0.55);
}

.stat-grid dd {
  margin-top: 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--cream);
}

/* Directorio */

.directory {
  padding: 100px clamp(24px, 6vw, 100px);
  border-top: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto 20px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  font: 400 13px Urbanist, sans-serif;
  cursor: pointer;
}

.chip.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--cream);
}

.filter-status {
  max-width: 1280px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-family: "Ubuntu Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.ranking {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.rank-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: var(--navy);
  border-radius: 10px;
  color: var(--orange);
  font: 400 16px "Ubuntu Mono", monospace;
}

.rank-badge.small {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.tag-demo {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(254, 74, 35, 0.09);
  border: 1px solid var(--orange);
  border-radius: 8px;
  color: var(--navy);
  font: 400 11px "Ubuntu Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rank-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.rank-card .rank-body h3 {
  margin: 8px 0 6px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.rank-card .meta,
.rank-row .meta {
  color: var(--muted);
  font-size: 13px;
}

.level {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
}

.level-track {
  display: inline-block;
  width: 64px;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.level-track i {
  display: block;
  height: 100%;
  background: var(--orange);
}

.level[data-level="bajo"] .level-track i { width: 30%; }
.level[data-level="medio"] .level-track i { width: 60%; }
.level[data-level="alto"] .level-track i { width: 90%; }

.rank-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rank-row h3 {
  font-size: 15px;
  letter-spacing: -0.005em;
}

.rank-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.filter-empty {
  max-width: 1280px;
  margin: 20px auto 0;
  color: var(--muted);
}

.filter-empty button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  border-bottom: 1px solid var(--orange);
  font: 400 14px Urbanist, sans-serif;
  cursor: pointer;
}

/* Cómo funciona */

.how {
  padding: 100px clamp(24px, 6vw, 100px);
  border-top: 1px solid var(--line);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1280px;
  margin: auto;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.step-number {
  display: block;
  margin-bottom: 20px;
  color: var(--orange);
  font: 400 13px "Ubuntu Mono", monospace;
}

.steps h3 {
  margin-bottom: 8px;
  font-size: 21px;
}

.steps p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Claim */

.claim {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  max-width: 1280px;
  margin: auto;
  padding: 110px 24px;
}

.claim h2 {
  margin-bottom: 8px;
  font-size: 44px;
}

.claim p {
  max-width: 600px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

/* Footer */

footer {
  display: flex;
  justify-content: space-between;
  padding: 28px clamp(24px, 5vw, 80px);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

footer a {
  color: var(--navy);
  border-bottom: 1px solid var(--orange);
}

.bid-control { align-items: center; display: flex; gap: 20px; justify-content: center; margin: 24px auto 0; }
.bid-box button { flex: 0 0 auto; min-width: 126px; padding-inline: 18px; width: auto; }
.bid-control button { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--navy); cursor: pointer; display: inline-flex; font-size: 28px; height: 48px; justify-content: center; width: 48px; }
.bid-control output { color: var(--orange); font-size: clamp(32px, 5vw, 54px); min-width: 190px; }
.rank-offer { align-items: flex-end; display: flex; flex-direction: column; gap: 10px; }
.rank-offer > span { color: var(--orange); font-size: 24px; }
.ranking-note { color: var(--muted); margin: 22px 0 0; }
dialog { background: transparent; border: 0; max-width: 520px; padding: 0; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(5 12 38 / 72%); }
.bid-dialog-card { background: var(--cream); border: 1px solid var(--line); border-radius: 20px; padding: 36px; position: relative; }
.bid-dialog-card h2 { margin: 14px 0; }
.bid-dialog-card .button { display: inline-flex; margin-top: 18px; }
.dialog-close { background: transparent; border: 0; color: var(--navy); cursor: pointer; font-size: 28px; position: absolute; right: 16px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .live-dot,
  .cursor-line .cursor {
    animation: none;
  }
}

/* Utility: keep filtered items truly hidden regardless of component display rules */
.rank-card[hidden],
.rank-row[hidden] {
  display: none;
}
