:root {
  --hero-gradient-top: rgba(19, 182, 255, 0.6);
  --hero-gradient-mid: rgba(82, 143, 255, 0.28);
  --hero-gradient-bottom: rgba(255, 255, 255, 0.15);
  --hero-text-start: #8ca4ff;
  --hero-text-end: #1f5fff;
  --cta-start: #2467ff;
  --cta-mid: #5f8dff;
  --cta-end: rgba(255, 255, 255, 0.9);
  --title-scale: 1;
  --morph-shimmer-pos: 120%;
  --overlay-progress: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Cal Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background-image:
    linear-gradient(180deg, var(--hero-gradient-top) 0%, var(--hero-gradient-mid) 30%, var(--hero-gradient-bottom) 54%, rgba(27, 93, 177, 0.26) 100%),
    url("./assets/clou_stan_hero.jpeg");
  background-size: cover, cover;
  background-position: center top, center top;
  background-attachment: fixed, fixed;
}

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  gap: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.hero-social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.site-footer {
  padding: 1.3rem 1rem 1rem;
  color: #e9f2ff;
}

.footer-shell {
  max-width: 1080px;
  margin: 0 auto;
  border: 1px solid rgba(182, 214, 255, 0.4);
  border-radius: 18px;
  padding: 1.2rem 1.35rem 0.85rem;
  background:
    linear-gradient(145deg, rgba(40, 107, 226, 0.34) 0%, rgba(31, 68, 149, 0.32) 52%, rgba(9, 28, 66, 0.45) 100%),
    linear-gradient(180deg, rgba(220, 239, 255, 0.12) 0%, rgba(112, 165, 241, 0.1) 100%);
  backdrop-filter: blur(13px) saturate(138%);
  -webkit-backdrop-filter: blur(13px) saturate(138%);
  box-shadow: 0 16px 34px rgba(8, 21, 45, 0.38);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: rgba(227, 241, 255, 0.9);
}

.footer-logo {
  width: min(230px, 60vw);
  height: auto;
  display: block;
}

.footer-cta {
  text-decoration: none;
  color: #144698;
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.97) 0%, rgba(217, 233, 255, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(13, 33, 76, 0.22);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 0 0.8rem;
}

.footer-col h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: #f3f9ff;
}

.footer-col a,
.footer-col p {
  display: block;
  margin: 0.26rem 0;
  color: rgba(224, 239, 255, 0.93);
  font-size: 0.92rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: #ffffff;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.1rem 0 0.4rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(188, 215, 250, 0.28);
  background: linear-gradient(180deg, rgba(22, 54, 108, 0.34) 0%, rgba(16, 44, 90, 0.28) 100%);
  color: rgba(224, 238, 255, 0.74);
  opacity: 0;
  transform: scale(0.82);
  animation: social-icon-pop-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.social-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.social-icon:hover {
  border-color: rgba(208, 229, 255, 0.65);
  color: #ffffff;
  transform: scale(1.12);
}

.hero-social-icons .social-icon:nth-child(1) {
  animation-delay: 220ms;
}

.hero-social-icons .social-icon:nth-child(2) {
  animation-delay: 340ms;
}

.footer-bottom {
  border-top: 1px solid rgba(188, 218, 255, 0.24);
  padding-top: 0.7rem;
  font-size: 0.84rem;
  color: rgba(220, 235, 251, 0.9);
}

@media (max-width: 760px) {
  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.hero-wordmark {
  position: absolute;
  left: 50%;
  top: -4.2rem;
  transform: translateX(-50%);
  width: min(220px, 44vw);
  height: auto;
  display: block;
  margin: 0;
  pointer-events: none;
}

h1 {
  margin: 0;
  position: relative;
  display: inline-block;
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  font-weight: 700;
  background: linear-gradient(112deg, var(--hero-text-start) 11%, #5f8cff 36%, #3a77ff 61%, var(--hero-text-end) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: scale(var(--title-scale));
  transform-origin: center center;
  transition: transform 80ms linear;
}

h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(110deg, transparent 30%, rgba(245, 250, 255, 0.96) 50%, transparent 70%);
  background-size: 220% 100%;
  background-position: 120% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
  animation: hero-text-shimmer-overlay 1.55s cubic-bezier(0.2, 0.7, 0.2, 1) 1 both;
}

.cta-button {
  position: relative;
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  min-width: 178px;
  padding: 0.78rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.34rem;
  font-family: "Cal Sans", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
}

.cta-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(92deg, var(--cta-start) 7%, var(--cta-mid) 56%, var(--cta-end) 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.cta-button span {
  background: linear-gradient(96deg, #2f6dff 6%, #6a97ff 56%, #f8fbff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cards {
  position: relative;
  z-index: 3;
  width: 100%;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 250px));
  justify-content: center;
  gap: 0.75rem;
}

.morph-stage {
  position: relative;
  min-height: 100vh;
  background: #d8dbcf;
  overflow: hidden;
}

.morph-stage-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  overflow: hidden;
}

.morph-title {
  margin: 0;
  font-size: clamp(3.2rem, 9vw, 8.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: nowrap;
  position: relative;
  display: inline-block;
  background: linear-gradient(112deg, var(--hero-text-start) 11%, #5f8cff 36%, #3a77ff 61%, var(--hero-text-end) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.morph-stage-primary .morph-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(110deg, transparent 32%, rgba(246, 251, 255, 1) 50%, transparent 68%);
  background-size: 220% 100%;
  background-position: var(--morph-shimmer-pos) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
  will-change: background-position;
}

.morph-stage-secondary {
  min-height: 100vh;
}

.morph-stage-secondary .morph-title {
  max-width: min(980px, 90vw);
  white-space: normal;
  text-align: center;
  line-height: 1.02;
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  filter: blur(4px);
}

.morph-stage-secondary.is-visible .morph-title {
  animation: secondary-morph-intro 820ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.pages-overlay {
  position: relative;
  min-height: 170vh;
  margin-top: 0;
  padding: 0 1.25rem 10rem;
  z-index: 4;
  background-image:
    linear-gradient(180deg, rgba(225, 233, 244, 0.86) 0%, rgba(212, 224, 240, 0.82) 100%),
    url("./assets/clou_stan_hero.jpeg");
  background-size: cover;
  background-position: center;
}

.wrapper {
  position: sticky;
  top: 10vh;
  height: 78vh;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.stack-card {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(720px, 95%);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 18px 36px rgba(28, 50, 92, 0.2);
  background: linear-gradient(160deg, rgba(245, 251, 255, 0.56) 0%, rgba(220, 235, 252, 0.4) 100%);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  color: #1f3c75;
  padding: 40px;
  border-radius: 10px;
  margin: 0;
  opacity: 0;
  transform: translateX(-50%) translateY(56px) scale(0.92) rotate(0deg);
  will-change: transform, opacity;
}

.stack-card h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
}

.stack-card h2 span {
  display: block;
  font-size: 14px;
  color: #0c4eb9;
  letter-spacing: 0.03em;
}

.stack-card p {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.5;
}

.card {
  width: min(250px, 100%);
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: visible;
  background: transparent;
  opacity: 0;
  transform: translateY(34px);
  animation: card-slide-up 700ms cubic-bezier(0.19, 0.8, 0.22, 1) forwards;
}

.card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card:nth-child(1) {
  animation-delay: 180ms;
}

.card:nth-child(2) {
  animation-delay: 320ms;
}

.card:nth-child(3) {
  animation-delay: 460ms;
}

@keyframes hero-text-shimmer-overlay {
  from {
    background-position: 120% 50%;
    opacity: 1;
  }
  to {
    background-position: -30% 50%;
    opacity: 0;
  }
}

@keyframes card-slide-up {
  from {
    opacity: 0;
    transform: translateY(34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes social-icon-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  62% {
    opacity: 1;
    transform: scale(1.14);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes secondary-morph-intro {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.98);
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes hero-wordmark-rise-up {
  from {
    opacity: 0;
    transform: translateY(34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 880px) {
  .hero {
    padding-top: 7.2rem;
    gap: 2.2rem;
  }

  h1 {
    font-size: clamp(2.35rem, 8vw, 3.6rem);
  }

  .hero-wordmark {
    top: -3.7rem;
    width: min(190px, 52vw);
  }

  .pages-overlay {
    min-height: 160vh;
    padding-bottom: 8rem;
  }

  .morph-stage {
    min-height: 100vh;
  }
}

@media (min-width: 1024px) {
  .hero {
    justify-content: flex-start;
    padding: 16.9rem 1.25rem 2.5rem;
    gap: 4.25rem;
  }

  .hero-content {
    gap: 2.2rem;
  }

  .hero-wordmark {
    top: -6.1rem;
    width: min(300px, 52vw);
  }

  h1 {
    font-size: clamp(2.35rem, 5.4vw, 5rem);
  }

  .cta-button {
    min-width: 192px;
    padding: 0.86rem 2rem;
    font-size: 1.62rem;
  }

  .cards {
    display: grid;
  }
}

@media (min-width: 900px) and (max-width: 1023px) and (orientation: landscape) {
  .hero {
    justify-content: flex-start;
    padding: 12rem 1.25rem 2.5rem;
    gap: 3.75rem;
  }

  .hero-content {
    gap: 2rem;
  }

  .hero-wordmark {
    top: -5rem;
    width: min(260px, 50vw);
  }

  h1 {
    font-size: clamp(2.2rem, 5.1vw, 4rem);
  }

  .cta-button {
    min-width: 188px;
    padding: 0.82rem 1.9rem;
    font-size: 1.52rem;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 250px));
    display: grid;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll, scroll;
  }

  .hero {
    padding-top: 4.5rem;
    gap: 2.5rem;
  }

  .hero-wordmark {
    top: -3.3rem;
    width: min(170px, 56vw);
  }

  .cards {
    grid-template-columns: 1fr;
    justify-items: center;
    max-width: 100%;
  }

  .cta-button {
    font-size: 1.22rem;
  }

  .pages-overlay {
    min-height: 150vh;
    padding-bottom: 7rem;
  }

  .wrapper {
    top: 8vh;
    height: 76vh;
  }

  .stack-card {
    padding: 26px;
  }

  .morph-stage {
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  h1::after {
    animation: none;
    opacity: 0;
  }

  .card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .social-icon {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  h1 {
    transform: none;
    transition: none;
  }

  .morph-title {
    transition: none;
  }

  .morph-stage-primary .morph-title::after {
    display: none;
  }

  .morph-stage-secondary .morph-title {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  main.hero .hero-wordmark {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

main.hero .hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

main.hero .hero-wordmark {
  position: static;
  left: auto;
  top: auto;
  transform: translateY(34px);
  width: min(260px, 66vw);
  margin: 0 auto;
  opacity: 0;
  animation: hero-wordmark-rise-up 780ms cubic-bezier(0.2, 0.72, 0.2, 1) 140ms forwards;
}

main.hero h1 {
  text-align: center;
}
