:root {
  color-scheme: dark;
  --ink: #05080b;
  --ink-soft: #0b1117;
  --mist: #b8c6cf;
  --paper: #edf1ef;
  --gold: #f7c86b;
  --gold-hot: #fff2b7;
  --gold-deep: #8f5b1e;
  --line: rgba(247, 200, 107, 0.28);
  --mx: 0;
  --my: 0;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  transform: translateY(-160%);
  border: 1px solid var(--gold);
  background: #05080b;
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.stage {
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 100svh;
  overflow: hidden;
  background: #070b10;
}

.scene,
.scene-wash,
.grain,
.fog,
#embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scene {
  z-index: -5;
  object-fit: cover;
  object-position: 54% center;
  transform: scale(1.055) translate(calc(var(--mx) * -0.8%), calc(var(--my) * -0.45%));
  filter: saturate(0.78) contrast(1.09) brightness(0.76);
  transition: transform 180ms ease-out;
}

.scene-wash {
  z-index: -4;
  background:
    radial-gradient(circle at 72% 48%, rgba(247, 191, 86, 0.10), transparent 25%),
    linear-gradient(90deg, rgba(4, 7, 10, 0.97) 0%, rgba(5, 9, 13, 0.87) 27%, rgba(5, 8, 12, 0.28) 63%, rgba(5, 8, 12, 0.44) 100%),
    linear-gradient(180deg, rgba(3, 6, 9, 0.72), transparent 20%, transparent 75%, rgba(3, 6, 9, 0.91));
}

.grain {
  z-index: 5;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
}

.fog {
  z-index: -2;
  width: 120%;
  left: -10%;
  opacity: 0.25;
  filter: blur(28px);
  background: radial-gradient(ellipse at center, rgba(185, 206, 219, 0.26), transparent 64%);
}

.fog-a {
  top: 54%;
  height: 28%;
  animation: fog-drift 16s ease-in-out infinite alternate;
}

.fog-b {
  top: 73%;
  height: 24%;
  opacity: 0.19;
  animation: fog-drift 21s ease-in-out -8s infinite alternate-reverse;
}

#embers {
  z-index: 4;
}

.topbar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 7.5rem, 1800px);
  height: 7rem;
  margin-inline: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--paper);
  text-decoration: none;
}

.brand img {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(246, 189, 72, 0.36));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.18em;
}

.brand small {
  margin-top: 0.28rem;
  color: #94a1aa;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
}

.socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.9rem;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #dce3e5;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 16, 0.48);
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease, background 180ms ease;
}

.icon-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.icon-link:hover,
.icon-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(247, 200, 107, 0.72);
  background: rgba(247, 200, 107, 0.08);
  color: var(--gold-hot);
}

.hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(36rem, 0.9fr) minmax(38rem, 1.1fr);
  align-items: stretch;
  width: min(100% - 7.5rem, 1800px);
  min-height: calc(100svh - 7rem);
  margin-inline: auto;
}

.story {
  position: relative;
  z-index: 8;
  align-self: center;
  max-width: 46rem;
  padding: 2.25rem 0 5rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.4rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.36em;
  animation: rise-in 850ms 150ms both;
}

.eyebrow span {
  width: 2.7rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5.4rem, 8.2vw, 10.5rem);
  font-weight: 500;
  line-height: 0.72;
  letter-spacing: -0.075em;
  text-shadow: 0 12px 50px rgba(0, 0, 0, 0.58);
}

h1 span {
  display: block;
  animation: title-in 950ms cubic-bezier(.16,.78,.18,1) both;
}

h1 span:last-child {
  margin-top: 0.12em;
  padding-left: 0.29em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 224, 190, 0.74);
  background: linear-gradient(102deg, #fff2cb 4%, #bc7a2e 47%, #f7d886 80%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 18px rgba(235, 167, 52, 0.16));
  animation-delay: 80ms;
}

.tagline {
  max-width: 36rem;
  margin: 2.2rem 0 1.6rem;
  color: #bac4ca;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  font-style: italic;
  line-height: 1.55;
  animation: rise-in 850ms 320ms both;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: rise-in 850ms 420ms both;
}

.ca-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.95rem;
  min-width: 13.6rem;
  min-height: 3.6rem;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, #f7cf7f, #9d6727);
  color: #090b0d;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset, 0 13px 35px rgba(0,0,0,.36), 0 0 35px rgba(238, 175, 67, 0.11);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.ca-button:hover,
.ca-button:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(0,0,0,.28) inset, 0 18px 40px rgba(0,0,0,.42), 0 0 44px rgba(238, 175, 67, 0.25);
}

.ca-button:active {
  transform: translateY(0) scale(0.98);
}

.ca-button svg {
  width: 1rem;
  fill: currentColor;
}

.button-glint {
  position: absolute;
  inset: -2px auto -2px -35%;
  width: 26%;
  transform: skewX(-22deg);
  background: rgba(255,255,255,.46);
  filter: blur(5px);
  animation: button-glint 4.4s 1.2s infinite;
}

.copy-status {
  color: #89969f;
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.copy-status.is-success {
  color: var(--gold-hot);
}

.lore-card {
  width: min(100%, 39rem);
  margin-top: 1.75rem;
  border-left: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8, 13, 18, 0.72), rgba(8, 13, 18, 0.18));
  backdrop-filter: blur(10px);
  animation: rise-in 850ms 520ms both;
}

.lore-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 1rem 0.55rem 1.15rem;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-align: left;
}

.lore-toggle:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.lore-mark {
  font-size: 1.15rem;
}

.lore-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  max-height: 12rem;
  overflow: hidden;
  padding: 0 1rem 0.9rem 1.15rem;
  opacity: 1;
  transition: max-height 350ms ease, opacity 250ms ease, padding 350ms ease;
}

.lore-text[hidden] {
  display: none;
}

.lore-text p {
  margin: 0;
  color: #aeb9bf;
  font-size: 0.83rem;
  line-height: 1.58;
}

.lore-text strong {
  color: #e6d7b7;
  font-weight: 650;
}

.relic {
  position: relative;
  z-index: 4;
  min-height: calc(100svh - 7rem);
}

.character {
  position: absolute;
  z-index: 6;
  right: -1.2rem;
  bottom: -6.4rem;
  width: min(53vw, 61rem);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: crosshair;
  transform: perspective(1200px) rotateY(calc(var(--mx) * 2.2deg)) rotateX(calc(var(--my) * -1.25deg));
  transform-origin: 55% 75%;
  transition: transform 150ms ease-out, filter 250ms ease;
  animation: character-rise 1.25s cubic-bezier(.17,.77,.19,1) both, character-float 5.5s 1.25s ease-in-out infinite;
}

.character::after {
  content: "";
  position: absolute;
  inset: 11% 9% 5% 12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 206, 100, 0.18), transparent 65%);
  filter: blur(24px);
  animation: aura-breathe 3.4s ease-in-out infinite;
}

.character:focus-visible::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  outline: 2px solid var(--gold);
  outline-offset: 0.7rem;
}

.character:hover {
  filter: saturate(1.08) brightness(1.04);
}

.character img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 32px 35px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 14px rgba(239, 171, 48, 0.16));
  user-select: none;
}

.character-shadow {
  position: absolute;
  z-index: 0;
  right: 10%;
  bottom: 6%;
  width: 61%;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  filter: blur(22px);
  transform: rotate(-4deg);
}

.lens {
  position: absolute;
  z-index: 4;
  top: 42.5%;
  width: 3.6%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 245, 192, 0.95) 0 9%, rgba(246, 170, 55, 0.62) 10% 24%, transparent 58%);
  mix-blend-mode: screen;
  opacity: 0;
  filter: blur(0.2px) drop-shadow(0 0 8px #ffc865);
  animation: lens-glint 6s 2.2s infinite;
}

.lens-left { left: 46.2%; }
.lens-right { left: 55.8%; animation-delay: 2.28s; }

.seal {
  position: absolute;
  z-index: 1;
  right: 1.8rem;
  top: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
}

.seal-outer {
  width: min(43vw, 49rem);
  border: 1px solid rgba(245, 202, 114, 0.23);
  box-shadow: 0 0 100px rgba(233, 165, 48, 0.08) inset, 0 0 60px rgba(0,0,0,.28);
}

.seal-outer::before,
.seal-outer::after {
  content: "✦ · IX · ✦ · IX · ✦ · IX · ✦ · IX ·";
  position: absolute;
  inset: 7%;
  display: grid;
  place-items: start center;
  border: 1px dashed rgba(245, 202, 114, 0.2);
  border-radius: 50%;
  color: rgba(245, 202, 114, 0.42);
  font-family: Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.42em;
  padding-top: 1.8rem;
  animation: seal-turn 48s linear infinite;
}

.seal-outer::after {
  inset: 16%;
  padding-top: 1rem;
  animation-direction: reverse;
  animation-duration: 33s;
}

.seal-inner {
  right: 7.6rem;
  width: min(34vw, 38rem);
  border: 1px solid rgba(255, 235, 182, 0.19);
  background: repeating-conic-gradient(from 0deg, transparent 0 7deg, rgba(247,200,107,.11) 7.3deg 7.55deg, transparent 7.8deg 15deg);
  mask: radial-gradient(circle, transparent 0 68%, #000 69% 70%, transparent 71%);
  -webkit-mask: radial-gradient(circle, transparent 0 68%, #000 69% 70%, transparent 71%);
  animation: seal-turn 70s linear infinite reverse;
}

.orbit {
  position: absolute;
  z-index: 3;
  right: 13%;
  top: 46%;
  width: 50%;
  aspect-ratio: 1;
  border: 1px solid rgba(246, 201, 110, 0.12);
  border-radius: 50%;
  transform: rotate(-18deg) scaleY(0.35);
  animation: orbit-turn 13s linear infinite;
}

.orbit-b {
  right: 3%;
  top: 39%;
  width: 70%;
  animation-duration: 19s;
  animation-direction: reverse;
}

.orbit i {
  position: absolute;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--gold-hot);
  box-shadow: 0 0 18px 6px rgba(255, 197, 80, 0.45);
}

.orbit i:nth-child(1) { top: -0.2rem; left: 50%; }
.orbit i:nth-child(2) { right: 6%; bottom: 24%; }
.orbit i:nth-child(3) { left: 9%; bottom: 19%; }

.relic-note {
  position: absolute;
  z-index: 8;
  padding-left: 0.9rem;
  border-left: 1px solid var(--gold-deep);
  text-shadow: 0 2px 12px #000;
  animation: rise-in 800ms 850ms both;
}

.relic-note span,
.relic-note strong {
  display: block;
}

.relic-note span {
  margin-bottom: 0.35rem;
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.relic-note strong {
  color: #dbe1e0;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
}

.note-oath { top: 20%; right: 0; }
.note-relic { right: 2%; bottom: 19%; }

.interaction-hint {
  position: absolute;
  z-index: 9;
  right: 1rem;
  bottom: 2.2rem;
  margin: 0;
  color: rgba(219, 225, 225, 0.54);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  animation: rise-in 800ms 1s both;
}

.awakening {
  position: absolute;
  z-index: 12;
  right: 18%;
  top: 44%;
  margin: 0;
  color: var(--gold-hot);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.32em;
  text-shadow: 0 0 22px #efad43;
  pointer-events: none;
  opacity: 0;
}

.relic.is-awake .character {
  animation: awaken 850ms cubic-bezier(.16,.84,.34,1) both, character-float 5.5s 850ms ease-in-out infinite;
}

.relic.is-awake .awakening {
  animation: omen 1.25s ease both;
}

.relic.is-awake .seal-outer {
  opacity: 0.85;
  box-shadow: 0 0 150px rgba(238, 170, 48, 0.18) inset, 0 0 75px rgba(240, 183, 70, 0.2);
}

.edge-copy {
  position: absolute;
  z-index: 7;
  right: 1.35rem;
  top: 50%;
  color: rgba(222, 230, 233, 0.32);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

.burst-particle {
  position: absolute;
  z-index: 15;
  left: 55%;
  top: 48%;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gold-hot);
  box-shadow: 0 0 12px 4px rgba(255, 193, 67, 0.6);
  pointer-events: none;
  animation: burst 950ms ease-out forwards;
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(0.35em); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes character-rise {
  from { opacity: 0; transform: perspective(1200px) translateY(8%) scale(.92); filter: blur(10px); }
  to { opacity: 1; transform: perspective(1200px) translateY(0) scale(1); filter: blur(0); }
}

@keyframes character-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1.1%; }
}

@keyframes aura-breathe {
  0%, 100% { opacity: .54; scale: .98; }
  50% { opacity: .95; scale: 1.045; }
}

@keyframes lens-glint {
  0%, 28%, 36%, 100% { opacity: 0; scale: .7; }
  31% { opacity: .92; scale: 1.15; }
  33% { opacity: .42; scale: .9; }
}

@keyframes fog-drift {
  from { transform: translateX(-3%) scale(1.02); }
  to { transform: translateX(4%) scale(1.12); }
}

@keyframes seal-turn {
  to { rotate: 360deg; }
}

@keyframes orbit-turn {
  to { transform: rotate(342deg) scaleY(.35); }
}

@keyframes button-glint {
  0%, 63% { left: -35%; }
  83%, 100% { left: 130%; }
}

@keyframes awaken {
  0% { translate: 0 0; filter: brightness(1); }
  18% { translate: -0.4% 0; }
  36% { translate: 0.4% -0.4%; filter: brightness(1.5) saturate(1.15); }
  55% { translate: -0.2% 0.3%; }
  100% { translate: 0 -1%; filter: brightness(1.06); }
}

@keyframes omen {
  0% { opacity: 0; transform: translateY(.5rem) scale(.9); }
  28%, 62% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-1rem) scale(1.03); }
}

@keyframes burst {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

@media (max-width: 1180px) {
  body { overflow-y: auto; }
  .topbar,
  .hero-grid { width: min(100% - 3rem, 1080px); }
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .story {
    padding-top: 4rem;
    max-width: 44rem;
  }
  .relic {
    min-height: 50rem;
    margin-top: -10rem;
    pointer-events: none;
  }
  .character {
    pointer-events: auto;
    right: -8rem;
    width: min(88vw, 52rem);
  }
  .seal-outer { width: 42rem; right: -5rem; }
  .seal-inner { width: 33rem; right: 0; }
  .note-oath { right: 1rem; }
}

@media (max-width: 720px) {
  .topbar {
    width: calc(100% - 2rem);
    height: 5.4rem;
  }
  .brand small,
  .icon-link span,
  .edge-copy { display: none; }
  .brand img { width: 2.75rem; height: 2.75rem; }
  .socials { gap: .45rem; }
  .icon-link {
    justify-content: center;
    min-width: 2.75rem;
    padding: .65rem;
  }
  .hero-grid { width: calc(100% - 2rem); }
  .story { padding: 4.8rem 0 2rem; }
  h1 { font-size: clamp(4rem, 21vw, 7rem); }
  .eyebrow { font-size: .64rem; letter-spacing: .22em; }
  .tagline { max-width: 27rem; }
  .actions { align-items: flex-start; flex-direction: column; gap: .65rem; }
  .lore-text { grid-template-columns: 1fr; max-height: 26rem; }
  .relic {
    min-height: 35rem;
    margin-top: -2rem;
  }
  .character {
    right: -6rem;
    bottom: -2.6rem;
    width: min(135vw, 43rem);
  }
  .seal-outer { width: 32rem; right: -9rem; }
  .seal-inner { width: 25rem; right: -5.5rem; }
  .relic-note { display: none; }
  .interaction-hint { right: 0; bottom: .9rem; font-size: .55rem; }
  .scene { object-position: 64% center; }
  .scene-wash {
    background:
      linear-gradient(180deg, rgba(4,7,10,.88), rgba(5,8,12,.55) 57%, rgba(4,7,10,.88)),
      linear-gradient(90deg, rgba(4,7,10,.92), rgba(4,7,10,.22));
  }
}

@media (max-height: 820px) and (min-width: 1181px) {
  .topbar { height: 5.6rem; }
  .hero-grid { min-height: calc(100svh - 5.6rem); }
  .story { padding-top: 1rem; }
  h1 { font-size: clamp(5rem, 7.1vw, 8rem); }
  .tagline { margin-block: 1.45rem 1rem; }
  .lore-card { margin-top: 1.1rem; }
  .character { width: min(50vw, 49rem); bottom: -5.2rem; }
  .relic { min-height: calc(100svh - 5.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fog,
  .orbit,
  #embers { display: none; }
  .character,
  .scene { transform: none; }
}
