/* Self-hosted web fonts - SIL Open Font License 1.1 */

@font-face {
  font-family: "Inter";
  src: url("./fonts/inter/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("./fonts/pretendard/Pretendard-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("./fonts/ibm-plex/IBMPlexSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./fonts/ibm-plex/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #08090b;
  --ink: #f1f0ec;
  --inset: clamp(1.35rem, 3.3vmin, 2.75rem);
  font-family: "Inter", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 40%, #0e1014 0%, var(--night) 55%, #060708 100%);
}
::selection { color: #101116; background: #dbe0e5; }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.page {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--inset) var(--inset) max(var(--inset), env(safe-area-inset-bottom));
}
/* Four small registration marks frame the field. */
.frame {
  --hairline: #393d40;
  --stroke: linear-gradient(var(--hairline), var(--hairline));
  --arm: 11px;
  position: absolute;
  inset: var(--inset);
  pointer-events: none;
  background:
    left top / var(--arm) 1px var(--stroke), left top / 1px var(--arm) var(--stroke),
    right top / var(--arm) 1px var(--stroke), right top / 1px var(--arm) var(--stroke),
    left bottom / var(--arm) 1px var(--stroke), left bottom / 1px var(--arm) var(--stroke),
    right bottom / var(--arm) 1px var(--stroke), right bottom / 1px var(--arm) var(--stroke);
  background-repeat: no-repeat;
}
.composition {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding-block: clamp(1.8rem, 6vh, 4rem);
  text-align: center;
}

/* Orbital traces are CSS ellipses. The five lights remain separate DOM elements. */
.emblem {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: min(37rem, 88%);
  height: clamp(7.5rem, 16vw, 12rem);
  margin-bottom: clamp(1.25rem, 3.4vh, 2.6rem);
}
.emblem::before {
  position: absolute;
  inset: -32% -5%;
  content: "";
  background: radial-gradient(ellipse at center, #c7dbed0d, #b4c4df06 36%, transparent 67%);
}
.orbit {
  position: absolute;
  border: 1px solid;
  border-radius: 50%;
  pointer-events: none;
}
.orbit-far {
  width: 89%;
  height: 52%;
  transform: rotate(-13deg);
  border-color: #c2d0e01a #c2d0e025 #c2d0e042 #c2d0e020;
  mask-image: linear-gradient(105deg, #0008 0%, #000 25%, #0002 48%, #000 90%);
}
.orbit-near {
  width: 77%;
  height: 38%;
  transform: rotate(9deg);
  border-color: #d8e4f10d #d8e4f130 #d8e4f125 #d8e4f119;
  mask-image: linear-gradient(78deg, #000 0%, #0006 38%, #0003 55%, #000 88%);
}
.mark {
  --diameter: clamp(0.88rem, 1.9vw, 1.75rem);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3.35vw, 3.15rem);
}
.orb {
  position: relative;
  width: var(--diameter);
  height: var(--diameter);
  transform: translate(var(--pull-x, 0px), var(--pull-y, 0px));
}
.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 31%, #fff 0%, #fafbf8 28%, #dbe1e3 54%, #a0abb2 76%, #7d8995 100%);
  box-shadow: 0 0 6px #e8f0fc36, 0 0 17px #dce8fa36, 0 0 38px 5px #ddebff16;
  animation: breathe 6.8s ease-in-out infinite alternate;
  animation-delay: var(--phase, -2.7s);
}
.orb:nth-child(2) { --phase: -5s; }
.orb:nth-child(3) { --phase: -1.3s; }
.orb:nth-child(4) { --phase: -6.1s; }
.orb:nth-child(5) { --phase: -3.8s; }

h1, p { margin: 0; }
h1 {
  font-size: clamp(2.7rem, 8.45vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 1.04;
  padding-inline-end: 0.052em;
  text-wrap: balance;
}
.motto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.65vw, 1.5rem);
  margin-top: clamp(1.15rem, 2.8vh, 1.9rem);
  color: #d1d0cc;
  font-family: "IBM Plex Serif", serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-style: italic;
  line-height: 1.45;
}
.dot-run {
  display: inline-flex;
  flex: none;
  gap: clamp(3px, 0.43vw, 6px);
}
.dot-run i {
  /* The source text stays copyable as five periods. */
  display: inline-block;
  width: clamp(2px, 0.22vw, 3px);
  height: clamp(2px, 0.22vw, 3px);
  border-radius: 50%;
  background: #9ba3ab;
  color: transparent;
  font-size: 1px;
  animation: hover-dot 4s ease-in-out infinite alternate;
}
.dot-run i:nth-child(2n) { animation-delay: -1.8s; }
.dot-run i:nth-child(3n) { animation-delay: -3.1s; }
.dot-run:last-child { flex-direction: row-reverse; }
.korean {
  margin-top: clamp(1.55rem, 3.8vh, 2.7rem);
  color: #a1a5aa;
  font-family: "Pretendard", sans-serif;
  font-weight: 300;
  font-size: clamp(0.94rem, 1.25vw, 1.06rem);
  letter-spacing: 0.09em;
  line-height: 1.65;
  word-break: keep-all;
}
.colophon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.8rem 0 0.45rem;
  color: #8d949a;
  font: 400 0.82rem/1.4 "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
}
.colophon::before, .colophon::after {
  content: "";
  width: clamp(1.75rem, 3.8vw, 3.6rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, #555d66);
}
.colophon::after { transform: scaleX(-1); }

@keyframes breathe {
  from { transform: translateY(1.5px) scale(0.96); opacity: 0.89; }
  to { transform: translateY(-1.5px) scale(1.025); opacity: 1; }
}
@keyframes hover-dot {
  from { transform: translateY(0.8px); opacity: 0.60; }
  to { transform: translateY(-0.8px); opacity: 0.95; }
}
@media (prefers-reduced-motion: no-preference) {
  .composition { animation: arrive 900ms ease-out both; }
  @keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .orb::before, .dot-run i { animation: none; }
}
@media (max-width: 38rem) {
  .emblem { width: 100%; max-width: 24rem; }
  h1 { font-size: clamp(2.7rem, 11vw, 4.2rem); }
  .colophon { padding-bottom: 0.25rem; }
}
@media (max-height: 32rem) {
  .emblem { height: 6.5rem; margin-bottom: 0.75rem; }
  .composition { padding-block: 1rem; }
  .korean { margin-top: 0.9rem; }
}

