/* tyler ♡ — gothic / emo-alternative linktree
   Near-black smoked glass, blood-crimson + cold silver, blackletter name,
   candle flicker + drifting embers. Dark, moody, sharp. */

@font-face {
  font-family: "Pirata One";
  src: url("/fonts/pirataone.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --void:      #07070a;
  --ink:       #0c0c11;
  --smoke:     rgba(18, 16, 22, 0.62);
  --smoke-line:rgba(180, 30, 45, 0.32);
  --blood:     #a31621;
  --blood-2:   #6e0f18;
  --blood-glow:rgba(196, 30, 45, 0.55);
  --silver:    #cfd2d8;
  --bone:      #ecebef;
  --ash:       #8f8a97;
  --shadow:    0 34px 90px -30px rgba(0, 0, 0, 0.9);

  --display: "Pirata One", "Old English Text MT", "UnifrakturCook", Georgia, serif;
  --sans:    ui-sans-serif, "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 5vw, 40px);
  font-family: var(--sans);
  color: var(--silver);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Background: her photo, drowned in dark + crimson, heavy vignette ---- */
.bg {
  position: fixed;
  inset: -8%;
  z-index: -2;
  /* dark gothic gradient (used when no background photo is set) */
  background:
    radial-gradient(90% 65% at 50% 14%, #1d0e14 0%, #0d0c11 50%, #060608 100%);
  background-size: cover;
  background-position: center;
  /* if a background photo IS set (inline background-image), darken it */
  filter: brightness(0.9);
  transform: scale(1.08);
  animation: drift 30s ease-in-out infinite alternate;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 75% at 50% 28%, rgba(163, 22, 33, 0.18), transparent 60%),
    radial-gradient(120% 120% at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.86) 100%),
    linear-gradient(180deg, rgba(7,7,10,0.55), rgba(7,7,10,0.78));
  animation: breathe 9s ease-in-out infinite;
}
@keyframes drift {
  from { transform: scale(1.14) translate3d(-1.2%, -1%, 0); }
  to   { transform: scale(1.2) translate3d(1.2%, 1.4%, 0); }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.86; }
}

/* ---- Card: smoked glass with a blood hairline ---- */
.card {
  position: relative;
  width: min(412px, 100%);
  padding: clamp(28px, 6vw, 42px) clamp(20px, 5vw, 34px) clamp(20px, 4vw, 26px);
  text-align: center;
  background: var(--smoke);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
  backdrop-filter: blur(16px) saturate(0.9);
  border: 1px solid var(--smoke-line);
  border-radius: 14px;
  box-shadow: var(--shadow), 0 0 60px -24px var(--blood-glow), inset 0 1px 0 rgba(255,255,255,0.05);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), transparent 34%);
}

/* ---- Avatar ---- */
.avatar {
  width: clamp(104px, 30vw, 130px);
  height: clamp(104px, 30vw, 130px);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 18px;
  filter: grayscale(0.35) contrast(1.05) brightness(0.95);
  border: 2px solid rgba(207, 210, 216, 0.5);
  box-shadow: 0 0 0 4px rgba(163, 22, 33, 0.55), 0 0 26px -4px var(--blood-glow);
}

/* ---- Name: blackletter, bone with a flickering blood glow ---- */
.name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--bone);
  text-shadow:
    0 0 1px rgba(255,255,255,0.4),
    0 0 14px var(--blood-glow),
    0 0 30px rgba(163, 22, 33, 0.4);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker {
  0%, 100%       { opacity: 1; }
  41%, 43%       { opacity: 1; }
  42%            { opacity: 0.62; }
  62%, 64%, 66%  { opacity: 1; }
  63%, 65%       { opacity: 0.74; }
  88%            { opacity: 0.9; }
}
.tagline {
  margin: 12px auto 28px;
  font-size: clamp(11px, 3.2vw, 13px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ash);
}

/* heart glyph — crimson, glowing, forced text presentation */
.hrt {
  -webkit-text-fill-color: var(--blood);
  color: var(--blood);
  font-variant-emoji: text;
  font-family: var(--sans);
  display: inline-block;
  text-shadow: 0 0 10px var(--blood-glow);
  transform: translateY(0.02em);
  margin-left: 0.08em;
}
.name .hrt { font-size: 0.5em; vertical-align: 0.28em; }

/* ---- Links ---- */
.links { display: flex; flex-direction: column; gap: 13px; }

.link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .22s ease, border-color .22s ease, background .22s ease;
  will-change: transform;
}
.link__emoji { font-size: 17px; line-height: 1; }
.link:hover { transform: translateY(-2px); }
.link:active { transform: translateY(0) scale(.985); }

/* primary — blood gradient, bone text, pulsing glow + sheen sweep */
.link--primary {
  color: var(--bone);
  background: linear-gradient(100deg, var(--blood-2), var(--blood) 55%, #c81d2c);
  background-size: 200% 100%;
  border: 1px solid rgba(196, 30, 45, 0.8);
  box-shadow: 0 14px 30px -14px rgba(163, 22, 33, 0.9), 0 0 22px -6px var(--blood-glow);
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.link--primary:hover { box-shadow: 0 18px 38px -14px rgba(163, 22, 33, 1), 0 0 34px -6px var(--blood-glow); }

/* social — dark glass, silver text, crimson hairline */
.link--social {
  color: var(--silver);
  background: rgba(20, 18, 24, 0.55);
  border: 1px solid rgba(207, 210, 216, 0.16);
  box-shadow: 0 10px 24px -16px #000;
}
.link--social:hover {
  border-color: rgba(196, 30, 45, 0.7);
  box-shadow: 0 12px 26px -14px #000, 0 0 18px -6px var(--blood-glow);
  background: rgba(28, 22, 28, 0.6);
}

/* ---- Footer ---- */
.foot {
  margin-top: 24px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ash);
  opacity: 0.6;
}

/* ---- Drifting embers (injected by client.js) ---- */
.sparkles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute;
  bottom: -12px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff5a43 0%, var(--blood) 55%, transparent 75%);
  box-shadow: 0 0 8px 1px var(--blood-glow);
  opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.7); }
  12%  { opacity: 0.9; }
  80%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-104vh) translateX(14px) scale(1.1); }
}

/* ---- Entrance reveal (CSS-only, works without JS) ---- */
@keyframes appear {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.avatar, .name, .tagline, .link, .foot {
  animation: appear .8s cubic-bezier(.2,.7,.2,1) both;
}
.avatar  { animation-delay: .05s; }
.name    { animation-delay: .18s; }
.tagline { animation-delay: .3s; }
.link:nth-child(1) { animation-delay: .42s; }
.link:nth-child(2) { animation-delay: .52s; }
.link:nth-child(3) { animation-delay: .62s; }
.link:nth-child(4) { animation-delay: .72s; }
.foot    { animation-delay: .86s; }
/* name keeps flickering after it appears */
.name { animation: appear .8s cubic-bezier(.2,.7,.2,1) both, flicker 6s 1.1s infinite steps(1); }
.link--primary { animation: appear .8s cubic-bezier(.2,.7,.2,1) both, sheen 7s 1.1s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .avatar, .name, .tagline, .link, .foot { opacity: 1; transform: none; }
  .sparkles { display: none; }
}
