:root {
  --bg: #1b1b1b;
  --bg-soft: #1f1f1f;
  --nav-bg: rgba(27, 27, 27, 0.98);
  --card-bg: #242424;
  --card-hover: #2a2a2a;
  --border-color: #333333;
  --text: #ffffff;
  --text-muted: #8e8e93;
  --accent: #8354f7;
  --accent-hover: #9b72f9;
  --accent-tint: rgba(131, 84, 247, 0.12);
  --up: #34c759;
  --down: #ff3b30;
  --radius: 8px;
  --radius-lg: 10px;
  --font: "Montserrat", "Codec Pro", system-ui, -apple-system, sans-serif;
  --brand-gradient: linear-gradient(135deg, #8354f7, #9b72f9);
}

[data-theme="light"] {
  --bg: #f4f4f6;
  --bg-soft: #ececf0;
  --card-bg: #ffffff;
  --card-hover: #efeff2;
  --border-color: #e2e2e7;
  --text: #1c1c1e;
  --text-muted: #6b6b72;
  --up: #1f9d49;
  --down: #e02424;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  width: 100%;
  max-width: 1080px;
  padding: 40px 20px 24px;
}

.app__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: #fff;
  display: grid;
  place-items: center;
}

.brand svg {
  width: 30px;
  height: 30px;
}

.app__title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.app__sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Grid ------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--card-hover);
}

.card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.card__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent-hover);
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.card__icon svg {
  width: 26px;
  height: 26px;
}

.card__body {
  flex: 1;
  min-width: 0;
}

.card__name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.card__desc {
  margin: 6px 0 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.card__arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--text-muted);
  font-size: 1.3rem;
  font-weight: 700;
  transition: transform 0.2s ease, color 0.2s ease;
}

.card:hover .card__arrow {
  color: var(--accent-hover);
  transform: translateX(3px);
}

.app__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
