:root {
  --logo-h: 72px;
  --phi: 1.618;

  /* Color tokens */
  --bg: #000000;
  --fg: #ececec;
  --accent: #DAA520;

  --header-mobile: calc(var(--logo-h) / var(--phi));
  --header-desktop: calc(var(--logo-h) * var(--phi));
}

html {
  scroll-behavior: smooth;
}

/* Box-sizing reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base page styles */
html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Roboto', 'Noto Sans SC',system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 2rem;

  /* your golden-ratio heights */
  height: var(--header-mobile);
}

.logo img {
  width:auto;
  max-height: calc(var(--header-mobile)*0.8);
  object-fit: contain;
  padding-block:0.5rem;
  height:auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.618rem;            /* golden ratio spacing between links */
}

.action-link {
  text-decoration: none;
  color: inherit;

  font-size: clamp(1rem, 1.618vw, 1.618rem);

  font-weight: 600;
  cursor: pointer;
}

.action-link:hover {
  color: var(--accent);
}

.lang { font-family: "Noto Sans SC", sans-serif; }
.gallery { font-family: inherit; }

/* buttons reset */
.header-actions button {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--fg);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;  /* single column by default for mobile */
  grid-template-rows: auto;
  padding:0 2rem;
  align-items: center;
}

.hero-404 {
  width:90%;
  margin:6rem auto;
  text-align:center;
}

.hero-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;  /* optional */
  min-width: 0;
}



.hero-text p {
  font-size: clamp(16px, 2vw, 20px);
  line-height: clamp(24px, 3vw, 30px); /* ~1.5 ratio for font size */
  margin-bottom: clamp(1rem, 2vw, 2rem);
  margin-top:0;
}


.hero-text h2 {
  font-size: clamp(26px, 3vw, 32px);
  line-height: clamp(34px, 3.9vw, 42px); /* ~1.3 ratio */
  font-family: "Oswald", sans-serif;
  font-style: normal;
  font-weight: 400;
  color: var(--fg);
  margin:0;
}

.hero-text h1 {
  font-size: clamp(42px, 5vw, 178px);
  line-height: clamp(50px, 6vw, 214px); /* ~1.2 ratio */
  font-family: "Oswald", sans-serif;
  font-style: normal;
  text-transform: uppercase;
  color: var(--fg);
  margin:1rem 0;
}


.source{
  font-size: clamp(12px, 1.2vw, 14px);
  line-height: clamp(18px, 1.8vw, 21px);
  font-style: italic;
}

.source a{
  color:var(--fg);
  text-decoration:underline;
}

.source a:hover{
  color:var(--accent);
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1.0s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.character-gallery {
  padding: 0 2rem;
  margin-top:2rem;
}

.character-gallery h2 {
  font-size: clamp(33px, 5vw, 42px);
  line-height: clamp(42.9px, 4.5vw, 54.6px); /* ~1.3 ratio */
  font-family: "Oswald", sans-serif;
  font-style: normal;
  font-weight: 400;
  color: var(--fg);
}

.character-links{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:1.5rem;
  margin-top:2rem;
}

.character-link{
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.character-link img{
    width:100%;
    height:auto;
    border-radius:0.5rem;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.character-link:hover img {
  transform: scale(1.03);
  filter: brightness(1.1) contrast(1.05);
}

.character-link span {
  margin-top: 12px; /* golden ratio-ish spacing */
  font-size: clamp(14px, 1.8vw, 20px);
  line-height: 1.2rem;
  font-weight: 500;
  text-align: center;
}

.character-link:hover span {
  text-decoration: underline;
}

.site-footer {
  width: 100%;
  padding: 16px 0;
  text-align: center;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  color: #ccc;
  margin-top: 40px;
}


@media (max-width: 767px) {
  header {
    height: var(--header-mobile);
    width:100%;
    padding: 1rem;
  }
  .logo img {
    max-height: calc(var(--header-mobile)*0.8);
    padding-block:0.2rem;
  }

    .hero-image {
    order: -1; /* image comes first on mobile */
    }

    .hero-text h1 {
        font-size: clamp(42px, 10vw, 178px);
        line-height: clamp(50px, 12vw, 214px); /* ~1.2 ratio */
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
  header {
    height: var(--logo-h);
    width:90%;
    margin: 0 auto;
  }
  .logo img {
    max-height: calc(var(--logo-h)*0.9);
  }

    .hero-image {
    order: -1; /* image comes first on mobile */
    width:90%;
    margin:0 auto;

    }

    .hero-text {
    width:90%;
    margin:0 auto;
    }


    .hero-text h1 {
        font-size: clamp(42px, 10vw, 178px);
        line-height: clamp(50px, 12vw, 214px); /* ~1.2 ratio */
    }

    .character-gallery {
      width:90%;
      margin:2rem auto;
    } 

    .character-links{
      grid-template-columns: repeat(5, 1fr);
      gap:1.75rem;
    }


}



@media (min-width: 1100px) and (max-width: 1599px){
    header {
    height: var(--header-desktop);
    width:90%;
    margin: 0 auto;
  }
  .logo img {
    max-height: calc(var(--header-desktop)*0.8);
  }
  .hero {
    grid-template-columns: 38% 62%; /* golden ratio columns */
    gap: 3rem;
    padding: 0 2rem;
    width:90%;
    margin:0 auto;
  }

  .hero-image {
  flex: 1;
  display: flex;            /* make image a flex item */
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}

.hero-image img {
  max-height: 90vh;   /* scale image to 80% of viewport height */
  width: auto;        /* maintain aspect ratio */
  object-fit: contain; 
  border-radius: 0.5rem;  /* optional styling */
  }

     .character-gallery {
      width:90%;
      margin:2rem auto;
    } 

    .character-links{
      grid-template-columns: repeat(8, 1fr);
      gap:2em;
    }

}

@media (min-width: 1600px){
  header {
    height: calc(var(--header-desktop) * 1.2);
    width:90%;
    margin:0 auto;
  }
  .logo img {
    max-height: calc(var(--header-desktop)*1.2*0.8);
  }

  .hero {
    grid-template-columns: 38% 62%; /* golden ratio columns */
    gap: 3rem;
    padding: 0 2rem;
    width:90%;
    margin:0 auto;
  }

  .hero-image {
  flex: 1;
  display: flex;            /* make image a flex item */
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}

.hero-image img {
  max-height: 90vh;   /* scale image to 80% of viewport height */
  width: auto;        /* maintain aspect ratio */
  object-fit: contain; 
  border-radius: 0.5rem;  /* optional styling */
  }.hero {
    grid-template-columns: 38% 62%; /* golden ratio columns */
    gap: 3rem;
    padding: 0 2rem;
    width:90%;
    margin:0 auto;
  }

  .hero-image {
  flex: 1;
  display: flex;            /* make image a flex item */
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}

.hero-image img {
  max-height: 90vh;   /* scale image to 80% of viewport height */
  width: auto;        /* maintain aspect ratio */
  object-fit: contain; 
  border-radius: 0.5rem;  /* optional styling */
  }

    .character-gallery {
      width:90%;
      margin:2rem auto;
    } 

    .character-links{
      grid-template-columns: repeat(10, 1fr);
      gap:2rem;
    }
}

