/* Audiowide & Manrope (SIL Open Font License), self-hosted latin subsets */
@font-face {
  font-family: "Audiowide";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/audiowide-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
}

:root {
  --bg: #101010;
  --red: #751414;
  --red-hi: #8d1c1c;
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.8);
  --radius-card: 28px;
  --radius-btn: 24px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Audiowide", "Arial Rounded MT Bold", system-ui, sans-serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Blurred hero behind the column (visible on screens wider than the column) */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #0b0b0b url("/images/bg-blur.jpg") center / cover no-repeat;
  background-image: image-set(url("/images/bg-blur.webp") type("image/webp"), url("/images/bg-blur.jpg") type("image/jpeg"));
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 30%, rgba(16, 16, 16, 0.2), rgba(16, 16, 16, 0.85));
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom));
  background-color: var(--bg);
  isolation: isolate;
}
/* Fine grain texture */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-size: 160px;
  opacity: 0.07;
  pointer-events: none;
}

@media (min-width: 480px) {
  .page {
    margin-block: 32px;
    min-height: auto;
    border-radius: 36px;
    box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #1a1a1a;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
  transform: translateZ(0); /* keep rounded clipping during transforms in Safari */
}
.hero__media {
  position: absolute;
  inset: -6% 0 0;
  will-change: transform;
}
.hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 16, 0) 45%, rgba(16, 16, 16, 0.55) 72%, var(--bg) 100%);
  pointer-events: none;
}
.hero__name {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 22px;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 14vw, 58px);
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Links ---------- */
.links {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px 14px 12px;
  border-radius: var(--radius-btn);
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--red-hi), var(--red) 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -12px 24px -12px rgba(0, 0, 0, 0.35),
    0 14px 30px -14px rgba(117, 20, 20, 0.75);
  transition: transform 0.45s var(--spring);
  isolation: isolate;
  touch-action: manipulation;
}
.link:active { transform: scale(0.965); transition-duration: 0.12s; transition-timing-function: ease-out; }
.link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (hover: hover) {
  .link:hover { transform: translateY(-2px); }
  .link:hover:active { transform: scale(0.965); }
}

.link__thumb {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 6px 14px -4px rgba(0, 0, 0, 0.5);
}
.link__body {
  display: grid;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.link__title {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.2;
}
.link__desc {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}
.link__arrow {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  align-self: center;
}

/* Featured button: breathing glow + slow shimmer */
.link--featured::before,
.link--featured::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}
.link--featured::before {
  inset: 0;
  z-index: -1;
  box-shadow: 0 0 34px 2px rgba(200, 40, 40, 0.55);
  opacity: 0.6;
}
.link--featured::after {
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.13) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%;
  opacity: 0;
}
.is-ready .link--featured::before { animation: breathe 4.2s ease-in-out infinite; }
.is-ready .link--featured::after { animation: shimmer 6s var(--ease-out) infinite; }
@supports (clip-path: inset(0 round 24px)) {
  .link--featured::after { clip-path: inset(0 round var(--radius-btn)); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes shimmer {
  0% { opacity: 1; background-position: 130% 0; }
  30% { opacity: 1; background-position: -30% 0; }
  31%, 100% { opacity: 0; background-position: -30% 0; }
}

/* ---------- Entrance (CSS-only; content is always visible without JS) ---------- */
@keyframes hero-in { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero { animation: hero-in 1.1s var(--ease-out) backwards; }
.hero__name { animation: rise 0.9s var(--ease-out) 0.35s backwards; }
.link { animation: rise 0.8s var(--ease-out) backwards; }
.link:nth-child(1) { animation-delay: 0.55s; }
.link:nth-child(2) { animation-delay: 0.68s; }
.link:nth-child(3) { animation-delay: 0.81s; }
.link:nth-child(4) { animation-delay: 0.94s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .link--featured::before { opacity: 0.6; }
  .hero__media { transform: none !important; }
}
