:root {
  --bg: #0a0908;
  --bg-deep: #050403;
  --gold: #d9b878;
  --gold-bright: #f3dfab;
  --gold-dim: #8a7550;
  --ink: #ece6da;
  --ink-dim: rgba(236, 230, 218, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(217, 184, 120, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(0, 0, 0, 0.6), transparent 60%),
    url("../assets/bg.PNG");
  background-size: cover;
  background-position: center 15%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  min-height: 100dvh;
  position: relative;
}

/* darkening overlay so any future photo stays readable & moody */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,4,3,0.55) 0%, rgba(5,4,3,0.72) 55%, rgba(5,4,3,0.9) 100%);
  pointer-events: none;
  z-index: 0;
}

/* fine film-grain noise for a richer, less "flat" dark background */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain 8s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  30% { transform: translate(3%, 2%); }
  50% { transform: translate(-3%, 1%); }
  70% { transform: translate(2%, -2%); }
  90% { transform: translate(-1%, 3%); }
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  margin-left: -320px;
  margin-top: -320px;
  background: radial-gradient(circle, rgba(217, 184, 120, 0.14) 0%, rgba(217, 184, 120, 0) 65%);
  z-index: 1;
  pointer-events: none;
  transform: translate3d(50vw, 40vh, 0);
  transition: transform 0.6s var(--ease);
  will-change: transform;
}

/* ---------- preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}

.preloader__mark {
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 8vw, 4rem);
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  color: var(--gold);
  opacity: 0;
  animation: mark-in 1.4s var(--ease) forwards;
}

@keyframes mark-in {
  0% { opacity: 0; letter-spacing: 0.6em; filter: blur(6px); }
  60% { opacity: 1; }
  100% { opacity: 0.9; letter-spacing: 0.35em; filter: blur(0); }
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- stage / card ---------- */

.stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.4rem, 4vh, 2.6rem);
  max-width: 640px;
}

.card__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-dim);
  opacity: 0;
}

.card__name {
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 9vw, 5rem);
  line-height: 1.2;
  letter-spacing: clamp(0.1em, 2vw, 0.3em);
  text-transform: uppercase;
}

.card__name-line {
  display: block;
  overflow: hidden;
}

.card__letters {
  display: inline-block;
}

.card__letters .char {
  display: inline-block;
  background: linear-gradient(100deg, var(--gold-dim) 0%, var(--gold-bright) 30%, var(--gold) 50%, var(--gold-bright) 70%, var(--gold-dim) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(70%) rotateX(-40deg);
  filter: blur(6px);
}

.card__rule {
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0;
}

.card__rule span {
  display: block;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- socials ---------- */

.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 3vw, 1.6rem);
  flex-wrap: wrap;
  margin-top: clamp(0.4rem, 2vh, 1rem);
}

.socials__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(217, 184, 120, 0.28);
  background: rgba(217, 184, 120, 0.04);
  color: var(--gold);
  text-decoration: none;
  opacity: 0;
  transform: translateY(18px);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease),
    transform 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.4s var(--ease);
}

.socials__icon {
  width: 20px;
  height: 20px;
  display: flex;
}

.socials__icon svg {
  width: 100%;
  height: 100%;
}

.socials__item:hover,
.socials__item:focus-visible {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(217, 184, 120, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px -12px rgba(217, 184, 120, 0.5);
}

.socials__label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 6px);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.socials__item:hover .socials__label,
.socials__item:focus-visible .socials__label {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- reveal states triggered by JS ---------- */

body.is-ready .card__eyebrow {
  animation: fade-up 0.9s var(--ease) forwards;
  animation-delay: 0.15s;
}

body.is-ready .card__rule {
  animation: fade-up 0.6s var(--ease) forwards;
  animation-delay: 1.05s;
}

body.is-ready .card__rule span {
  animation: rule-grow 1.1s var(--ease) forwards;
  animation-delay: 1.1s;
}

body.is-ready .socials__item {
  animation: fade-up 0.8s var(--ease) forwards;
}

body.is-ready .socials__item:nth-child(1) { animation-delay: 1.3s; }
body.is-ready .socials__item:nth-child(2) { animation-delay: 1.4s; }
body.is-ready .socials__item:nth-child(3) { animation-delay: 1.5s; }
body.is-ready .socials__item:nth-child(4) { animation-delay: 1.6s; }

body.is-ready .card__letters .char {
  animation: char-in 1s var(--ease) forwards, shimmer 7s linear infinite;
  /* animation-delay is set inline per character by script.js: "<char-in delay>s, 1.8s" */
}

@keyframes char-in {
  to { opacity: 1; transform: translateY(0) rotateX(0); filter: blur(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rule-grow {
  from { width: 0; }
  to { width: 220px; }
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: -220% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader,
  .preloader__mark,
  body.is-ready .card__eyebrow,
  body.is-ready .card__rule,
  body.is-ready .card__rule span,
  body.is-ready .socials__item,
  body.is-ready .card__letters,
  .card__letters .char {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
  .card__rule span { width: 220px; }
}

@media (max-width: 480px) {
  .socials__item {
    width: 46px;
    height: 46px;
  }
  .glow {
    width: 420px;
    height: 420px;
    margin-left: -210px;
    margin-top: -210px;
  }
}
