/* Home page: Bootstrap-free, design tokens only (docs/adr/0002). */

/* Bootstrap reboot (body { margin: 0 }) is not loaded here, so reset the
   browser-default body margin ourselves; otherwise the white html background
   shows as an 8px frame around the page. */
body {
  margin: 0;
}

.home {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home *,
.home *::before,
.home *::after {
  box-sizing: inherit;
}

/* --- Hero ----------------------------------------------------------------- */

.home-hero {
  align-items: center;
  background-image:
    linear-gradient(rgba(15, 18, 26, 0.55), rgba(15, 18, 26, 0.8)),
    url("/static/images/goettin_des_spiels.c9ee1b44a7b0.jpg");
  background-position: top;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--color-text-inverse);
  display: flex;
  min-height: 60vh;
  padding: var(--space-10) var(--container-gutter);
  text-align: center;
}

.home-hero-inner {
  margin-inline: auto;
  max-width: 52rem;
}

.home-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(var(--text-3xl), 6vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
}

.home-hero-lead {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-6);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.home-btn-primary,
.home-btn-ghost {
  border-radius: var(--radius);
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.home-btn-primary {
  background-color: var(--color-brand);
  color: var(--color-text-inverse);
}

.home-btn-primary:hover {
  background-color: var(--color-brand-hover);
  color: var(--color-text-inverse);
}

.home-btn-ghost {
  border: 1px solid color-mix(in srgb, var(--color-text-inverse) 60%, transparent);
  color: var(--color-text-inverse);
}

.home-btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.home-btn-primary:focus-visible,
.home-btn-ghost:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.home-ext-icon {
  margin-left: var(--space-1);
  vertical-align: -0.125em;
}

/* Have a look: taller card images to show more of each picture. */
.home-section-look .home-card-img {
  height: 240px;
}

.home-section-look .home-card-rotator {
  height: 240px;
}

/* --- Sections -------------------------------------------------------------- */

.home-section {
  padding-block: var(--space-10);
}

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

.home-container {
  margin-inline: auto;
  max-width: var(--container-max);
  padding-inline: var(--container-gutter);
}

.home-section h2 {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-6);
}

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

.home-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-card {
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

a.home-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.home-card-img {
  display: block;
  height: 180px;
  object-fit: cover;
  width: 100%;
}

/* Flamme Rouge impressions: pure-CSS rotation. One frame at a time, ~4s per
   frame with soft crossfades; the 92-100% fade-in smooths the loop seam.
   Under prefers-reduced-motion the global token rule stops the animations,
   so the :first-child base opacity keeps frame 1 visible statically. */
.home-card-rotator {
  height: 180px;
  position: relative;
}

.home-card-frame {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.home-card-frame:first-child {
  opacity: 1;
}

.home-card-frame:nth-child(1) {
  animation: home-rotate 12s infinite;
}

.home-card-frame:nth-child(2) {
  animation: home-rotate 12s infinite 4s;
}

.home-card-frame:nth-child(3) {
  animation: home-rotate 12s infinite 8s;
}

@keyframes home-rotate {
  0%,
  28% {
    opacity: 1;
  }
  36%,
  92% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.home-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.home-card-body h3 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin: 0;
}

.home-card-body p {
  color: var(--color-text-soft);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin: 0;
}

/* --- Small links and about teaser ------------------------------------------ */

.home-more {
  margin-block-start: var(--space-6);
}

.home-more a,
.home-about a {
  color: var(--color-link);
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.home-more a:hover,
.home-about a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.home-about {
  max-width: 46rem;
}

.home-about p {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}