@font-face {
  font-family: "Guanchao Song";
  src: url("/assets/guanchao-song.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
}

:root {
  color: #f9f5eb;
  background: #173044;
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --edge: clamp(1.25rem, 4.2vw, 5rem);
  --photo-x: 50%;
  --photo-y: 50%;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; }
[hidden] { display: none !important; }

.hero {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto;
  isolation: isolate;
  min-block-size: 100vh;
  min-block-size: 100svh;
}

.seascape,
.seascape img,
.seascape canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

.seascape {
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.seascape img {
  display: block;
  object-fit: cover;
  object-position: var(--photo-x) var(--photo-y);
}

.seascape canvas {
  visibility: hidden;
}

.seascape canvas[data-ready] {
  visibility: visible;
}

.intro {
  align-self: start;
  padding-block: clamp(4.3rem, 12svh, 12rem) 3rem;
  padding-inline: clamp(1.5rem, 8vw, 10.5rem);
  text-shadow: 0 1px 30px rgb(9 27 39 / .32);
}

.intro h1 {
  margin: 0;
  font: 700 clamp(4.65rem, 9.25vw, 11rem)/.99 "Guanchao Song", "Songti SC", "STSong", "SimSun", serif;
  letter-spacing: .035em;
}

.intro p {
  margin: clamp(.95rem, 1.38vw, 1.65rem) 0 0;
  color: #fbf8ef;
  font-size: clamp(1.05rem, 2vw, 2rem);
  font-weight: 400;
  letter-spacing: .055em;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: flex-end;
  padding-inline: max(var(--edge), env(safe-area-inset-left)) max(var(--edge), env(safe-area-inset-right));
}

.reader,
.motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 249 236 / .88);
  background: rgb(12 32 46 / .56);
  color: #fffaf0;
  cursor: pointer;
  transition: background-color .22s ease, border-color .22s ease;
}

.reader {
  min-block-size: 3.4rem;
  margin-inline-start: auto;
  gap: clamp(.55rem, 1vw, 1rem);
  padding: .7rem clamp(1.25rem, 2vw, 1.7rem);
  border-radius: .32rem;
  font-size: clamp(1rem, 1.46vw, 1.45rem);
  letter-spacing: .05em;
  text-decoration: none;
}

.reader svg {
  inline-size: 1em;
  block-size: 1em;
  transition: transform .22s ease;
}

.motion {
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: .65rem;
  margin-block-end: -.32rem;
  border-radius: 50%;
}

.motion svg {
  inline-size: 100%;
  block-size: 100%;
}

.motion .play-icon,
.motion[data-paused] .pause-icon { display: none; }
.motion[data-paused] .play-icon { display: inline; }

.reader:hover,
.motion:hover {
  background: rgb(24 55 70 / .84);
  border-color: #fff8e8;
}

.reader:hover svg { transform: translate(.15rem, -.15rem); }

:where(a, button):focus-visible {
  outline: 2px solid #ffe0a6;
  outline-offset: 4px;
}

.registration {
  padding: clamp(1.3rem, 2.3svh, 2rem) 1rem max(clamp(1.15rem, 3.25svh, 2.9rem), env(safe-area-inset-bottom));
  color: #f5f2eb;
  font-size: clamp(.8rem, 1.24vw, 1.2rem);
  text-align: center;
  text-shadow: 0 1px 8px #081722, 0 0 16px #081722;
}

.registration a {
  text-decoration: none;
}

.registration a:hover {
  text-decoration: underline;
  text-underline-offset: .25em;
}

@media (max-aspect-ratio: 1 / 1) {
  :root { --photo-x: 22%; }
  .intro {
    padding-block-start: clamp(4.5rem, 13svh, 8.5rem);
    padding-inline: clamp(1.35rem, 7vw, 5rem);
  }

  .intro h1 { font-size: clamp(4.7rem, 14vw, 7.6rem); }

  .reader { min-block-size: 3rem; }
}

@media (max-height: 520px) {
  .intro { padding-block: 2.4rem 1.8rem; }
  .intro h1 { font-size: clamp(3.75rem, 9vw, 6rem); }
  .intro p { margin-block-start: .7rem; }
  .registration { padding-block: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
