/* === Homepage — Phantom-inspired landing page === */

/* Override Zensical/Material grid for homepage — break out of sidebar layout */
.md-main__inner:has(.home-hero) {
  max-width: none;
}

/* Hide sidebar only on desktop — keep it available as mobile drawer */
@media (min-width: 76.25em) {
  .md-main__inner:has(.home-hero) .md-sidebar {
    display: none;
  }
}

.md-main__inner:has(.home-hero) .md-content {
  max-width: none;
  margin: 0;
}

.md-content__inner:has(.home-hero) {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ── Hero ── */
.home-hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  animation: home-fadeIn 0.6s ease-out;
}

.home-hero--bg {
  max-width: none;
  padding: 6rem 2rem 4rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.home-hero--bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.home-hero--bg > * {
  position: relative;
  z-index: 1;
}

.home-hero--bg .home-title,
.home-hero--bg .home-subtitle {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.home-hero__logo {
  max-height: 100px;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.home-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--md-default-fg-color);
  line-height: 1.3;
}

.home-subtitle {
  font-size: 1.1rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.7;
  margin: 1rem auto 1.8rem;
  max-width: 640px;
}

/* ── Tags (pilules) ── */
.home-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}

.home-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: #585858;
  color: #fff;
}

.home-tag--small {
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  background: rgba(255, 255, 255, 0.25);
}

/* ── Buttons ── */
.home-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.home-btn--primary {
  background: #585858;
  color: #fff !important;
}

.home-btn--primary:hover {
  background: #333;
  color: #fff !important;
}

.home-btn--secondary {
  background: transparent;
  color: #585858 !important;
  border: 2px solid #585858;
}

.home-btn--secondary:hover {
  background: #585858;
  color: #fff !important;
}

/* ── Tiles (Phantom-style — negative margin grid) ── */
.home-tiles {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  margin: -1.5em 0 0 -1.5em;
  padding: 0;
  animation: home-fadeIn 0.6s ease-out 0.15s both;
}

/* Wrapper to give tiles padding context */
.home-tiles-wrapper {
  max-width: 1400px;
  margin: 2em auto 3em;
  padding: 0 2rem;
}

.home-tile {
  transition: transform 0.5s ease, opacity 0.5s ease;
  position: relative;
  flex: 1 1 300px;
  max-width: calc(50% - 1.5em);
  margin: 1.5em 0 0 1.5em;
  border-radius: 4px;
  overflow: hidden;
}

/* Image container */
.home-tile__image {
  transition: transform 0.5s ease;
  position: relative;
  display: block;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
}

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

/* Colored overlay */
.home-tile__image::before {
  pointer-events: none;
  transition: background-color 0.5s ease, opacity 0.5s ease;
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  z-index: 1;
}

/* Placeholder (no image) — colored block, same height as images */
.home-tile__image--placeholder {
  display: block;
  width: 100%;
  height: 280px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.home-tile__image--placeholder::before {
  pointer-events: none;
  transition: background-color 0.5s ease, opacity 0.5s ease;
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  z-index: 1;
}

/* Text overlay */
.home-tile > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.5s ease, transform 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1em;
  border-radius: 4px;
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  z-index: 3;
}

.home-tile > a:hover {
  color: #fff !important;
}

.home-tile > a h2 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
}

.home-tile__content {
  transition: max-height 0.5s ease, opacity 0.5s ease;
  width: 100%;
  max-height: 0;
  line-height: 1.5;
  margin-top: 0.35em;
  opacity: 0;
  overflow: hidden;
}

.home-tile__content p {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.home-tile__tags {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ── 6 color variants (Phantom palette) ── */
.home-tile.style1 .home-tile__image::before,
.home-tile.style1 .home-tile__image--placeholder::before { background-color: #f2849e; }
.home-tile.style2 .home-tile__image::before,
.home-tile.style2 .home-tile__image--placeholder::before { background-color: #7ecaf6; }
.home-tile.style3 .home-tile__image::before,
.home-tile.style3 .home-tile__image--placeholder::before { background-color: #7bd0c1; }
.home-tile.style4 .home-tile__image::before,
.home-tile.style4 .home-tile__image--placeholder::before { background-color: #c75b9b; }
.home-tile.style5 .home-tile__image::before,
.home-tile.style5 .home-tile__image--placeholder::before { background-color: #ae85ca; }
.home-tile.style6 .home-tile__image::before,
.home-tile.style6 .home-tile__image--placeholder::before { background-color: #8499e7; }

/* ── Hover effects (desktop only) ── */
@media (hover: hover) {
  .home-tile:hover .home-tile__image {
    transform: scale(1.1);
  }

  .home-tile:hover .home-tile__image::before,
  .home-tile:hover .home-tile__image--placeholder::before {
    background-color: #333 !important;
    opacity: 0.6;
  }

  .home-tile:hover .home-tile__content {
    max-height: 15em;
    opacity: 1;
  }
}

/* Touch / mobile: text always visible */
@media (hover: none) {
  .home-tile__content {
    max-height: 15em;
    opacity: 1;
  }

  .home-tile > a {
    background: rgba(0, 0, 0, 0.1);
  }
}

/* ── Navigation sections ── */
.home-nav-sections {
  max-width: 1400px;
  margin: 0 auto 4rem;
  padding: 2rem 2rem;
  animation: home-fadeIn 0.6s ease-out 0.3s both;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.home-nav-sections__title {
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--md-default-fg-color--light);
}

.home-nav-sections__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.home-nav-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.8rem;
}

.home-nav-section h3 a {
  color: var(--md-default-fg-color);
  text-decoration: none;
  border-bottom: 2px solid rgba(88, 88, 88, 0.3);
  padding-bottom: 0.25rem;
  transition: border-color 0.2s ease;
}

.home-nav-section h3 a:hover {
  border-color: #585858;
}

.home-nav-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-nav-section ul li {
  padding: 0.35rem 0;
}

.home-nav-section ul li a {
  color: var(--md-default-fg-color--light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.home-nav-section ul li a:hover {
  color: var(--md-default-fg-color);
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .home-tile {
    max-width: calc(50% - 1.5em);
  }
}

@media (max-width: 600px) {
  .home-tiles {
    margin: 0;
  }

  .home-tile {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 1.25em 0 0 0;
  }

  .home-title {
    font-size: 1.8rem;
  }

  .home-hero {
    padding: 2rem 1rem 1rem;
  }

  .home-tiles-wrapper {
    padding: 0 1rem;
  }
}

/* ── Iframe embed ── */
.iframe-embed {
  margin: 2rem 0;
}

.iframe-embed iframe {
  border: none;
  border-radius: 8px;
}

/* ── Animation ── */
@keyframes home-fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Dark mode ── */
[data-md-color-scheme="slate"] .home-tag {
  background: rgba(255, 255, 255, 0.15);
}

[data-md-color-scheme="slate"] .home-tile__image::before {
  opacity: 0.8;
}

[data-md-color-scheme="slate"] .home-btn--primary {
  background: #e0e0e0;
  color: #1a1a1a;
}

[data-md-color-scheme="slate"] .home-btn--primary:hover {
  background: #fff;
}

[data-md-color-scheme="slate"] .home-btn--secondary {
  color: #e0e0e0;
  border-color: #e0e0e0;
}

[data-md-color-scheme="slate"] .home-btn--secondary:hover {
  background: #e0e0e0;
  color: #1a1a1a;
}

[data-md-color-scheme="slate"] .home-btn:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-md-color-scheme="slate"] .home-nav-sections {
  border-top-color: rgba(255, 255, 255, 0.08);
}
