/* Public homepage (/) */

.home-page {
  max-width: 1120px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem 1rem;
}

/* Quiet paper texture behind the whole home surface (incl. hero + mosaic) */
body.page-home {
  background-color: #f8fafc;
  background-image:
    radial-gradient(rgba(15, 23, 42, 0.045) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  background-attachment: fixed;
}

body.page-home .site-announce-stack {
  text-align: center;
}
body.page-home .site-announce--high {
  display: inline-block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Hero */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.5rem 2rem;
  align-items: center;
  padding: 2.25rem 0 1.75rem;
  overflow: hidden;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
}

.home-brand {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 4.5vw, 2.55rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.15;
}

.home-lead {
  margin: 0 0 0.85rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
  line-height: 1.55;
  color: #334155;
}

.home-lead strong {
  color: #0f172a;
}

.home-sub {
  margin: 0 0 1rem;
  max-width: 34rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #64748b;
}

.home-sub a {
  color: #1e40af;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-register {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

.home-register a {
  color: #1e40af;
  font-weight: 650;
  text-decoration: none;
}

.home-register a:hover {
  text-decoration: underline;
}

.home-hero-visual {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.home-polar-accent {
  position: absolute;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
}

.home-polar-accent img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-polar-accent--a {
  width: min(78%, 320px);
  aspect-ratio: 1;
  top: 4%;
  right: 8%;
  opacity: 0.92;
  transform: rotate(3deg);
  z-index: 1;
}

.home-polar-accent--b {
  width: min(62%, 250px);
  aspect-ratio: 1;
  bottom: 2%;
  left: 4%;
  opacity: 0.78;
  transform: rotate(-6deg);
  z-index: 0;
}

/* Mosaic */
.home-mosaic-section {
  margin: 0.5rem 0 1.75rem;
}

.home-mosaic-lead {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  color: #475569;
  font-weight: 600;
}

.home-mosaic {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.65rem;
  align-items: start;
}

.home-tile {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  margin: 0; /* kill UA <figure> margins — these were the large gutters */
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-tile:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.home-tile--wide {
  grid-column: span 6;
}

.home-tile--tall {
  grid-column: span 4;
}

.home-tile-media {
  position: relative;
  background: #fff;
  overflow: hidden;
}

/* Graph stills: white ground, flush to the tile edge */
.home-tile--graph .home-tile-media {
  aspect-ratio: auto;
  padding: 0;
  background: #fff;
}

.home-tile--graph .home-tile-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  border: 0;
}

/* UI / GIF tiles: white media, minimal inset */
.home-tile--ui .home-tile-media,
.home-tile--wide .home-tile-media {
  aspect-ratio: auto;
  padding: 0;
  background: #fff;
}

.home-tile--ui .home-tile-media img,
.home-tile--wide .home-tile-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  padding: 0.2rem 0.25rem 0.1rem;
  box-sizing: border-box;
}

.home-tile-label {
  margin: 0;
  padding: 0.55rem 0.7rem 0.6rem;
  border-top: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.home-tile-title {
  display: block;
  position: relative;
  margin: 0 0 0.45rem;
  padding-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.25;
}

.home-tile-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1.75rem;
  height: 2px;
  border-radius: 1px;
  background: #2563eb;
}

.home-tile-desc {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: #64748b;
}

/* Focus lock note */
.home-focus-note {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Steps */
.home-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin: 0 0 2rem;
}

.home-step {
  padding: 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.home-step h2 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: #0f172a;
}

.home-step p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #64748b;
}

.home-footer {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
}

.home-footer a {
  color: #1e293b;
  font-weight: 650;
  text-decoration: none;
}

.home-footer a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.home-footer-sep {
  margin: 0 0.75rem;
  color: #cbd5e1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .home-tile-media img[data-motion="gif"] {
    /* Swap handled in template via <picture> / dual sources when present;
       also pause animated GIFs by preferring still if browser supports. */
    content: unset;
  }
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
  }
  .home-hero-visual {
    min-height: 180px;
    order: -1;
    opacity: 0.95;
  }
  .home-polar-accent--a {
    width: 56%;
    right: 6%;
  }
  .home-polar-accent--b {
    width: 44%;
    left: 8%;
  }
  .home-tile,
  .home-tile--wide,
  .home-tile--tall {
    grid-column: span 6;
  }
  .home-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .home-hero-visual {
    display: none;
  }
  .home-tile,
  .home-tile--wide,
  .home-tile--tall {
    grid-column: span 12;
  }
}
