/* ==========================================================================
   Shared Components — Header, Footer, Sections, Cards
   Consumes design-system.css tokens. No hardcoded values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Site Header — Sticky with backdrop-blur
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(13, 13, 13, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--screen-padding);
}

/* Logo */
.header-logo {
  font-size: var(--text-heading-medium);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-logo .logo-accent {
  color: var(--color-purple);
}

/* Desktop nav links */
.header-nav {
  display: none;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-body-medium);
  font-weight: var(--font-weight-medium);
  transition: color 0.15s ease;
}

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

/* Header CTA — always visible */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Hamburger — mobile only */
.header-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: var(--min-touch-target);
  height: var(--min-touch-target);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header-hamburger .hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  position: relative;
}

.header-hamburger .hamburger-line::before,
.header-hamburger .hamburger-line::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 1px;
  position: absolute;
  left: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.header-hamburger .hamburger-line::before {
  top: -7px;
}

.header-hamburger .hamburger-line::after {
  top: 7px;
}

/* Hamburger open state — X shape */
.header-hamburger[aria-expanded="true"] .hamburger-line {
  background: transparent;
}

.header-hamburger[aria-expanded="true"] .hamburger-line::before {
  top: 0;
  transform: rotate(45deg);
}

.header-hamburger[aria-expanded="true"] .hamburger-line::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile menu — slides down from header */
.header-nav.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) var(--screen-padding);
  gap: var(--space-md);
  z-index: 99;
}

.header-nav.is-open a {
  font-size: var(--text-body-large);
  padding: var(--space-sm) 0;
}

/* Desktop breakpoint (lg) */
@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }

  .header-hamburger {
    display: none;
  }

  /* Prevent mobile menu styles on desktop */
  .header-nav.is-open {
    position: static;
    flex-direction: row;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: none;
    padding: 0;
    gap: var(--space-lg);
  }

  .header-nav.is-open a {
    font-size: var(--text-body-medium);
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: transparent;
  border-top: 1px solid var(--color-border);
  padding: var(--space-xxxl) 0 var(--space-lg);
}

.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--screen-padding);
}

/* Footer top — brand + social row */
.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .footer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-top-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: var(--space-xl);
}

/* Footer main grid — link columns */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1280px) {
  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-xl) var(--space-lg);
  }
}

/* Footer social links */
.footer-social {
  display: flex;
  gap: var(--space-sm);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--corner-radius-sm);
  color: var(--color-text-tertiary);
  background: var(--color-surface-elevated);
  transition: color 0.2s ease, background 0.2s ease;
}

.footer-social a:hover {
  color: var(--color-accent);
  background: var(--color-surface);
}

/* Footer brand */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-brand .footer-logo {
  font-size: var(--text-heading-medium);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.footer-brand .footer-tagline {
  font-size: var(--text-body-medium);
  color: var(--color-text-secondary);
  line-height: var(--text-body-medium-lh);
  max-width: 380px;
  margin: 0;
}

/* Footer link columns */
.footer-links h3 {
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-md);
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-body-small);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-text-primary);
}

/* Social icons row */
.footer-social {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--min-touch-target);
  height: var(--min-touch-target);
  border-radius: var(--corner-radius-sm);
  color: var(--color-text-tertiary);
  text-decoration: none;
  font-size: var(--text-body-large);
  transition: color 0.15s ease, background 0.15s ease;
}

.footer-social a:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-elevated);
}

/* Footer bottom bar */
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xxl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-body-small);
  color: var(--color-text-tertiary);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-md);
}

.footer-bottom-links a {
  color: var(--color-text-tertiary);
  text-decoration: none;
  font-size: var(--text-body-small);
  transition: color 0.15s ease;
}

.footer-bottom-links a:hover {
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Sections — Layout patterns with alternating backgrounds
   -------------------------------------------------------------------------- */

.section {
  padding: var(--space-xxxl) 0;
}

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

.section-alt {
  background: rgba(255, 255, 255, 0.02);
}

.section-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--screen-padding);
}

/* Section header — centered heading + subtitle */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xxl);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: var(--text-display-medium);
  line-height: var(--text-display-medium-lh);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-md);
}

.section-header .text-accent-purple {
  color: var(--color-purple);
}

.section-header p {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* Responsive section header typography */
.section-header h2 {
  font-size: 24px;
  line-height: 32px;
}

@media (min-width: 768px) {
  .section-header h2 {
    font-size: 28px;
    line-height: 36px;
  }
}

@media (min-width: 1024px) {
  .section-header h2 {
    font-size: var(--text-display-medium);
    line-height: var(--text-display-medium-lh);
  }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: transparent;
  border-radius: var(--corner-radius-lg);
  border: none;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

/* Card image area — placeholder with shimmer gradient */
.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--corner-radius) var(--corner-radius) 0 0;
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    var(--color-surface-elevated) 50%,
    var(--color-surface) 100%
  );
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-body-small);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* Card body */
.card-body {
  padding: var(--space-lg);
}

.card-body h3 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-xs);
}

.card-body p {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-secondary);
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  font-size: var(--text-body-small);
  color: var(--color-text-tertiary);
}

/* Card grid — responsive */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Feature Card — Centered icon + text, no image
   -------------------------------------------------------------------------- */

.feature-card {
  background: transparent;
  border-radius: var(--corner-radius-lg);
  border: none;
  padding: var(--space-xl);
  text-align: center;
  transition: transform 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--corner-radius);
  background: var(--color-surface-elevated);
  font-size: var(--text-heading-large);
}

.feature-card h3 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-xs);
}

.feature-card p {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-secondary);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Stat Card — Large number + label for social proof
   -------------------------------------------------------------------------- */

.stat-card {
  background: transparent;
  border-radius: var(--corner-radius-lg);
  border: none;
  padding: var(--space-xl);
  text-align: center;
}

.stat-card .stat-number {
  font-size: var(--text-display-large);
  line-height: var(--text-display-large-lh);
  font-weight: var(--font-weight-bold);
  color: var(--color-purple);
  margin: 0 0 var(--space-xs);
}

.stat-card .stat-label {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-secondary);
  margin: 0;
}

/* Stat card responsive number size */
.stat-card .stat-number {
  font-size: 28px;
  line-height: 36px;
}

@media (min-width: 768px) {
  .stat-card .stat-number {
    font-size: 34px;
    line-height: 42px;
  }
}

@media (min-width: 1024px) {
  .stat-card .stat-number {
    font-size: var(--text-display-large);
    line-height: var(--text-display-large-lh);
  }
}
