:root {
  --bg-primary: #faf9f6;
  --bg-radial: #ffffff;
  --ink-primary: #141413;
  --ink-muted: #7d7a74;
  --card-surface: #ffffff;
  --card-border: rgba(20, 20, 19, 0.08);
  --card-border-hover: rgba(20, 20, 19, 0.2);
  --shadow-rest: 0 8px 24px -12px rgba(20, 20, 19, 0.08),
    0 2px 6px -1px rgba(20, 20, 19, 0.04);
  --shadow-hover: 0 22px 44px -16px rgba(20, 20, 19, 0.16),
    0 6px 16px -4px rgba(20, 20, 19, 0.07);
  --neon-cyan: #36d6e7;
  --neon-magenta: #e535a8;
  --neon-lime: #d4e83a;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --card-base-delay: 0ms;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  background-color: var(--bg-primary);
  background-image: radial-gradient(
    ellipse 75% 55% at 50% 20%,
    var(--bg-radial) 0%,
    var(--bg-primary) 72%
  );
  color: var(--ink-primary);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

.portal {
  min-height: 100dvh;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(16px, 3.2vh, 36px) clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2.5vh, 28px);
}

/* Desktop single-viewport lock */
@media (min-width: 769px) and (min-height: 620px) {
  body,
  .portal {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
}

/* ==========================================================================
   Hero Logo Stage
   ========================================================================== */

.hero {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: clamp(4px, 1vh, 14px);
}

.hero-stage {
  position: relative;
  width: clamp(200px, 28vh, 280px);
  aspect-ratio: 568 / 530;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--ease-smooth);
}

.hero-stage:hover {
  transform: scale(1.02);
}

.hero-stage:active {
  transform: scale(0.985);
}

.hero-stage:focus-visible {
  outline: 2px solid var(--ink-primary);
  outline-offset: 8px;
  border-radius: 16px;
}

.hero-motion-layer,
.hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-motion-layer {
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.hero-motion-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-svg {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.hero-stage.is-settled .hero-motion-layer {
  opacity: 0;
}

.hero-stage.is-settled .hero-svg {
  opacity: 1;
}

/* Subtle settled lens shimmer on vector SVG */
.hero-stage.is-settled .lens-glint {
  animation: lensGlint 6.5s ease-in-out infinite;
}

@keyframes lensGlint {
  0%,
  72%,
  100% {
    fill: url(#lensGrad);
  }
  78% {
    fill: #36d6e7;
  }
  84% {
    fill: #e535a8;
  }
  90% {
    fill: #64656e;
  }
}

/* ==========================================================================
   Channels Grid & Right-to-Left Staggered Slide Motion
   ========================================================================== */

.channels {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.cards-track {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.8vw, 34px);
  align-items: center;
}

.brand-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink-primary);
  opacity: 0;
  transform: translate3d(120px, 0, 0) scale(0.97);
  will-change: transform, opacity;
  outline: none;
}

.is-revealed .brand-card {
  animation: slideInRightToLeft 0.9s var(--ease-spring) forwards;
  animation-delay: calc(var(--card-base-delay) + var(--stagger, 0) * 160ms);
}

@keyframes slideInRightToLeft {
  0% {
    opacity: 0;
    transform: translate3d(120px, 0, 0) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background-color: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-rest);
  transition: transform 0.45s var(--ease-smooth),
    box-shadow 0.45s var(--ease-smooth),
    border-color 0.35s ease;
}

.card-media picture,
.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.65s var(--ease-smooth);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 0;
  gap: 8px;
}

.card-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.3s ease;
}

.card-arrow {
  font-size: 0.95rem;
  line-height: 1;
  color: var(--ink-muted);
  transform: translate3d(0, 0, 0);
  transition: transform 0.35s var(--ease-smooth), color 0.3s ease;
}

/* Interactive Card Hover & Focus */
.brand-card:hover .card-media,
.brand-card:focus-visible .card-media {
  transform: translate3d(0, -6px, 0);
  box-shadow: var(--shadow-hover);
  border-color: var(--card-border-hover);
}

.brand-card:hover .card-media img,
.brand-card:focus-visible .card-media img {
  transform: scale(1.04);
}

.brand-card:hover .card-title,
.brand-card:focus-visible .card-title {
  color: var(--ink-primary);
}

.brand-card:hover .card-arrow,
.brand-card:focus-visible .card-arrow {
  color: var(--ink-primary);
  transform: translate3d(3px, -3px, 0);
}

.brand-card:focus-visible .card-media {
  outline: 2px solid var(--ink-primary);
  outline-offset: 4px;
}

/* ==========================================================================
   Minimalist Footer
   ========================================================================== */

.site-footer {
  flex: 0 0 auto;
  padding-bottom: clamp(2px, 0.8vh, 8px);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0;
  transition: opacity 0.75s ease 0.55s;
}

.is-revealed .site-footer {
  opacity: 0.78;
}

/* ==========================================================================
   Mobile & Narrow Viewports (Touch Horizontal Swipe Carousel)
   ========================================================================== */

@media (max-width: 768px) {
  .portal {
    padding: 20px 0 24px;
    justify-content: space-between;
  }

  .hero {
    padding: 4px 20px 0;
  }

  .hero-stage {
    width: clamp(185px, 34vh, 240px);
  }

  .channels {
    width: 100%;
    align-items: center;
  }

  .cards-track {
    max-width: none;
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 12px 24px 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cards-track::-webkit-scrollbar {
    display: none;
  }

  .brand-card {
    flex: 0 0 72vw;
    max-width: 290px;
    scroll-snap-align: center;
  }

  .site-footer {
    padding: 0 20px;
  }
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .hero-motion-layer {
    display: none;
  }

  .hero-svg {
    opacity: 1;
  }

  .hero-stage.is-settled .lens-glint {
    animation: none;
  }

  .brand-card {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .site-footer {
    opacity: 0.78;
    transition: none;
  }

  .card-media,
  .card-media img,
  .card-arrow {
    transition: none;
  }
}
