/* =======================================================================
   Home v2 — dark / liquid glass / violet aura
   Layered on top of style.css, scoped to body.home only.
   ===================================================================== */

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

body.home {
  --violet-900: #150b2e;
  --violet-700: #3d1f8c;
  --violet-500: #7c4dff;
  --violet-400: #9b7bff;
  --violet-200: #cabdff;
  --chrome-1: #f4f3fb;
  --chrome-2: #a9a6c2;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  background: #030304;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Ambient aura background -------------------------------------- */
.bg-aura {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.bg-aura .aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
}
.aura-1 {
  width: 620px; height: 620px;
  top: -160px; left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--violet-500), transparent 70%);
  animation: drift1 24s ease-in-out infinite;
}
.aura-2 {
  width: 520px; height: 520px;
  top: 10%; right: -160px;
  background: radial-gradient(circle at 60% 40%, var(--violet-400), transparent 70%);
  animation: drift2 28s ease-in-out infinite;
}
.aura-3 {
  width: 480px; height: 480px;
  bottom: -140px; left: 30%;
  background: radial-gradient(circle at 50% 50%, var(--violet-700), transparent 70%);
  animation: drift3 32s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.12); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, 40px) scale(1.08); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -60px) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-aura .aura { animation: none; }
}

/* ---------- Glass header, sitting on the reel ---------------------------- */
body.home .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
/* Tall, smoothly-fading scrim behind the header — taller than the header's
   own box so there's no hard seam where it meets the video below. */
body.home .site-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 240px;
  background: linear-gradient(180deg, rgba(3,3,4,0.6) 0%, rgba(3,3,4,0.28) 50%, rgba(3,3,4,0) 100%);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.4s ease;
}
body.home .site-header.scrolled {
  background: rgba(8, 7, 12, 0.6);
  border-bottom-color: var(--glass-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
body.home .site-header.scrolled::before { opacity: 0; }
body.home .nav-desktop a,
body.home .logo {
  color: rgba(244, 243, 251, 0.88);
}
body.home .nav-desktop a:hover,
body.home .nav-desktop a.active { color: #fff; }
body.home .burger span { background: #fff; }

body.home main { position: relative; z-index: 1; }

/* ---------- Reel (hero) ---------------------------------------------------- */
.reel {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-media {
  position: absolute;
  inset: 0;
  background: #0a0810;
}

/* Shared "cover" treatment for a background Vimeo iframe (each project
   block): scaled/centered to always fill its container, cross-fading in
   over the poster underneath once it has loaded. */
.bg-video {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  min-width: 100%; min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.bg-video.is-loaded { opacity: 1; }
.bg-video.is-loaded ~ .pblock-poster { opacity: 0; }

/* scale-to-cover trick for the 16:9 vimeo background iframe */
@media (min-aspect-ratio: 16/9) {
  .bg-video { height: 56.25vw; }
}
@media (max-aspect-ratio: 16/9) {
  .bg-video { width: 177.78vh; }
}

/* Self-hosted showreel video — a real <video> element, so object-fit
   handles the "cover" sizing directly (no scale hack needed). */
.reel-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.reel-native.is-loaded { opacity: 1; }
.reel-native.is-loaded ~ .reel-poster { opacity: 0; }

.reel-media img.reel-poster {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 1s ease;
}

.reel-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(3,3,4,0.85), transparent 60%),
    linear-gradient(180deg, rgba(3,3,4,0.55) 0%, rgba(3,3,4,0.15) 30%, rgba(3,3,4,0.25) 65%, rgba(3,3,4,0.9) 100%);
}

.reel-scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(244,243,251,0.85);
  width: 30px;
  height: 30px;
  animation: bob 2.2s ease-in-out infinite;
}
.reel-scroll-cue svg { display: block; width: 100%; height: 100%; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* On tall/narrow (mobile) screens a 16:9 "cover" crop cuts the name off
   the sides of the frame — switch to a blurred cover backdrop + a
   letterboxed "contain" video on top, so the full name stays readable. */
@media (max-width: 700px) {
  .reel-media { background: #0a0810; }
  .reel-media::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("/assets/img/showreel-poster.webp");
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.55);
    transform: scale(1.15);
  }
  .reel-native,
  .reel-media img.reel-poster {
    object-fit: contain;
  }
}

/* ---------- Projects -------------------------------------------------------- */
.projects-v2 {
  position: relative;
  z-index: 1;
  padding: 48px 0;
}
.projects-v2 .container { max-width: 1280px; }

.pblock-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pblock {
  position: relative;
  display: block;
  width: 100%;
  height: 76vh;
  min-height: 460px;
  max-height: 800px;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: #0c0a13;
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  transition: box-shadow 0.5s ease;
}

.pblock-media {
  position: absolute;
  inset: 0;
}

/* poster (real photo, or an animated placeholder when there is none) —
   sits under the video and fades out once the video has loaded */
.pblock-poster {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 1s ease;
}
img.pblock-poster { filter: saturate(0.96) brightness(0.86); }

.pblock-collage {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  overflow: hidden;
  background: #0a0812;
}
.pblock-collage.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pblock-collage.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pblock-collage.cols-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pblock-collage img {
  display: block;
  width: 100%; height: 100%;
  min-width: 0; min-height: 0;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.82);
  transition: filter 0.6s ease;
}
.pblock:hover .pblock-collage img { filter: saturate(1.05) brightness(0.6); }

.pblock-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(124,77,255,0.35), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(184,166,255,0.25), transparent 55%),
    linear-gradient(160deg, #17101f, #0a0812 70%);
  background-size: 220% 220%, 220% 220%, 100% 100%;
  animation: mesh-shift 14s ease-in-out infinite;
}
@keyframes mesh-shift {
  0%, 100% { background-position: 0% 0%, 100% 100%, 0 0; }
  50% { background-position: 40% 30%, 60% 70%, 0 0; }
}

.pblock-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,4,8,0.1) 0%, rgba(5,4,8,0.05) 30%, rgba(5,4,8,0.55) 78%, rgba(5,4,8,0.92) 100%);
  transition: background 0.5s ease;
}
.pblock:hover .pblock-scrim {
  background: linear-gradient(180deg, rgba(5,4,8,0.25) 0%, rgba(5,4,8,0.2) 30%, rgba(5,4,8,0.65) 75%, rgba(5,4,8,0.95) 100%);
}

/* glowing shimmer ring — wide, bright arc that sweeps the border, much more
   visible than a thin hairline */
.pblock::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: conic-gradient(from var(--angle),
    transparent 0deg,
    var(--violet-400) 35deg,
    var(--violet-200) 75deg,
    var(--chrome-1) 100deg,
    var(--violet-200) 125deg,
    var(--violet-400) 165deg,
    transparent 220deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: spin-angle 6s linear infinite;
  pointer-events: none;
}
.pblock:hover::after { opacity: 1; }
.pblock:hover {
  box-shadow: 0 0 130px 10px rgba(155, 123, 255, 0.8), 0 24px 60px -20px rgba(0,0,0,0.75);
}
@keyframes spin-angle {
  to { --angle: 360deg; }
}

.pblock-body {
  position: absolute;
  left: 40px; right: 40px; bottom: 20px;
  z-index: 2;
}
.pblock-body h3 {
  margin: 0 0 10px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(40px, 8vw, 128px);
  line-height: 0.94;
  letter-spacing: -0.01em;
  color: #fff;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.45));
}
.pblock-desc {
  margin: 14px 0 0;
  max-width: 640px;
  height: 80px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  color: rgba(244,243,251,0.85);
  font-size: 15px;
  line-height: 1.55;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.pblock:hover .pblock-desc,
.pblock:focus-visible .pblock-desc {
  opacity: 1;
  transform: translateY(0);
}

.pblock-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--violet-200);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pblock:hover .pblock-cta,
.pblock:focus-visible .pblock-cta { opacity: 1; transform: translateY(0); }
.pblock-cta svg { width: 14px; height: 14px; transition: transform 0.3s ease; }
.pblock:hover .pblock-cta svg { transform: translateX(3px); }

@media (max-width: 900px) {
  .pblock { height: 68vh; min-height: 420px; }
  .pblock-stack { gap: 20px; }
  .pblock-collage.cols-6 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
  .pblock-body { left: 24px; right: 24px; bottom: 18px; }
  .pblock-body h3 { font-size: clamp(34px, 10vw, 72px); }
}

@media (max-width: 520px) {
  .pblock { height: 60vh; min-height: 380px; }
  .pblock-body { left: 18px; right: 18px; bottom: 14px; }
  .pblock-desc { display: none; }
}

/* Touch devices have no hover — reveal the CTA and description permanently
   so they aren't hidden behind an interaction that can't happen. */
@media (hover: none) {
  .pblock-cta { opacity: 1; transform: translateY(0); }
  .pblock-desc { opacity: 1; transform: translateY(0); }
  .pblock-scrim {
    background: linear-gradient(180deg, rgba(5,4,8,0.2) 0%, rgba(5,4,8,0.15) 30%, rgba(5,4,8,0.62) 78%, rgba(5,4,8,0.94) 100%);
  }
}

/* ---------- What I do ---------------------------------------------------- */
.skills-v2 {
  position: relative;
  z-index: 1;
  padding: 40px 0 64px;
  background: linear-gradient(180deg,
    rgba(3,3,4,0) 0%,
    rgba(5,3,10,0.55) 20%,
    rgba(9,5,20,0.85) 45%,
    #170e35 85%,
    #170e35 100%);
}
.skills-v2 .container { max-width: 1280px; }
.skills-v2 h2 {
  margin: 0 0 32px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  color: #fff;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.skill-tile {
  padding: 30px 26px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.skill-tile:hover {
  background: var(--glass-bg-strong);
  border-color: rgba(155, 123, 255, 0.5);
  transform: translateY(-3px);
}
.skill-tile p {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 500;
  color: rgba(244, 243, 251, 0.92);
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- Outro: sky gradient behind the footer ------------------------- */
body.home .site-footer {
  position: relative;
  z-index: 1;
  border-top: none;
  padding: 130px 0 40px;
  background: linear-gradient(180deg,
    #170e35 0%,
    #402085 26%,
    #7c4dff 52%,
    #c2aeff 76%,
    #f6f3ff 100%);
}
body.home .footer-inner {
  color: #4a3f6b;
}
body.home .footer-inner a:hover { color: #241c3d; }

@media (max-width: 700px) {
  body.home .site-footer { padding: 90px 0 32px; }
}
