:root {
  --bg: #0a0b0f;
  --text: #eef1f6;
  --text-muted: #98a1b3;
  --accent: #6c8cff;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --gap: 16px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  padding: 0 22px 72px;
  overflow-x: hidden;
}

/* ambient gradient glows */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
}

body::before {
  top: -180px;
  left: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #4f6bff 0%, transparent 70%);
}

body::after {
  top: 120px;
  right: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #b34bff 0%, transparent 70%);
  opacity: 0.32;
}

.header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 0 8px;
}

.header__title {
  font-size: 2.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #ffffff 30%, #9db4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header__tagline {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 560px;
}

.main {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section {
  margin-top: 44px;
}

.section__heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* per-card hue wash along the top edge */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--h, 230) 90% 70% / 0.7), transparent);
  opacity: 0.6;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -18px hsl(var(--h, 230) 80% 50% / 0.55);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(140deg, hsl(var(--h, 230) 85% 62%), hsl(calc(var(--h, 230) + 40) 85% 52%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.card__monogram {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.card__favicon {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  opacity: 0;
}

/* once a real favicon loads, hide the monogram and show a neutral tile */
.card__icon--has-favicon {
  background: rgba(255, 255, 255, 0.08);
}

.card__icon--has-favicon .card__monogram {
  display: none;
}

.card__icon--has-favicon .card__favicon {
  opacity: 1;
}

.card__arrow {
  color: var(--text-muted);
  font-size: 1.05rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.card:hover .card__arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.card__name {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__brief {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.card__host {
  margin-top: 16px;
  font-size: 0.76rem;
  color: hsl(var(--h, 230) 80% 74%);
  word-break: break-all;
}

.card__remove {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.card:hover .card__remove,
.card__remove:focus-visible {
  opacity: 1;
}

.card__remove:hover {
  background: rgba(255, 80, 80, 0.2);
  color: #fff;
}

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.add-form__input {
  flex: 1 1 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.add-form__input::placeholder {
  color: var(--text-muted);
}

.add-form__input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-form__button {
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #8a6cff);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.add-form__button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.add-form__error {
  color: #ff7b7b;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.empty {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 8px 0;
}

.footer {
  max-width: var(--maxw);
  margin: 60px auto 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

@media (max-width: 560px) {
  .header {
    padding: 52px 0 4px;
  }

  .header__title {
    font-size: 2.1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
