@keyframes load{
    from{
        transform: translateY(20%);
        opacity: 20%;
    }
    to{
        transform: translateY(0);
        opacity: 100%;
    }
}

@keyframes fade-out{
    from{
        opacity: 100%;
    }
    to{
        opacity: 0%;
    }
}

@keyframes to-top{
    from{
        top: 50%;
        transform: translateY(-50%);
    }
    to{
        top: 0;
        transform: translateY(0%);
    }
}

@keyframes slideDownFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html, body{
    height: 100%;
    min-height: 100%;  
}

body{
    min-height: 100svh;

    background-color: rgb(192, 174, 163);
    background-image: linear-gradient(rgb(234, 227, 217) 0%, rgb(237, 227, 217) 16.667%, rgb(233, 220, 209) 33.333%, rgb(223, 207, 196) 50%, rgb(208, 191, 180) 66.667%, rgb(192, 174, 163) 83.333%, rgb(177, 160, 149) 100%);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    
    font-family: "Noto Serif JP", serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 350;
    line-height: 1.7;
    letter-spacing: 0.02rem;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    color: #3A332E;

    margin: 0;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;

    animation-name: load;
    animation-duration: 0.5s;
    animation-timing-function: ease-out;
}

.container{
    display: flex;
    flex-direction: column;
    align-items: center;

    position: absolute;
    transform: translateY(-50%);
    top: 50%;
    animation-timing-function: ease;
}

.to-top{
    animation: to-top 0.7s forwards 
}

h1{
  /* scales down enough to stay on one line, scales up on big screens */
  font-size: clamp(1.35rem, 4.6vw, 3rem);

  letter-spacing: 0.06em;
  line-height: 1.12;
  text-align: center;

  /* force single line */
  white-space: nowrap;

  /* prevent it from pushing outside the viewport */
  max-width: 92vw;
  overflow: hidden;

  /* keeps the text visually centered even with nowrap */
  text-overflow: clip;

  /* avoid edge-cramp */
  padding: 0 0.75rem;

  margin: 1rem 0 3.2rem 0;
}


.fade-out{
    animation: fade-out 0.5s forwards
}

.reveal-trigger {
  padding: 0.6rem 1.4rem;

  font-size: 0.95rem;
  letter-spacing: 0.05em;
  width: fit-content;

  color: #2F2B27;
  background-color: transparent;

  border: 1px solid rgba(47, 43, 39, 0.25);
  border-radius: 999px;

  cursor: pointer;

  transition:
    background-color 600ms ease,
    color 600ms ease,
    border-color 600ms ease,
    transform 400ms ease;
}

.reveal-trigger:hover {
  background-color: rgba(47, 43, 39, 0.08);
  color: #2F2B27;
  border-color: rgba(47, 43, 39, 0.45);
  transform: translateY(-1px);
}

.message{
  max-width: 620px;
  width: min(92vw, 620px);
  margin: 0 auto;
  text-align: center;
  line-height: 1.85;
  display: none;

  /* key change: fluid type that grows on iPad/Go/desktop */
  font-size: clamp(1.05rem, 0.65vw + 0.95rem, 1.7rem);
}

.message p {
  margin: 0;
  line-height: 1.9;
}

.message p + p {
  margin-top: 1.6rem;
}

.message p:first-child {
  margin-bottom: 2.4rem;
}

p {
  opacity: 0;
  transform: translateY(-12px);
  
}

.pAnimation{
    animation: slideDownFade 0.8s ease forwards;
}

p:nth-child(1) { animation-delay: 0.2s; }
p:nth-child(2) { animation-delay: 0.6s; }
p:nth-child(3) { animation-delay: 1.0s; }
p:nth-child(4) { animation-delay: 1.4s; }
p:nth-child(5) { animation-delay: 1.8s; }
p:nth-child(6) { animation-delay: 2.2s; }
p:nth-child(7) { animation-delay: 2.6s; }

/* Tablet / small screens */
@media (max-width: 765px){
  .message{
    line-height: 1.7;
    width: min(92vw, 520px);
  }
}

/* Small phones */
@media (max-width: 380px){
  .message{
    line-height: 1.55;
    width: 92vw;         /* don't force 300px */
    font-size: 0.95rem;  /* 0.9 can get a bit small */
  }

  h1{
    font-size: 1.35rem;  /* or let clamp handle it; either is fine */
  }
}

/* Very tall screens (keep it subtle + capped) */
@media (min-height: 900px) and (min-width: 800px){
  .message{
    font-size: clamp(1.1rem, 1.2vw, 1.35rem);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
}