:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --border: #e7e9f2;
  --border-strong: #d5d9e7;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-hover: #4f46e5;
  --ring: rgba(99, 102, 241, 0.35);

  --badge-urgent-bg: #fee2e2;
  --badge-urgent-fg: #b91c1c;
  --badge-soon-bg: #fef3c7;
  --badge-soon-fg: #a16207;
  --badge-ok-bg: #dcfce7;
  --badge-ok-fg: #166534;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-lg:
    0 10px 30px -10px rgba(99, 102, 241, 0.25),
    0 2px 6px rgba(15, 23, 42, 0.05);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --max: 820px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      900px 500px at 10% -10%,
      rgba(99, 102, 241, 0.18),
      transparent 60%
    ),
    radial-gradient(
      700px 400px at 100% 0%,
      rgba(139, 92, 246, 0.14),
      transparent 60%
    ),
    radial-gradient(
      600px 400px at 50% 100%,
      rgba(59, 130, 246, 0.08),
      transparent 60%
    );
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* -------- Header -------- */

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 1rem;
  text-align: left;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.site-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.accent {
  background: linear-gradient(
    120deg,
    var(--accent) 0%,
    var(--accent-2) 70%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.05rem;
}

/* -------- Main -------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* -------- Search -------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px var(--ring),
    var(--shadow-md);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
}

button {
  padding: 0.7rem 1.2rem;
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 0;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-2) 100%
  );
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.15s;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

button.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

button.ghost:hover {
  background: var(--surface-2);
  filter: none;
}

/* -------- Toolbar / status -------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.25rem;
  margin-bottom: 0.75rem;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* -------- Results -------- */

.results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  animation: rise 0.35s ease both;
}

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

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(
    180deg,
    var(--accent),
    var(--accent-2)
  );
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-ens {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text);
}

.card-meta strong {
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--badge-ok-bg);
  color: var(--badge-ok-fg);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.soon {
  background: var(--badge-soon-bg);
  color: var(--badge-soon-fg);
}

.badge.urgent {
  background: var(--badge-urgent-bg);
  color: var(--badge-urgent-fg);
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.15s;
}

.card-link:hover {
  gap: 0.4rem;
}

/* -------- Pagination -------- */

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

/* -------- Footer -------- */

.site-footer {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* -------- Small screens -------- */

@media (max-width: 520px) {
  .site-header {
    padding-top: 2.5rem;
  }

  .search {
    padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  }

  .search input {
    font-size: 0.95rem;
  }

  button {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
  }

  .card {
    padding: 1.1rem 1.2rem;
  }

  .card-link {
    margin-left: 0;
  }
}
