/* ==========================================================================
   Signal8 Games — Home Page Styles (home.css)
   ==========================================================================
   Page-specific layout and component styles for the home page.
   Relies on css/base.css for design tokens, reset, and typography.

   Decisions referenced:
     D-01: Full-viewport hero (100svh)
     D-02: Solid navy background
     D-03: Social icons in hero below tagline
     D-04: Section order: About > Games > Contact > Footer
     D-05: About section short blurb
     D-06: Games "Coming Soon" placeholder
     D-07: Minimal footer (copyright + social icons)
   ========================================================================== */

/* ==========================================================================
   Section 1: Navigation Bar (D-01, NAV-01)
   --------------------------------------------------------------------------
   Fixed navigation with backdrop blur. Hamburger toggle visible on mobile,
   inline links on desktop. 64px height provides consistent scroll offset.
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 50;
  background: rgba(15, 23, 42, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 16px;
}

@supports not (backdrop-filter: blur(8px)) {
  .nav {
    background: var(--color-bg);
  }
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo picture {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: none;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-base);
  padding: 12px 8px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  text-underline-offset: 4px;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.nav-links a:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 8px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
}

.nav-toggle__line {
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-toggle__line {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line--top {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line--mid {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line--bot {
  transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Section 2: Hero (D-01, D-02, D-03)
   --------------------------------------------------------------------------
   Full-viewport hero with centered logo, tagline, and social icons.
   Solid navy background per D-02. 100svh with 100vh fallback.
   ========================================================================== */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  scroll-margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 64px 16px;
  background-color: var(--color-bg);
  position: relative;
  text-align: center;
}

.hero__title {
  font-size: var(--text-h1);
  font-family: var(--font-heading);
  margin: 0;
}

.hero__logo {
  max-width: 280px;
}

.hero__logo img {
  width: 100%;
  height: auto;
}

.hero__tagline {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin: 0;
  max-width: 480px;
}

.hero__social {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-primary);
}

/* ==========================================================================
   Section 3: Social Links (SOCL-01, A11Y-03, RESP-02)
   --------------------------------------------------------------------------
   Shared social link component used in both hero and footer.
   48px touch target wrapping 24px icon for WCAG 2.2 compliance.
   Monochrome default (text-muted) with cyan hover per UI-SPEC.
   ========================================================================== */

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  border-radius: 8px;
  text-decoration: none;
}

.social-link:hover {
  color: var(--color-primary);
}

.social-link:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
  color: var(--color-primary);
}

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

@media (prefers-reduced-motion: no-preference) {
  .social-link {
    transition: color 0.2s ease, transform 0.2s ease;
  }

  .social-link:hover {
    transform: scale(1.1);
  }
}

/* ==========================================================================
   Section 4: Content Sections (D-04, D-05, D-06)
   --------------------------------------------------------------------------
   Shared section layout for About, Games, and Contact.
   Max-width 720px content, centered. Scroll-margin-top for fixed nav offset.
   Alternating backgrounds: surface for About/Contact, bg for Games.
   ========================================================================== */

.section {
  padding: 48px 16px;
  scroll-margin-top: 80px;
}

.section__content {
  max-width: 720px;
  margin-inline: auto;
}

.section__content h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.section__content p {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--color-text);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.section--surface {
  background-color: var(--color-surface);
}

/* ==========================================================================
   Section 4b: Game Card (D-01, HOME-02, HOME-03, HOME-04)
   --------------------------------------------------------------------------
   Horizontal game card component. Entire card is an anchor element for
   full-surface click target. Icon left, text+badge right per D-01.
   ========================================================================== */

.game-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.game-card:hover {
  border-color: var(--color-primary);
}

.game-card:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .game-card {
    transition: border-color 0.2s ease;
  }
}

.game-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
  object-fit: cover;
}

.game-card__body {
  min-width: 0;
}

.game-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.game-card__name {
  font-size: var(--text-h4);
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

.game-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  background: var(--brand-orchid);
  color: var(--brand-white);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}

.game-card__description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 4px 0 0 0;
  line-height: 1.6;
}

/* ==========================================================================
   Section 5: Contact (SOCL-02)
   --------------------------------------------------------------------------
   Email mailto: link with icon. Styled as inline-flex for icon+text alignment.
   48px minimum height for touch target compliance.
   ========================================================================== */

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--text-base);
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 8px;
}

.contact-link:hover {
  text-decoration: underline;
  color: var(--color-primary-hover);
}

.contact-link:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
}

.contact-link svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Section 6: Footer (D-07)
   --------------------------------------------------------------------------
   Minimal footer with copyright and repeated social icons.
   Stacked on mobile (flex column), row on desktop (flex row space-between).
   ========================================================================== */

.footer {
  padding: 24px 16px;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer__copyright {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
}

.footer__social {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   Section 7: Scroll Indicator Animation
   --------------------------------------------------------------------------
   Bouncing chevron at the bottom of the hero section. Animation only runs
   when the user has not requested reduced motion.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .hero__scroll-indicator {
    animation: bounce 1.5s infinite ease-in-out;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ==========================================================================
   Section 8: Mobile Menu Overlay (NAV-01)
   --------------------------------------------------------------------------
   Full-screen overlay menu for mobile navigation. Hidden by default via
   the HTML hidden attribute. Scroll lock via html.menu-open class.
   ========================================================================== */

.nav-menu[hidden] {
  display: none;
}

.nav-menu {
  position: fixed;
  inset: 0;
  top: 64px;
  background: var(--color-bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  overscroll-behavior: contain;
}

.nav-menu a {
  font-size: var(--text-h3);
  font-family: var(--font-heading);
  color: var(--color-text);
  text-decoration: none;
  padding: 16px 32px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.nav-menu a:hover {
  color: var(--color-primary);
}

.nav-menu a:focus-visible {
  outline: 2px solid var(--color-primary-focus);
  outline-offset: 2px;
}

html.menu-open,
html.menu-open body {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-menu:not([hidden]) {
    animation: fadeIn 0.2s ease;
  }
}

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

/* ==========================================================================
   Section 9: Desktop Breakpoint (min-width: 768px)
   --------------------------------------------------------------------------
   Desktop layout adjustments. Nav links visible, hamburger hidden,
   hero logo larger, sections get more padding, footer becomes row layout.
   ========================================================================== */

@media (min-width: 768px) {
  .hero__logo {
    max-width: 400px;
  }

  .section {
    padding: 64px 32px;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .nav-menu {
    display: none !important;
  }

  .footer {
    flex-direction: row;
    justify-content: space-between;
  }
}
