.page-home {
  background: var(--bg-surface);
  background-image: none;
}

.app--home {
  padding-top: 0.85rem;
}

.app--home > .nav {
  margin-bottom: 1.1rem;
}

/* ── Index strip ── */
.indexes {
  margin-bottom: 2.5rem;
}

.indexes__title {
  margin-bottom: 0.7rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.index-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  min-height: 78px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

a.index-card:hover,
a.index-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
}

a.index-card:focus-visible {
  outline: 2px solid var(--accent, #3478d4);
  outline-offset: 2px;
}

.index-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.index-card__names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.index-card__symbol {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.index-card__name {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.index-card__change {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.index-card__chart {
  flex: 0 0 auto;
  width: 88px;
  height: 36px;
  color: var(--green);
}

.index-card__chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.index-card__chart--empty {
  display: grid;
  place-items: center;
  width: auto;
  min-width: 72px;
  color: var(--text-muted);
  font-size: 0.65rem;
  text-align: center;
}

.market-value--up {
  color: var(--green);
}

.market-value--down {
  color: var(--red);
}

/* ── Hero search ── */
.home-hero {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.75rem;
  padding: 0.5rem 0 0.25rem;
  animation: home-fade-up 0.55s ease both;
}

.home-hero h1 {
  max-width: 18ch;
  color: #0f172a;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.045em;
}

[data-theme='dark'] .home-hero h1 {
  color: var(--text);
}

.home-hero > p {
  max-width: 52ch;
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 560px);
  margin-top: 1.6rem;
  animation: home-fade-up 0.6s ease 0.08s both;
  z-index: 5;
}

.hero-search__icon {
  position: absolute;
  left: 1rem;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 3.1rem 0.85rem 2.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.hero-search input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 85%, transparent);
}

.hero-search input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.hero-search__kbd {
  position: absolute;
  right: 0.75rem;
  display: grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
}

.hero-search__suggestions {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 6;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
  text-align: left;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

.hero-search__suggestion {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hero-search__suggestion:hover,
.hero-search__suggestion.is-active {
  background: var(--bg-elevated);
}

.hero-search__suggestion-symbol {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hero-search__suggestion-name {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-search__suggestion-empty {
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.hero-trending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  margin-top: 1rem;
  animation: home-fade-up 0.6s ease 0.14s both;
}

.hero-trending__label {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.hero-trending__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.15rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.hero-trending__list a {
  color: var(--blue);
  text-decoration: none;
}

.hero-trending__list a:hover {
  text-decoration: underline;
}

.hero-trending__sep {
  color: var(--blue);
  opacity: 0.55;
  user-select: none;
}

.hero-trending__more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.25rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.hero-trending__more:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Feature navigation ── */
.feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 auto 2.75rem;
  max-width: 920px;
  animation: home-fade-up 0.65s ease 0.18s both;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 112px;
  padding: 1rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.feature-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.05);
  transform: translateY(-2px);
}

.feature-card__icon {
  display: grid;
  place-items: center;
  color: #334155;
}

[data-theme='dark'] .feature-card__icon {
  color: var(--text-muted);
}

.feature-card__label {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  line-height: 1.25;
}

/* ── Day events feed ── */
.day-events {
  max-width: 720px;
  margin: 0 auto 2.75rem;
  scroll-margin-top: 1rem;
}

.day-events__header {
  margin-bottom: 0.85rem;
  text-align: center;
}

.day-events__header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.day-events__list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-events__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.day-events__item:last-child {
  border-bottom: 0;
}

.day-events__item::before {
  content: '•';
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
}

.day-events__item:has(.company-logo)::before {
  content: none;
}

.day-events__item a {
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.day-events__item a:hover {
  text-decoration: underline;
}

.day-events__text {
  min-width: 0;
}

.day-events__text--up {
  color: color-mix(in srgb, var(--green) 75%, var(--text));
}

.day-events__text--down {
  color: color-mix(in srgb, var(--red) 75%, var(--text));
}

.day-events__empty {
  padding: 1rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  list-style: none;
}

/* ── Hover chart popup ── */
.ticker-chart-popup {
  position: fixed;
  z-index: 1200;
  width: min(360px, calc(100vw - 1.5rem));
  padding: 0.65rem 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}

.ticker-chart-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ticker-chart-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ticker-chart-popup__symbol {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.ticker-chart-popup__meta {
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.ticker-chart-popup__canvas {
  display: block;
  width: 100%;
  height: 180px;
  border-radius: 6px;
  background: var(--bg-elevated);
}

.ticker-chart-popup__status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ticker-chart-popup__status--error {
  color: var(--red);
}

@keyframes home-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero,
  .hero-search,
  .hero-trending,
  .feature-grid {
    animation: none;
  }

  .feature-card:hover {
    transform: none;
  }
}

@media (max-width: 1100px) {
  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 640px;
  }
}

@media (max-width: 720px) {
  .indexes {
    margin-bottom: 1.75rem;
  }

  .home-hero {
    margin-bottom: 2rem;
  }

  .home-hero h1 {
    max-width: none;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 2rem;
  }

  .day-events {
    margin-bottom: 2rem;
  }
}

@media (max-width: 460px) {
  .index-grid {
    grid-template-columns: 1fr;
  }

  .index-card__chart {
    width: 72px;
  }

  .hero-search__kbd {
    display: none;
  }

  .hero-search input {
    padding-right: 1rem;
  }
}
