/* ========================================
   LAYOUT.CSS — Header, footer, grid, responsiivisuus
   ======================================== */

/* ---------- GRID APU ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Character grid — 1 sarake, keskitetty */
.character-grid {
  grid-template-columns: 1fr;
  justify-items: center;
}

/* ---------- FOOTER ---------- */
.footer {
  background: linear-gradient(180deg, var(--bg-body) 0%, var(--bg-deep) 100%);
  color: var(--text-muted);
  padding-block: 60px 30px;
  position: relative;
  overflow: hidden;
  animation: footerHue 30s ease-in-out infinite alternate;
}

/* Hienovarainen footer-lonkeroiden värin liuku */
@keyframes footerHue {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(8deg); }
  100% { filter: hue-rotate(0deg); }
}

/* Maa-efekti — footerin juuret uppoavat syvemmälle */
.footer .footer-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(0deg, rgba(13, 10, 15, 0.6) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  animation: footerGround 8s ease-in-out infinite alternate;
}

@keyframes footerGround {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* Footer-lonkerot (himmeät, hengittävät) */
.footer::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: radial-gradient(ellipse at 20% 100%, var(--gold-dim) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 100%, var(--teal-dim) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 100%, var(--magenta-dim) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0.5;
  animation: footerGlow 12s ease-in-out infinite alternate;
}

/* Toinen kerros — syvyyttä ja värien liikettä */
.footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse at 70% 100%, var(--gold-dim-2) 0%, transparent 40%),
              radial-gradient(ellipse at 30% 100%, var(--teal-dim-2) 0%, transparent 40%);
  pointer-events: none;
  opacity: 0.3;
  animation: footerGlow2 15s ease-in-out infinite alternate;
}

@keyframes footerGlow {
  0%   { opacity: 0.25; transform: scaleY(1); }
  50%  { opacity: 0.5; transform: scaleY(1.15); }
  100% { opacity: 0.3; transform: scaleY(0.9); }
}

@keyframes footerGlow2 {
  0%   { opacity: 0.15; transform: scaleY(0.8) translateX(-5%); }
  50%  { opacity: 0.35; transform: scaleY(1.1) translateX(5%); }
  100% { opacity: 0.2; transform: scaleY(0.9) translateX(-2%); }
}

.footer .container {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-block-end: 10px;
}

.footer-brand {
  grid-column: 1;
}

.footer-logo {
  font-family: var(--ff-oxanium);
  font-size: 2.4rem;
  font-weight: var(--fw-800);
  color: var(--text-primary);
  margin-block-end: 12px;
  transition: color var(--transition), text-shadow var(--transition);
}

.footer-logo:hover {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 168, 67, 0.3), 0 0 40px rgba(212, 168, 67, 0.1), 0 0 0 2px rgba(180, 74, 138, 0.06);
}

.footer-desc {
  font-size: var(--fs-small);
  line-height: 1.6;
  margin-block-end: 20px;
  max-width: 35ch;
}

.footer-heading {
  font-family: var(--ff-oxanium);
  font-size: var(--fs-small);
  font-weight: var(--fw-700);
  text-transform: uppercase;
  color: var(--text-primary);
  margin-block-end: 16px;
  letter-spacing: 0.5px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  font-size: var(--fs-small);
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(212, 168, 67, 0.2);
}

/* Some-linkit — hehkuvia valopisteitä */
.social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition);
  border: 1px solid rgba(212, 168, 67, 0.22);
  box-shadow: 0 0 15px rgba(212, 168, 67, 0.15), 0 0 30px rgba(212, 168, 67, 0.06), 0 0 0 0 rgba(212, 168, 67, 0);
}

/* Stagger-viive — valot syttyvät yksi kerrallaan hoverissa */
.social-links:hover .social-link:nth-child(1) { transition-delay: 0s; }
.social-links:hover .social-link:nth-child(2) { transition-delay: 0.05s; }
.social-links:hover .social-link:nth-child(3) { transition-delay: 0.1s; }
.social-links:hover .social-link:nth-child(4) { transition-delay: 0.15s; }
.social-links:hover .social-link:nth-child(5) { transition-delay: 0.2s; }

.social-link:hover {
  color: var(--text-primary);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.4), 0 0 60px rgba(212, 168, 67, 0.15), 0 0 100px rgba(212, 168, 67, 0.05), 0 0 0 2px rgba(212, 168, 67, 0.1);
  transform: translateY(-3px) scale(1.15);
}

/* Yhteystiedot */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-small);
}

.contact-icon {
  color: var(--gold);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.contact-item a:hover {
  color: var(--gold);
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-block-start: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: var(--fs-tiny);
}

.copyright {
  color: var(--text-muted);
}

.copyright a {
  color: var(--gold);
  display: inline;
  transition: color var(--transition), text-shadow var(--transition);
}

.copyright a:hover {
  color: var(--gold-hover);
  text-shadow: 0 0 12px rgba(212, 168, 67, 0.3);
}

/* ---------- NOSCRIPT ---------- */
/* Yhteinen varoitus ilman JS:ää (katalogit, varaussivu) */
.noscript-warning {
  background: rgba(180, 74, 138, 0.15);
  border: 1px solid var(--magenta-soft);
  padding: 1.4rem;
  text-align: center;
  border-radius: var(--radius);
  margin: 2rem 0;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  font-family: var(--ff-inter);
}

/* ---------- RESPONSIIVISUUS ---------- */

/* 576px+ */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

/* 768px+ */
@media (min-width: 768px) {
  .container { max-width: 720px; }
}

/* 992px+ */
@media (min-width: 992px) {
  .container { max-width: 960px; }
}

/* 1200px+ */
@media (min-width: 1200px) {
  .container { max-width: var(--max-width); }
}

/* Footer responsive */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
