/* =====================================================================
   Calyxis — Responsive Hero
   Inspired by "Hero appearance - CSS Only" (codepen.io/bvg-studio/pen/vYjoxEK)
   Techniques retained: stacked CSS-grid layers, ken-burns zoom, clip-path
   reveal, staggered fade-in, color-overlay via ::before.
   Improvements: fluid clamp() sizing, svh units, no horizontal overflow,
   media-query fine-tuning, reduced-motion support, focus a11y.
   ===================================================================== */

:root {
  --hero-color: #ffffff;
  --hero-overlay: rgba(41, 4, 47, 0.45);
  --hero-accent: #c9a8ff;
  --hero-height: 100svh;
  --hero-min-height: 480px;
  --hero-reveal: 1.25s cubic-bezier(0.29, 0.8, 0.8, 0.98);
  --hero-zoom: 4s 0.25s cubic-bezier(0, 0.71, 0.4, 0.97) forwards;
}

/* ---- Borda typeface ----------------------------------------------- */
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda DemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Borda";
  src: url("./borda/Borda Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Borda", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* prevent the 100vw width from triggering a horizontal scrollbar */
  overflow-x: hidden;
}

.hero {
  display: grid;
  position: relative;
  grid-template-columns: 100%;
  grid-template-rows: var(--hero-height);
  min-height: var(--hero-min-height);
  place-items: center;
  overflow: hidden;
  animation: clip-hero-anim var(--hero-reveal);
  will-change: clip-path;
}

.hero__bg,
.hero__cnt {
  align-self: center;
  justify-self: center;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

/* ---- Background layer --------------------------------------------- */
.hero__bg {
  display: grid;
  position: relative;
  z-index: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  width: 100%;
  height: 100%;
  animation: fade-in 0.75s linear;
  will-change: opacity;
}

/* Color/contrast overlay so white text always stays legible */
.hero__bg::before {
  content: "";
  display: block;
  position: absolute;
  z-index: 5;
  inset: -10%;
  background: linear-gradient(
      180deg,
      rgba(20, 0, 26, 0.35) 0%,
      var(--hero-overlay) 55%,
      rgba(20, 0, 26, 0.6) 100%
    ),
    radial-gradient(circle at 30% 40%, rgba(120, 60, 200, 0.25), transparent 60%);
  background-blend-mode: screen, normal;
}

.hero__bg picture {
  display: flex;
  width: 100%;
  height: 100%;
  animation: scaling-hero-anim var(--hero-zoom);
  will-change: transform;
}

.hero__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 77% 50%;
}

/* ---- Content layer ------------------------------------------------ */
.hero__cnt {
  display: grid;
  position: relative;
  place-items: center;
  gap: clamp(0.5rem, 1.5vw, 1.25rem);
  z-index: 10;
  padding: 0 1.25rem;
  color: var(--hero-color);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0;
  animation: fade-in 0.75s 1.5s linear forwards;
}

.hero__mark {
  height: clamp(3.5rem, 12vw, 9rem);
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.hero__title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 5.5rem);
  line-height: 1;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.hero__tagline {
  margin: 0;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: clamp(0.95rem, 2.2vw, 1.4rem);
  color: var(--hero-accent);
  max-width: 32ch;
}

/* ---- Responsive tweaks -------------------------------------------- */

/* Taller logos / tighter layout on short landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --hero-height: 100svh;
  }
  .hero__mark {
    height: clamp(2.5rem, 9vh, 4rem);
  }
  .hero__title {
    font-size: clamp(1.5rem, 6vh, 2.5rem);
  }
}

/* Re-center the focal point on narrow screens */
@media (max-width: 640px) {
  .hero__bg img {
    object-position: 50% 35%;
  }
  .hero__tagline {
    max-width: 90%;
  }
}

/* On very wide displays, cap the content width so text doesn't sprawl */
@media (min-width: 1400px) {
  .hero__cnt {
    max-width: 60rem;
  }
}

/* ---- Keyframes ---------------------------------------------------- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaling-hero-anim {
  from {
    transform: scale(1.25);
  }
  to {
    transform: scale(1.1);
  }
}

@keyframes clip-hero-anim {
  from {
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
  }
  to {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* ---- Accessibility: respect reduced-motion preference ------------- */
@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero__bg,
  .hero__bg picture,
  .hero__cnt {
    animation: none;
  }
  .hero__cnt {
    opacity: 1;
  }
  .hero__bg picture {
    transform: scale(1.1);
  }
  .hero {
    clip-path: none;
  }
}
