:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --card: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(56, 189, 248, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.15), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(94, 234, 212, 0.1), transparent 35%),
    var(--bg);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.page {
  width: 100%;
  margin: 0 auto;
  padding: 40px 28px 72px;
}

.logo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.logo-img {
  width: 260px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 6px;
  width: min(780px, 100%);
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  caret-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--muted);
}

.search-bar input:focus {
  box-shadow: none;
}

/* prevent white autofill background */
.search-bar input:-webkit-autofill,
.search-bar input:-webkit-autofill:hover,
.search-bar input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px transparent inset;
  transition: background-color 9999s ease-in-out 0s;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  margin-left: 6px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.95), #4f46e5);
  color: #0b1021;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.search-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.search-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.primary {
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), #4f46e5);
  color: #0b1021;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.primary:hover {
  transform: translateY(-1px);
}

.group {
  margin-top: 28px;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.group h2 {
  margin: 0;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.card:hover {
  background: var(--card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.dot.plus {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.card-body {
  overflow: hidden;
}

.card-title {
  margin: 0 0 4px;
  font-weight: 600;
}

.card-url {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  width: min(420px, 100%);
  background: #111827;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-form label {
  font-size: 12px;
  color: var(--muted);
}

.modal-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.ghost.close {
  padding: 6px 10px;
  font-size: 20px;
  line-height: 1;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.add-card {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
}

.add-card:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.7);
}

.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.08), rgba(79, 70, 229, 0.15));
  border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  overflow: hidden;
  color: var(--text);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 24s linear infinite;
  min-width: 100%;
}

.ticker.paused .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .search-bar {
    flex-direction: column;
    border-radius: 16px;
    gap: 8px;
  }
  .hero {
    flex-direction: column;
  }
  .search-btn {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }
  .primary {
    width: 100%;
  }
}

