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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/*  Base  */

/* ── Persistent home background visuals wrapper ── */
#home-bg-visuals {
  position: fixed;
  top: 0;
  left: 92px;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease, left 0.3s ease;
}

body.view-home #home-bg-visuals {
  visibility: visible;
  opacity: 1;
}

.sidebar:hover ~ #home-bg-visuals {
  left: 274px;
}

.home {
  --primary-local: var(--primary, #d4550a);
  --primary-deep-local: var(--primary-deep, #992f05);
  --primary-shadow-local: var(--primary-shadow, rgba(212,85,10,0.5));
  --accent-gradient-local: var(--accent-gradient, linear-gradient(90deg, rgba(255,77,0,1), rgba(255,106,0,1)));
  --on-accent-local: var(--on-primary, #fff0e8);
  --text-local: var(--text, #f8e7e0);
  --muted-local: var(--muted, #c9a08a);
  --surface-local: var(--surface, #1a100d);
  --page-bg-local: var(--page-bg, #0a0605);

  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  color: var(--text-local);
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

/*  Layout  */

.home-layout {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 7%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/*  Content (left)  */

.home-content {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  z-index: 5;
  pointer-events: auto;
}

/*  Animations  */

@keyframes homeFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes homeFadeInOpacity {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes homeSlideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes homePulseGlow {
  0%, 100% { box-shadow: 0 4px 24px var(--primary-shadow-local), 0 0 0 0 transparent; }
  50% { box-shadow: 0 6px 32px var(--primary-shadow-local), 0 0 48px color-mix(in srgb, var(--primary-local) 15%, transparent); }
}



/*  Title  */

.home h1 {
  font-size: clamp(3rem, 5.5vw, 4.5rem);
  line-height: 1;
  font-weight: 800;
  margin: 0 0 16px 0;
  letter-spacing: -0.04em;
  background: var(--accent-gradient-local);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: homeFadeIn 0.7s 0.1s ease-out forwards;
  white-space: nowrap;
  overflow: visible;
  width: max-content;
  filter: drop-shadow(0 0 18px var(--primary-shadow-local));
}

#nexora-typed {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: #fff;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.5));
}

.typing-cursor {
  display: inline;
  background: none;
  -webkit-text-fill-color: #fff;
  font-weight: 200;
  opacity: 1;
  animation: cursorBlink 0.75s step-end infinite;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.4));
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/*  Description  */

.home-desc {
  font-size: 1.05rem;
  color: var(--muted-local);
  line-height: 1.65;
  max-width: 420px;
  margin: 0 0 32px 0;
  opacity: 0;
  animation: homeFadeIn 0.7s 0.2s ease-out forwards;
}

/*  Primary CTA  */

.home-cta {
  display: inline-flex;
  align-items: center;
  background: var(--accent-gradient-local);
  color: var(--on-accent-local);
  text-decoration: none;
  padding: 15px 32px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
  box-shadow: 0 4px 24px var(--primary-shadow-local);
  animation: homeFadeInOpacity 0.7s 0.35s ease-out forwards, homePulseGlow 4s 1.5s ease-in-out infinite;
  opacity: 0;
}

/* Shimmer sweep */
.home-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0s;
}

.home-cta:hover::before {
  transform: translateX(120%);
  transition: transform 0.45s ease;
}

/* Bright glow ring on hover */
.home-cta::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  background: var(--accent-gradient-local);
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.25s ease;
  z-index: -1;
}

.home-cta:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 14px 48px var(--primary-shadow-local),
    0 0 0 1px color-mix(in srgb, var(--primary-local) 35%, transparent);
  filter: brightness(1.1);
}

.home-cta:hover::after {
  opacity: 0.55;
}

/* Satisfying press-down */
.home-cta:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 12px var(--primary-shadow-local);
  filter: brightness(0.95);
  transition:
    transform 0.08s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.08s ease,
    filter 0.08s ease;
}

.home-cta:active::after {
  opacity: 0;
}



/*  Quick links row  */

.home-links {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 20px;
  margin-bottom: 24px;
  opacity: 0;
  animation: homeFadeIn 0.6s 0.5s ease-out forwards;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-local);
  background: color-mix(in srgb, var(--surface-local) 50%, rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.25s ease;
  cursor: pointer;
}

.home-link svg {
  width: 15px;
  height: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}

.home-link:hover {
  background: color-mix(in srgb, var(--primary-local) 10%, rgba(255,255,255,0.04));
  border-color: color-mix(in srgb, var(--primary-local) 25%, rgba(255,255,255,0.1));
  transform: translateY(-1px);
}

.home-link.vote { color: #4ade80; }
.home-link.vote svg { opacity: 1; }
.home-link.vote:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

/*  Social icons  */

.home-socials {
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: 0;
  animation: homeFadeIn 0.5s 0.6s ease-out forwards;
}

.home-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.25s ease;
  opacity: 0.5;
}

.home-social-link svg {
  width: 16px;
  height: 16px;
}

.home-social-link:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.home-social-link.yt { color: #ff4444; }
.home-social-link.yt:hover { background: rgba(255, 0, 0, 0.12); }
.home-social-link.tt { color: var(--text-local); }
.home-social-link.tt:hover { background: rgba(255, 255, 255, 0.08); }
.home-social-link.dc { color: #7289da; }
.home-social-link.dc:hover { background: rgba(88, 101, 242, 0.12); }

/*  Scrolling Visuals (right)  */

.home-visuals {
  position: absolute;
  right: 3%;
  top: 50%;
  transform: translateY(-50%) rotate(4deg);
  width: 38vw;
  height: 95vh;
  pointer-events: none;
  z-index: 0;
  mask-image:
    linear-gradient(to bottom, transparent 2%, black 18%, black 82%, transparent 98%),
    linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 2%, black 18%, black 82%, transparent 98%);
  mask-composite: intersect;
  padding: 10px;
  opacity: 0.7;
}

.home-columns {
  display: flex;
  gap: 14px;
  height: 100%;
  width: 100%;
}

.home-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  will-change: transform;
}

.home-c1 .home-track { animation: homeScrollDown 140s linear infinite; }
.home-c2 .home-track { animation: homeScrollUp 160s linear infinite; }
.home-c3 .home-track { animation: homeScrollDown 150s linear infinite; }

@keyframes homeScrollDown {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
@keyframes homeScrollUp {
  0%   { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

/*  Game cards  */

.home-card {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: visible;
  position: relative;
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  display: block;
  text-decoration: none;
  flex-shrink: 0;
}

.home-card-inner {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--surface-local);
}

.home-card-inner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s, transform 0.4s ease;
  opacity: 0.75;
}

.home-card-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.home-card-ov span {
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

.home-card:hover {
  transform: scale(1.08);
  z-index: 9999;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.home-card:hover .home-card-inner img {
  opacity: 1;
  filter: brightness(1.15);
  transform: scale(1.05);
}

.home-card-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    400px circle at var(--x, 50%) var(--y, 50%),
    color-mix(in srgb, var(--primary-local, #d4550a) 18%, transparent) 0%,
    color-mix(in srgb, var(--primary-local, #d4550a) 8%, transparent) 30%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.home-card:hover .home-card-inner::before {
  opacity: 1;
}

.home-card:hover .home-card-ov {
  opacity: 1;
}

/*  Focus  */

.home a:focus-visible,
.home button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-color, rgba(212,85,10,0.18));
}

/*  Performance overrides  */

html.performance-no-animations .home h1,
html.performance-no-animations .home .home-desc,
html.performance-no-animations .home .home-cta,
html.performance-no-animations .home .home-links,
html.performance-no-animations .home .home-socials,
html.performance-fast .home h1,
html.performance-fast .home .home-desc,
html.performance-fast .home .home-cta,
html.performance-fast .home .home-links,
html.performance-fast .home .home-socials {
  animation: none !important;
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}

html.performance-no-animations .home-track,
html.performance-fast .home-track {
  animation: none !important;
}

html.performance-no-animations #home-bg-visuals,
html.performance-fast #home-bg-visuals {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .home h1, .home .home-desc, .home .home-cta, .home .home-links,
  .home .home-socials {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .home-track { animation: none !important; }
}

/*  Responsive  */

@media (max-width: 1100px) {
  .home-visuals { width: 32vw; right: 2%; opacity: 0.5; }
  .home-layout { padding: 0 5%; }
  #home-bg-visuals { left: 68px; }
}

@media (max-width: 768px) {
  .home-layout {
    justify-content: center;
    padding: 40px 24px;
  }
  .home-content {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }
  .home-desc { max-width: 100%; }
  .home-cta { align-self: center; }
  .home-links { justify-content: center; }
  .home-socials { justify-content: center; }
  .home-visuals { display: none; }
  #home-bg-visuals { display: none; }
  .home h1 { font-size: 2.6rem; }
}

@media (max-width: 420px) {
  .home h1 { font-size: 2.1rem; }
  .home-layout { padding: 24px 16px; }
  .home-cta { padding: 13px 26px; font-size: 0.95rem; }
  .home-link { padding: 8px 12px; font-size: 0.78rem; }
}

/*  Light scheme  */

.light-scheme .home-link {
  background: color-mix(in srgb, var(--surface, #f7f7f8) 70%, rgba(0,0,0,0.02));
  border-color: rgba(0,0,0,0.06);
  color: var(--text, #111);
}

.light-scheme .home-link:hover {
  border-color: color-mix(in srgb, var(--primary, #d4550a) 20%, rgba(0,0,0,0.08));
  background: color-mix(in srgb, var(--primary, #d4550a) 5%, rgba(255,255,255,0.8));
}

.light-scheme .home-social-link.tt {
  color: var(--text, #111);
}
.light-scheme .home-social-link.tt:hover {
  background: rgba(0,0,0,0.06);
}

.light-scheme .home-card-inner {
  background: var(--surface, #f7f7f8);
}

.light-scheme .home-cta {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.light-scheme .home-link.vote { color: #16a34a; }
