@font-face {
  font-family: 'RaineHorneThin';
  src: url('Raine&Horne-Thin.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'RaineHorneLight';
  src: url('RaineHorneLight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

html, body, h1, .links a, footer {
  font-family: 'RaineHorneThin', Arial, sans-serif !important;
  font-weight: 200 !important;
  letter-spacing: 0.01em;
}

body {
  background: #0d1115;
  color: #fff;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
}

/* SOFT PAGE LOAD FADE-IN/SCALE */
.fade-on-load {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.8s cubic-bezier(.22,1,.36,1), transform 0.8s cubic-bezier(.22,1,.36,1);
}
.fade-on-load.loaded {
  opacity: 1;
  transform: scale(1);
}

/* FADE-IN ON SCROLL */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(32px) scale(0.99);
  transition: opacity 0.85s cubic-bezier(.22,1,.36,1), transform 0.85s cubic-bezier(.22,1,.36,1);
}
.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* HERO IMAGE */
.main-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 48vh;    /* Adjust for desktop vertical positioning */
  min-height: 30vh;
}
.hero-image-container {
  position: relative;
  width: 100%;
  height: 0;
}
#bg-photo {
  position: absolute;
  left: 52%;
  top: -520px;
  transform: translateX(-50%);
  width: auto;
  height: 750px;
  max-width: 95vw;
  opacity: 0.70;
  transition: opacity 0.8s cubic-bezier(.22,1,.36,1), filter 0.6s, transform 0.9s cubic-bezier(.22,1,.36,1);
  filter: brightness(0.97);
  pointer-events: none;
  display: block;
  margin: 0 auto;
  z-index: 0;
}

@media (max-width: 900px) {
  #bg-photo { height: 330px; top: -165px; }
  .main-content { padding-top: 12vh; }
}

/* Typewriter & Heading */
#typewriter {
  position: relative;
  z-index: 1;
  border-right: 0.06em solid #fff;
  animation: blink 0.9s steps(1) infinite;
  white-space: nowrap;
  overflow: hidden;
}
@keyframes blink {
  0%, 100% { border-color: #fff; }
  50% { border-color: transparent; }
}
h1 {
  font-size: 6vw;
  margin: 0 0 2.2rem 0;
  line-height: 1.07;
  position: relative;
  z-index: 1;
}

/* NAVIGATION & ANIMATED UNDERLINE */
.links {
  display: flex;
  gap: 2.2rem;
  justify-content: center;
  margin-bottom: 0.7rem;
  position: relative;
  z-index: 1;
}
.links a {
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  opacity: 0.9;
  border-bottom: none;
  padding-bottom: 2px;
  font-family: inherit;
  font-weight: inherit;
  position: relative;
  overflow: hidden;
  transition:
    color 0.18s,
    opacity 0.18s,
    border-bottom 0.18s,
    transform 0.17s cubic-bezier(.47,1.64,.41,.8);
}

/* Animated underline (Apple-style) */
.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: #fcb200;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(.47,1.64,.41,.8);
}
.links a:hover::after, .links a:focus::after {
  transform: scaleX(1);
}
.links a:visited {
  color: #fff;
}
.links a:hover,
.links a:focus {
  color: #fcb200;
  opacity: 1;
  border-bottom: none;
  outline: none;
  transform: scale(1.13);
  z-index: 1;
}

/* CONTACT LINK & FOOTER REVEAL */
.contact-link {
  font-family: 'RaineHorneLight', Arial, sans-serif !important;
  font-weight: 300 !important;
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  opacity: 0.9;
  border-bottom: none;
  padding-bottom: 2px;
  margin-bottom: 0.1rem;
  display: inline-block;
  transition:
    color 0.18s,
    opacity 0.18s,
    border-bottom 0.18s,
    transform 0.17s cubic-bezier(.47,1.64,.41,.8);
}
.contact-link:visited {
  color: #fff;
}
.contact-link:hover,
.contact-link:focus {
  color: #fcb200;
  opacity: 1;
  border-bottom: none;
  outline: none;
  transform: scale(1.13);
  z-index: 1;
}
footer {
  flex-shrink: 0;
  margin-bottom: 2.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.3rem;
}
.contact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 1.12rem;
  opacity: 0.95;
  align-items: center;
}
.contact-link {
  margin-bottom: 0.1rem;
  display: inline-block;
}

/* Raine & Horne logo size for desktop and mobile */
.rh-logo {
  margin-top: 0.8rem;
  max-width: 180px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 2px #00000044);
}
@media (max-width: 700px) {
  .rh-logo {
    max-width: 120px;
  }
}

@media (max-width: 700px) {
  .main-content {
    padding-top: 42vh;
    min-height: 0;
  }
  #bg-photo {
    height: 300px;
    top: -200px;
    left: 50%;
  }
  h1 {
    font-size: 2.6rem;
    margin-top: 0.5rem;
    margin-bottom: 2.1rem;
  }
  .links {
    flex-direction: column;
    gap: 1.1rem;
    align-items: center;
    margin-bottom: 2.7rem;
  }
  .links a {
    font-size: 1.15rem;
    padding: 0.3rem 0;
    min-width: 140px;
    text-align: center;
    width: 100%;
  }
  footer {
    margin-bottom: 1.1rem;
    gap: 1.1rem;
  }
}
