/* Home page styles */

.layout--wide {
  --home-bar-inner: 3.25rem;
  --home-bar-shell: 0.35rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 1.1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 24rem;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171717;
  color: var(--text);
  box-shadow: var(--shadow);
}

.hero-panel__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(1.3rem, 4vw, 2.2rem);
}

.hero-panel h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.65rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 34rem;
  margin: 0;
  color: var(--text-muted);
}

.hero-panel .eyebrow {
  color: var(--accent);
}

.hero-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.home-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--home-bar-inner, 3.25rem);
  padding: 0 1rem;
  border: 1px solid rgba(51, 255, 167, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(51, 255, 167, 0.07), rgba(51, 255, 167, 0.02)),
    #2a2a2a;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(51, 255, 167, 0.06) inset,
    0 10px 28px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.home-search-trigger:hover,
.home-search-trigger:focus-visible {
  border-color: rgba(51, 255, 167, 0.62);
  background:
    linear-gradient(180deg, rgba(51, 255, 167, 0.11), rgba(51, 255, 167, 0.03)),
    #303030;
  box-shadow:
    0 0 0 1px rgba(51, 255, 167, 0.1) inset,
    0 0 0 3px rgba(51, 255, 167, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
  outline: none;
}

.home-search-trigger__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent);
}

.home-search-trigger__placeholder {
  flex: 1 1 auto;
  min-width: 0;
  color: #b8b8b8;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
}

.home-search-modal[hidden] {
  display: none !important;
}

.home-search-modal__backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.home-search-modal__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 42rem);
  max-height: min(90vh, 44rem);
  overflow: auto;
}

body.home-search-modal-open {
  overflow: hidden;
}

.search-form--launcher {
  margin: 0;
}

.search-form--launcher .search-dock {
  z-index: 1;
}

.search-form--launcher .search-stats {
  margin-top: 0.55rem;
  font-size: 0.8rem;
}

.search-inline-panel {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-search-top {
  position: sticky;
  top: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-bar-inner, 3.25rem);
  gap: var(--home-bar-shell, 0.35rem);
  margin-bottom: 1.15rem;
  padding: var(--home-bar-shell, 0.35rem);
  padding-top: max(var(--home-bar-shell, 0.35rem), env(safe-area-inset-top));
  border-radius: var(--radius-panel);
  background:
    linear-gradient(135deg, rgba(51, 255, 167, 0.12), rgba(51, 255, 167, 0.02) 55%, transparent),
    #1a1a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.home-map-trigger {
  display: grid;
  min-width: var(--home-bar-inner, 3.25rem);
  min-height: var(--home-bar-inner, 3.25rem);
  place-items: center;
  border: 1px solid rgba(51, 255, 167, 0.42);
  border-radius: 12px;
  background: #252c29;
  color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(51, 255, 167, 0.06) inset,
    0 8px 20px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  animation: home-map-idle-pulse 5.2s ease-in-out infinite;
}

.home-map-trigger:hover,
.home-map-trigger:focus-visible {
  border-color: rgba(51, 255, 167, 0.72);
  background: #303b36;
  box-shadow:
    0 0 0 1px rgba(51, 255, 167, 0.12) inset,
    0 0 0 4px rgba(51, 255, 167, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px) scale(1.04);
  outline: none;
  animation: none;
}

@keyframes home-map-idle-pulse {
  0%, 58%, 100% {
    border-color: rgba(51, 255, 167, 0.42);
    box-shadow:
      0 0 0 1px rgba(51, 255, 167, 0.06) inset,
      0 8px 20px rgba(0, 0, 0, 0.28);
    transform: translateY(0) scale(1);
  }

  64% {
    border-color: rgba(51, 255, 167, 0.58);
    box-shadow:
      0 0 0 1px rgba(51, 255, 167, 0.12) inset,
      0 0 0 4px rgba(51, 255, 167, 0.07),
      0 10px 24px rgba(0, 0, 0, 0.32);
    transform: translateY(-1px) scale(1.04);
  }

  70% {
    border-color: rgba(51, 255, 167, 0.78);
    box-shadow:
      0 0 0 1px rgba(51, 255, 167, 0.18) inset,
      0 0 0 7px rgba(51, 255, 167, 0.14),
      0 12px 28px rgba(0, 0, 0, 0.36);
    transform: translateY(-2px) scale(1.07);
  }

  78% {
    border-color: rgba(51, 255, 167, 0.52);
    box-shadow:
      0 0 0 1px rgba(51, 255, 167, 0.1) inset,
      0 0 0 3px rgba(51, 255, 167, 0.06),
      0 9px 22px rgba(0, 0, 0, 0.3);
    transform: translateY(0) scale(1.03);
  }

  86% {
    border-color: rgba(51, 255, 167, 0.46);
    box-shadow:
      0 0 0 1px rgba(51, 255, 167, 0.08) inset,
      0 0 0 1px rgba(51, 255, 167, 0.03),
      0 8px 20px rgba(0, 0, 0, 0.28);
    transform: translateY(0) scale(1.01);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-map-trigger {
    animation: none;
  }
}

.home-map-trigger svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section--gift {
  margin-bottom: 1.35rem;
}

.section--updates {
  margin-top: 0.35rem;
}

.updates-rail {
  position: relative;
  display: grid;
  gap: 1rem;
}

.updates-rail::before {
  content: "";
  position: absolute;
  left: 5.1rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(51, 255, 167, 0.3), rgba(51, 255, 167, 0.05));
}

.updates-rail__item {
  position: relative;
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.updates-rail__date {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 0.15rem;
  padding-top: 0.2rem;
}

.updates-rail__date::after {
  content: "";
  position: absolute;
  left: 4.6rem;
  top: 0.95rem;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(51, 255, 167, 0.45);
  border-radius: 999px;
  background: #1f3d32;
  box-shadow: 0 0 0 0.3rem rgba(51, 255, 167, 0.08);
}

.updates-rail__day {
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.updates-rail__year {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.updates-rail__body {
  padding: 0.78rem 1rem 0.82rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(155deg, rgba(51, 255, 167, 0.06), rgba(51, 255, 167, 0.01) 60%),
    #262626;
  box-shadow: var(--shadow);
}

.updates-rail__body h3 {
  margin: 0;
  font-size: clamp(1.02rem, 2.2vw, 1.28rem);
  line-height: 1.18;
}

.updates-rail__body-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.updates-rail__body-link:hover,
.updates-rail__body-link:focus-visible {
  border-color: rgba(51, 255, 167, 0.26);
  background:
    linear-gradient(155deg, rgba(51, 255, 167, 0.1), rgba(51, 255, 167, 0.02) 60%),
    #2a2a2a;
  transform: translateY(-1px);
}

.updates-rail__body-link h3,
.updates-rail__body-link p {
  color: inherit;
}

.updates-rail__body h3 a {
  text-decoration: none;
}

.updates-rail__body p {
  margin: 0.38rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-panel__visual {
  position: relative;
  min-height: 18rem;
  background: #080808;
}

.hero-panel__visual img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: left center;
  filter: saturate(0.95) contrast(1.05);
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
  background: #252525;
}

.setup-steps li {
  margin: 0;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.setup-steps li:last-child {
  border-right: 0;
}

.setup-steps a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3rem;
  padding: 0.2rem 0.6rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}

.setup-steps a:hover {
  background: rgba(51, 255, 167, 0.08);
  color: var(--accent);
}

.resource-tile--commands {
  grid-column: span 1;
  position: relative;
  overflow: visible;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.resource-tile--commands:hover {
  border-color: rgba(51, 255, 167, 0.22);
  background: #343434;
}

.resource-tile--commands:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.resource-tile--commands:hover,
.resource-tile--commands:focus-within {
  border-color: rgba(51, 255, 167, 0.24);
  background: #343434;
}

.resource-tile--commands::after {
  content: "▾";
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.resource-tile--commands:has(.resource-tile__flag)::after {
  display: none;
}

.resource-tile--commands:hover::after,
.resource-tile--commands:focus-within::after {
  color: var(--accent);
  transform: rotate(-180deg);
}

.quick-commands {
  margin: 0.15rem 0 0.6rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.quick-commands li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--surface-muted);
  border-radius: 10px;
  background: var(--surface-muted);
}

.quick-commands__name {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1 1 auto;
  min-width: 0;
}

.quick-commands code {
  white-space: nowrap;
}

.quick-commands--compact {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 8;
  margin: 0;
  padding-top: 0.85rem;
  padding-inline: 0.85rem;
  padding-bottom: 0.85rem;
  border: 1px solid rgba(51, 255, 167, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(51, 255, 167, 0.04), rgba(51, 255, 167, 0)) ,
    #303030;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  display: none;
}

.quick-commands--compact li {
  padding: 0.45rem 0.6rem;
}

.quick-commands--compact .quick-commands__name,
.quick-commands--compact code {
  font-size: 0.88rem;
}

.resource-tile--commands:hover .quick-commands--compact,
.resource-tile--commands:focus-within .quick-commands--compact {
  display: grid;
}

.gift-panel {
  background: #1f3d32;
  border: 1px solid rgba(51, 255, 167, 0.28);
  border-radius: 12px;
  padding: 0 0.85rem;
}

.gift-panel--inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 0.75rem;
  align-items: center;
  min-height: calc(var(--home-bar-inner, 3.25rem) + var(--home-bar-shell, 0.35rem) * 2);
  box-sizing: border-box;
}

.gift-panel--multi {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 0.75rem;
  align-items: center;
  padding: 0 0.85rem;
  min-height: calc(var(--home-bar-inner, 3.25rem) + var(--home-bar-shell, 0.35rem) * 2);
  box-sizing: border-box;
}

.gift-center {
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.gift-entry {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.gift-entry__servers {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gift-entry__servers img {
  vertical-align: middle;
  margin-right: 0.1rem;
}

.gift-entry__code {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.gift-panel__title,
.gift-panel--inline h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.gift-code {
  justify-self: center;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.7vw, 1rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1.2;
}

.gift-code--empty {
  font-family: inherit;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.gift-panel__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.gift-panel__actions .button {
  min-width: 3.75rem;
  min-height: calc(var(--home-bar-inner, 3.25rem) - 0.5rem);
  padding: 0 0.65rem;
  font-size: 0.88rem;
}

.gift-panel__link {
  white-space: nowrap;
}

@media (max-width: 920px) {
  .hero-panel {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel__visual {
    min-height: 16rem;
  }

  .resource-tile--commands:hover .quick-commands--compact,
  .resource-tile--commands:focus-within .quick-commands--compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .setup-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero-panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-panel__visual {
    min-height: 13rem;
    order: -1;
  }

  .setup-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gift-panel--multi {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.35rem 0;
    padding: 0.55rem 0.75rem;
    min-height: auto;
    align-items: center;
  }

  .gift-panel--multi .gift-panel__title {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.82rem;
  }

  .gift-panel--multi .gift-panel__link {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-width: 1px;
  }

  .gift-center {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255,255,255,.08);
  }

  .gift-entry {
    flex-direction: column;
    gap: 0.05rem;
  }

  .gift-entry__servers {
    font-size: 0.72rem;
  }

  .gift-entry__code {
    font-size: 0.82rem;
  }

  .home-search-top {
    margin-bottom: 0.85rem;
  }

  .section--updates .section-heading {
    align-items: flex-start;
  }

  .updates-rail::before {
    left: 0.46rem;
  }

  .updates-rail__item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    align-items: start;
  }

  .updates-rail__date {
    gap: 0.05rem;
    padding-left: 1.55rem;
  }

  .updates-rail__date::after {
    left: 0;
    top: 0.3rem;
  }

  .updates-rail__day {
    font-size: 1.1rem;
  }

  .resource-tile--commands {
    grid-column: auto;
  }

  .resource-tile--commands::after {
    display: none;
  }

  .quick-commands--compact {
    position: static;
    display: grid;
    margin: 0.85rem 0 0.1rem;
    padding-inline: 0;
    padding-bottom: 0;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

}
