/* Base theme variables */
:root {
  --bg: #090909;
  --bg-accent: #0c0c0e;
  --fg: #e9e9eb;
  --muted: #b8b8bd;
  --brand: #ff3939; /* accent red */
  --brand-2: #e02020; /* deeper red */
  --card: #141416;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 10px 30px rgba(0,0,0,0.40);
  --radius: 14px;
  --marquee-speed: 48s; /* base speed, slowed a bit */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: radial-gradient(1000px 700px at 80% -10%, rgba(255,57,57,0.16), transparent 60%),
              radial-gradient(900px 600px at 10% -10%, rgba(224,32,32,0.12), transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg-accent));
  background-attachment: fixed;
}

.page {
  position: relative;
  z-index: 10; /* above background marquees */
  min-height: 100vh; /* fallback for older browsers */
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 80px; /* leave breathing room above fixed footer */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  justify-content: center; /* center content vertically */
}

@supports (height: 100dvh) {
  .page { min-height: 100dvh; }
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Three fixed background marquees */
.marquees { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.marquee { position: absolute; left: 0; width: 100vw; overflow: hidden; display: flex; align-items: center; }
.band-top { top: 0; height: 33.333vh; }
.band-middle { top: 33.333vh; height: 33.333vh; filter: blur(1.2px) brightness(0.85); opacity: 0.7; }
.band-bottom { top: 66.666vh; height: 33.333vh; }

.marquee .track { display: flex; align-items: center; gap: 48px; will-change: transform; animation: marquee-left var(--marquee-speed) linear infinite; }
.marquee .track.right { animation-name: marquee-right; }
.marquee img { height: calc(33.333vh - 48px); max-height: 240px; opacity: 0.90; filter: drop-shadow(0 0 22px rgba(255,57,57,0.35)) drop-shadow(0 6px 18px rgba(0,0,0,0.45)); }

@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Soften/slow marquee on tablets/phones and narrow viewports */
@media (max-width: 1024px) {
  :root { --marquee-speed: 56s; }
}
@media (max-width: 640px) {
  :root { --marquee-speed: 65s; }
  .band-middle { opacity: 0.6; filter: blur(1px) brightness(0.8); }
}
@media (hover: none) and (pointer: coarse) {
  :root { --marquee-speed: 72s; }
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

/* keep profile tidy but no negative offset so vertical centering is accurate */
.profile { margin-top: 0; }

.bio {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.links {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  justify-content: center;
  justify-items: center;
  gap: 20px 28px;
  max-width: 520px;
  margin: 0 auto;
}

/* Circular link buttons */
.round {
  position: relative;
  width: 64px; height: 64px;
  display: inline-block;
  text-decoration: none;
  color: var(--fg);
  will-change: transform;
  transform: translateZ(0);
  border-radius: 999px; /* ensure true circular hit area */
  outline: none;
}

.round::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,57,57,0.55);
  background: radial-gradient(60% 60% at 50% 35%, rgba(255,57,57,0.20), rgba(255,57,57,0.05)) , #0e0e10;
  box-shadow: 0 0 0 4px rgba(255,57,57,0.10), 0 12px 30px rgba(255,57,57,0.22), var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.round:hover::before,
.round:focus-visible::before {
  transform: translateY(-1px) scale(1.05);
  border-color: rgba(255,57,57,0.85);
  box-shadow: 0 0 0 4px rgba(255,57,57,0.16), 0 16px 36px rgba(255,57,57,0.28), var(--shadow);
}

/* Micro-spring hover/focus animation */
.round:hover,
.round:focus-visible { animation: spring 360ms cubic-bezier(.2,.8,.3,1); }
.round:hover img,
.round:focus-visible img { animation: spring-icon 360ms cubic-bezier(.2,.8,.3,1); }
.round:active { transform: scale(0.97); }
.round:active::before { transform: translateY(0) scale(1.02); }

.round img {
  position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  filter: drop-shadow(0 0 8px rgba(255,57,57,0.25));
}

@keyframes spring {
  0%   { transform: translateZ(0) scale(1); }
  40%  { transform: translateZ(0) scale(1.12); }
  70%  { transform: translateZ(0) scale(0.985); }
  100% { transform: translateZ(0) scale(1); }
}

@keyframes spring-icon {
  0%   { transform: translate(-50%, -50%) scale(1); }
  45%  { transform: translate(-50%, -50%) scale(1.18); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@media (min-width: 640px) {
  .round { width: 72px; height: 72px; }
  .round img { width: 28px; height: 28px; }
}

.icon { font-size: 18px; opacity: 0.9; }

.icon-svg { width: 20px; height: 20px; opacity: 0.95; filter: drop-shadow(0 0 8px rgba(255,57,57,0.25)); }

.socials {
  display: flex;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  text-decoration: none;
  color: var(--fg);
  border-radius: 999px;
  border: 1px solid rgba(255,57,57,0.45);
  background: rgba(255,57,57,0.08);
  box-shadow: 0 0 0 3px rgba(255,57,57,0.10), 0 8px 24px rgba(255,57,57,0.18), var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.chip img { width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(255,57,57,0.25)); }

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255,57,57,0.75);
  background: rgba(255,57,57,0.16);
}

@media (min-width: 640px) { .bio { font-size: 15px; } }

/* Fixed footer links */
.site-footer-link {
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 120ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
  z-index: 50;
  max-width: 46vw; /* prevent overlap on small screens */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-footer-link:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(255,57,57,0.45);
  background: rgba(255,57,57,0.10);
}
.site-footer-link:focus-visible { outline: none; border-color: rgba(255,57,57,0.55); color: #fff; }
.site-footer-link.left { left: max(14px, env(safe-area-inset-left)); }
.site-footer-link.right { right: max(14px, env(safe-area-inset-right)); }

/* Responsive footer label: show short label on narrow screens */
.site-footer-link .label-short { display: none; }
.site-footer-link .label-full { display: inline; }

@media (max-width: 420px) {
  .site-footer-link .label-short { display: inline; }
  .site-footer-link .label-full { display: none; }
}

@media (max-width: 360px) {
  .site-footer-link { font-size: 12px; padding: 7px 9px; }
}

/* Accessibility: respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .marquee .track { animation: none; }
  .round:hover,
  .round:focus-visible,
  .round:hover img,
  .round:focus-visible img { animation: none; }
  .round:hover::before,
  .round:focus-visible::before { transform: translateY(-1px); }
}

/* Optional: trippy hover variant (enable by adding `trippy` class on body) */
body.trippy .round::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(
    from 0deg,
    rgba(255,57,57,0.0) 0deg,
    rgba(255,57,57,0.35) 90deg,
    rgba(64,160,255,0.35) 180deg,
    rgba(160,64,255,0.35) 270deg,
    rgba(255,57,57,0.0) 360deg
  );
  filter: blur(10px) contrast(1.1) saturate(1.2);
  mix-blend-mode: screen;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
body.trippy .round:hover::after,
body.trippy .round:focus-visible::after { opacity: 0.9; animation: spin 3.5s linear infinite; }
body.trippy .round:hover img,
body.trippy .round:focus-visible img {
  filter: hue-rotate(12deg) saturate(1.35)
    drop-shadow(0 0 10px rgba(255,57,57,0.35))
    drop-shadow(0 0 12px rgba(64,160,255,0.30));
}

/* About page text layout */
.about {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  background: linear-gradient(180deg, rgba(255,57,57,0.06), rgba(255,57,57,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
.about-title {
  margin: 0 0 12px;
  font-size: 18px;
  color: #fff;
}
.about-copy {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.about-copy p { margin: 0 0 14px; }
.about-copy p:last-child { margin-bottom: 0; }
